occurred: WSDLToJava Error: Thrown by JAXB: undefined element declaration 's:schema'
It should be noted here that you can only save as ccservice.wsdl in the web page, you cannot simply copy the web page, paste it into a text file, and save it as ccservice.wsdl , so that even after the following step2 , still gives an error
After doing this, running wsdl2java again reported the following error
After careful inspection and analysis by Ah Tang, it turns out that in the ccservice.wsdl file, there are two definitions of queryResponse and QueryResponse . It may be that the webservice is not case-sensitive in the net, but when the client of the webservice is generated in java, it is It is case sensitive, so the above error will be reported. In response to this, Atang (Network Time and Space) changed the name of QueryResponse to QueryResponse1 at that time , and changed all references to QueryResponse to QueryResponse1 in the ccservice.wsdl file . . Then run it again and everything is ok
Atang summarizes
When using cxf's wsdl2java command to process webservices generated by net or other languages, if an error occurs, carefully observe the description of the error message, and make targeted modifications by thinking and querying network resources by yourself.
The second way (solved with axis's webservice framework)
From the test of Atang (network time and space), the client of websercie can be generated without any modification
However, the following jar packages of axis are required to ensure the normal operation of the client code of the webservice generated by axis
Atang summarizes
If you find that the wsdl2java command of cxf cannot be executed normally, you may wish to use other webservice frameworks such as axix to solve the problem and solve the problem from a different angle.
Calling method
Ccservice ccservice = new Ccservice();
CcserviceSoap ccserviceSoap = ccservice.getCcserviceSoap();
ccserviceSoap.query(parameter 1, parameter 2,...);