日期:2014-05-18 浏览次数:20859 次
package org.lee;
import org.ws.HelloWorldInterface;
import org.ws.impls.HelloWorldImpls;
public class ClientMain {
public static void main(String[] args) {
HelloWorldImpls factory=new HelloWorldImpls();
//此处返回的是 远程WebService的代理.
HelloWorldInterface helloWorldInterface= factory .getHelloWorldImplsPort();
System.out.println(helloWorldInterface.sayHi("夏煜正"));
}
}
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Cannot create a secure XMLInputFactory
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:171)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:94)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:240)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:210)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:103)
at $Proxy29.sayHi(Unknown Source)
at org.lee.ClientMain.main(ClientMain.java:13)
+ private static boolean setRestrictionProperties(XMLInputFactory factory) {
+ //For now, we can only support Woodstox 4.2.x and newer as none of the other
+ //stax parsers support these settings
+ if (setProperty(factory, "com.ctc.wstx.maxAttributesPerElement", maxAttributeCount)
+ && setProperty(factory, "com.ctc.wstx.maxAttributeSize", maxAttributeSize)
+ && setProperty(factory, "com.ctc.wstx.maxChildrenPerElement", innerElementCountThreshold)
+ && setProperty(factory, "com.ctc.wstx.maxElementCount", maxElementCount)
+