Namespace issue calling Axis2 web service from Flex4 with client generated by Flex Builder introspection
I have a java-based web service built with Axis2. The WSDL was generated by the Eclipse开发者_如何转开发 3.6 wizard.
I have a Flex 4 client built using introspection via the WSDL in Flash Builder 4.
For calls where the method takes a 'simple' type like String or int, it all seems OK, but for calls where the parameter is (on the Java side) and OMElement, ie XML data, I'm setting the following runtime error on the service:
org.apache.axis2.engine.AxisEngine - namespace mismatch require http://server.rsc.geo.othermaps.com found none
http://server.rsc.geo.othermaps.com is indeed the target namespace declared in the WSDL.
The same workflow (use autogenerated client built from web service introspection) worked fine against the same service in Flex 3, so I'm not sure where to start hunting. So I really need to manually add the namespace to the XML data I'm submitting?
D
If your XML that's coming back doesn't have the namespace declaration at the top, I would definitely add it.
You are trying to consume a SOAP Web Service created by Axis2.
Make sure that your SOAP enveloppe request namespace exactly matches the wsdl namespace :
Let's say your namespace name is : yourNamespace
Your HTTP POST request should look like this :
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:v2="yourNamespace">
<soap:Body>
<v2:yourActionName>
<v2:yourFirstParameter>yourFirstParameterValue</v2:yourFirstParameter>
<v2:yourSecondParameter>yourSecondParameterValue</v2:yourSecondParameter>
</v2:yourActionName>
</soap:Body>
</soap:Envelope>
and the WSDL should start with :
<wsdl:definitions targetNamespace="yourNamespace">
<wsdl:documentation>yourWebServiceProjectNameHere</wsdl:documentation>
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="yourNamespace">
精彩评论