Invoke the web service interface is a third-party company to provide the interface, as follows:
InvokeWsMethod (appletUrl, "method", dataJson. The toString (), secretKey);
Public static String invokeWsMethod (url String, the String method, the Object... Params) {
JaxWsDynamicClientFactory factory=JaxWsDynamicClientFactory. NewInstance ();
The Client Client=factory. CreateClient (url);
Object [] ret=null;
Try {
Ret=client. Invoke (method, params);
}
The catch (Exception e) {
}
Return ret==null | | ret. Length==0? Null: ret [0]. ToString ();
}
CodePudding user response:
Post the complete error messageCodePudding user response:
Accurately, invoke the webservice is sending a post request, can realize in java.net.HttpUrlConnectionSet in the header: the content-type for application/XML
To get the XML format in soapui, filling parameters, send the past with respect to ok
The original poster to this study, once and for all
CodePudding user response:
Your local tuning is not remote interfaces, you use a postman or soapui look, if you can prove that the code is rightCodePudding user response:
Complete error message is this:Org, apache CXF. Service. Factory. ServiceConstructionException: Failed to create the service.
At org, apache CXF. Wsdl11. WSDLServiceFactory. & lt; init> (WSDLServiceFactory. Java: 76)
At org, apache CXF. The endpoint. Dynamic. DynamicClientFactory. CreateClient (DynamicClientFactory. Java: 315)
At org, apache CXF. The endpoint. Dynamic. DynamicClientFactory. CreateClient (DynamicClientFactory. Java: 241)
At org, apache CXF. The endpoint. Dynamic. DynamicClientFactory. CreateClient (DynamicClientFactory. Java: 234)
At org, apache CXF. The endpoint. Dynamic. DynamicClientFactory. CreateClient (DynamicClientFactory. Java: 189)
At com. Epoint. Demo. InvokeWsMethod (Demo. Java: 81)
At com. Epoint. Demo. The main (Demo. Java: 46)
Under Caused by: javax.mail. WSDL. WSDLException: WSDLException: faultCode=PARSER_ERROR: Java. Lang. RuntimeException: always create a secure XMLInputFactory
At org, apache CXF. Wsdl11. WSDLManagerImpl. LoadDefinition (WSDLManagerImpl. Java: 264)
At org, apache CXF. Wsdl11. WSDLManagerImpl. GetDefinition (WSDLManagerImpl. Java: 181)
At org, apache CXF. Wsdl11. WSDLServiceFactory. & lt; init> (WSDLServiceFactory. Java: 74)
. Six more
Under Caused by: Java. Lang. RuntimeException: always create a secure XMLInputFactory
At org, apache CXF. Staxutils. Staxutils. CreateXMLInputFactory (staxutils. Java: 338)
At org, apache CXF. Staxutils. Staxutils. GetXMLInputFactory (staxutils. Java: 278)
At org, apache CXF. Staxutils. Staxutils. CreateXMLStreamReader (staxutils. Java: 1798)
At org, apache CXF. Staxutils. Staxutils. CreateXMLStreamReader (staxutils. Java: 1697)
At org, apache CXF. Wsdl11. WSDLManagerImpl. LoadDefinition (WSDLManagerImpl. Java: 251)
. Eight more