2013年7月24日星期三

axis2 client calls the service a rare exception SOAP message MUST NOT contain a DTD

Client code:
 RPCServiceClient serviceClient = new RPCServiceClient ();
Options options = serviceClient.getOptions ();
EndpointReference targetEPR = new EndpointReference ("http:// **** webservice url ****");

options.setTo (targetEPR); options.setTimeOutInMilliSeconds (20000); QName qName = new QName ("qname");
Object [] result = serviceClient.invokeBlocking (qName, commandIssuedParam.toArrays (), new Class [] {String.class}); System.out.println (result [0]);



with this client-side service when calling the service appeared abnormal


 


2013-07-22 16:40:32 main (BuilderUtil.java: 688) INFO - OMException in getSOAPBuilder
org.apache.axiom.om.OMException: SOAP message MUST NOT contain a Document Type Declaration (DTD)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createDTD (StAXSOAPModelBuilder.java: 461)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next (StAXOMBuilder.java: 279)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope (StAXSOAPModelBuilder.java: 204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder. (StAXSOAPModelBuilder.java: 154)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder. (StAXSOAPModelBuilder.java: 140)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder (BuilderUtil.java: 686)
at org.apache.axis2.transport.TransportUtils.createDocumentElement (TransportUtils.java: 215)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage (TransportUtils.java: 145)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage (TransportUtils.java: 108)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage (TransportUtils.java: 67)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse (OutInAxisOperation.java: 354)
at org.apache.axis2.description.OutInAxisOperationClient.send (OutInAxisOperation.java: 417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl (OutInAxisOperation.java: 229)
at org.apache.axis2.client.OperationClient.execute (OperationClient.java: 165)
at org.apache.axis2.client.ServiceClient.sendReceive (ServiceClient.java: 540)
at org.apache.axis2.client.ServiceClient.sendReceive (ServiceClient.java: 521)
at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking (RPCServiceClient.java: 102)





knees and begged the brightest god help
------ Solution ------------------------------ --------------
you want to make sure you set up the server side webservice No problem, you can enter in a browser to access the webservice access address and see if it can read wsdl file < br> ------ For reference only ---------------------------------------
wsdl not our own, really no problem
------ For reference only -------------------------- -------------
produce this problem is mainly due to webServiceUrl written question

For example: http://127.0.0.1/test/test?wsdl have documentation says you can remove? wsdl

I found removed and are accessible without removing, then why should I mention it?

there are some url like this: http://127.0.0.1/test/test/?wsdl him one more than the normal slash url

When we put? wsdl to Timothy and no attention to this "/" is also removed, it will produce above me that question

Thank you upstairs

没有评论:

发表评论