问题
I'm relatively new to web services, but I need to integrate a call to an existing service in my application. Ideally, I'd like to use JAX-WS because I'm looking for the simplest, quickest-to-develop solution on my end, and MyEclipse is able to generate a JAX-WS client from a WSDL. Unfortunately, the WSDL I've inherited was built from what appears to be Axis using RPC. Will this still work? When trying to generate the code, I get these errors, and the web searches I've found seem to say that it's the service end that needs to upgrade:
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="impl:MyTypeList[]" />
</restriction>
WS-I: (BP2108) An Array declaration uses - restricts or extends - the soapEnc:Array type, or the wsdl:arrayType attribute is used in the type declaration
WS-I: (BP2122) A wsdl:types element contained a data type definition that is not an XML schema definition
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ws.host.com" use="encoded" />
WS-I: (BP2406) The use attribute of a soapbind:body, soapbind:fault, soapbind:header and soapbind:headerfault does not have value of "literal".
回答1:
Do you know what version of Axis was used by the service?
Your best bet is to generate a client using the same version of Axis that was used by the service. This is definitely the quickest-to-develop solution. Using JAX-WS will not work.
来源:https://stackoverflow.com/questions/2777118/jax-ws-client-with-axis-service