Home > Back-end >  Webservice interface prompt Failed to create the service
Webservice interface prompt Failed to create the service

Time:09-16

When invoke the web service interface prompt Failed to create a service that has been deleted WSTX - asl - 3.2.9. Jar, write the demo and local interfaces are achievable, but, after the update to the Linux server will prompt the question, the server jars have been deleted, is this method is called the problems?
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 message

CodePudding user response:

Accurately, invoke the webservice is sending a post request, can realize in java.net.HttpUrlConnection
Set 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 right

CodePudding 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
  • Related