[WebService] the namespace on the "definitions" element, is not a valid SOAP version, soapwebservice
When the company accesses other people's interfaces through webservice, the IP address of the other party's webservice changes. After switching, it always reports an error. After searching for various methods on the Internet, we will summarize several possible solutions to this problem for the time being, it will be used in actual solutions.
Exception details:
org.apache.cxf.binding.soap.SoapFault: "http://schemas.xmlsoap.org/wsdl/", the namespace on the "definitions" element, is not a valid SOAP version.
javax.xml.ws.WebServiceException: org.apache.cxf.binding.soap.SoapFault: "http://schemas.xmlsoap.org/wsdl/", the namespace on the "definitions" element, is not a valid SOAP version.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:154)
Possible solutions:
1. Do not use factory. create to create a service when writing code. Instead, use the class generated by cxf to create a service, as shown below:
// Method JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean (); factory. setServiceClass (IWebPService. class); String address1 = "http: // 192.168.0.121: 9090/cloudsun/HelloWorldService? Wsdl "; factory. setAddress (address1); IWebPService ws1 = (IWebPService) factory. create (); // modify to initialize URL url = new URL (address1); IWebPService ws1 = new (url ). getWebPServiceImplPort ();
Reference: http://www.devexception.com/apache/31208.htm
2. When Address is set during the call, the Address set after factory. setAddress in method 1 will be? Remove wsdl:
For example: http:// Server IP/UA/TrustAuth? Wsdl
To:http:// Server IP/UA/TrustAuth
Reference: http://www.oschina.net/question/115223_37755
To sum up, you can use 1st methods to modify the settings once and for all.
Additional knowledge:
There is a way to use it during the search process
New WebPServiceImplService (). getWebPServiceImplPort () generates an object. After investigation, this method has two polymorphism methods,
Public IWebPService getWebPServiceImplPort (WebServiceFeature... features)
Public IWebPService getWebPServiceImplPort (){
I personally understand that the previous WebServiceFeature is used to change the corresponding address or other information. It may be an incorrect understanding, and I have made some in-depth understanding about it:
WebServiceFeature is an abstract class, which has the following sub-classes:
javax.xml.ws.RespectBindingFeature
javax.xml.ws.soap.AddressingFeature
javax.xml.ws.soap.MTOMFeature
I haven't figured out what this category is for after searching for a long time. Some people who know it may help me to answer the question. I will have the opportunity to study it further in the future.
Reference: http://www.massapi.com/class/ad/AddressingFeature.html
Error when running webservice: orgapacheaxis2databindingADBException: Unexpected subelement dataCollect
I don't know how to solve this problem.
However, since it is a running error, you must follow the log file
Check the log.
The following error occurs when you call the WebService interface through RPC: First Element must contain the local name, Envelope, but fo