BDF2 WebService使用基于XFire的Dynamic Client实现Webservice调用执行到Object[] obj=client.invoke()报错

public static void main(String[] args) throws Exception {
URL url=new URL("xxxxxxxxxxxxx");
Client client = new Client(url);
String serviceurl = client.getUrl();
Element root = new Element("SupportResourceRequest");
Element company=new Element("aircrafttype");
company.setContent(new Text("xx"));
root.addContent(company);
Element userCount=new Element("sendStatus");
userCount.setContent(new Text("0"));
root.addContent(userCount);
Object[] params = new Object[]{root};
Object[] obj=client.invoke("SupportResource",params);
DocumentImpl doc=(DocumentImpl)obj[0];
Node node=doc.getFirstChild().getFirstChild();
NodeList list=node.getChildNodes();
for(int i=0;i<list.getLength();i++){
Node userNode=list.item(i);
System.out.println("username:"+userNode.getFirstChild().getTextContent());
}
}
Exception in thread "main" org.codehaus.xfire.fault.XFireFault: java.lang.NullPointerException
    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.Client.invoke(Client.java:368)
    at com.ws.TestSupportRequestClient.main(TestSupportRequestClient.java:30)
已邀请:

要回复问题请先登录注册