xfire 开发webservice部署在tomcat/JBoss上一切正常,客户端可以调用,可是部署在webspheres上后客户端不能调用,出现下列异常
客户端代码:
Service srvcModel = new ObjectServiceFactory().create(SoApply.class);
XFireProxyFactory factory = new XFireProxyFactory(XFireFactory
.newInstance().getXFire());
String helloWorldURL = "http://IP:PROT/XXXX";
try
{
SoApply srvc = (SoApply) factory.create(srvcModel, helloWorldURL);
XFireProxy proxy = (XFireProxy) Proxy.getInvocationHandler(srvc);
Client client = proxy.getClient();
client.addOutHandler(new ClientAuthenticationHandler("abcd","123456"));
System.out.println(srvc.getData(xmlstring));
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
异常信息:
org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Index: 0, Size: 0
org.codehaus.xfire.fault.XFireFault: Index: 0, Size: 0
at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31)
at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerializer.java:28)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:111)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:67)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Client.onReceive(Client.java:406)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
at org.codehaus.xfire.client.Client.invoke(Client.java:336)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy0.getData(Unknown Source)
at com.chnet.service.CSIPClient.callService(CSIPClient.java:85)
at com.chnet.service.CSIPClient.main(CSIPClient.java:26)
客户端代码:
Service srvcModel = new ObjectServiceFactory().create(SoApply.class);
XFireProxyFactory factory = new XFireProxyFactory(XFireFactory
.newInstance().getXFire());
String helloWorldURL = "http://IP:PROT/XXXX";
try
{
SoApply srvc = (SoApply) factory.create(srvcModel, helloWorldURL);
XFireProxy proxy = (XFireProxy) Proxy.getInvocationHandler(srvc);
Client client = proxy.getClient();
client.addOutHandler(new ClientAuthenticationHandler("abcd","123456"));
System.out.println(srvc.getData(xmlstring));
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
异常信息:
org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Index: 0, Size: 0
org.codehaus.xfire.fault.XFireFault: Index: 0, Size: 0
at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31)
at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerializer.java:28)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:111)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:67)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Client.onReceive(Client.java:406)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
at org.codehaus.xfire.client.Client.invoke(Client.java:336)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy0.getData(Unknown Source)
at com.chnet.service.CSIPClient.callService(CSIPClient.java:85)
at com.chnet.service.CSIPClient.main(CSIPClient.java:26)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货