I'm having a problem with the REST feature of Axis2. I hacked up a WSDL which
specifies a "findAuthors" method. I use RawXMLINOutMessageReceiver so, on the
Java side, the method looks like this:
public OMElement findAuthors(OMElement parameters);
This method works fine when I call it from SOAP. It gets a SOAP body that looks
like this:
<firstName>Bob</firstName>
<lastName>Smith</lastName>
</findAuthors>
Totally cool... But, calling it through the REST method with the URL:
http://localhost:8080/axis2/rest/books/findAuthors?firstName=Bob&lastName=Smith
Results in this OMElement:
<firstName>Bob</firstName>
<lastName>Smith</lastName>
</axis2ns3:findAuthors>
This fails because the firstName and lastName elements are in the wrong
namespace. They need to be in the "http://cbare.org/books-ws/" namespace and
they're not.
I guess calling a RawXML method using REST might be a nutty thing to want to
do. But leaving that aside, is there a problem with the way the framework
generates XML from a REST request? Or am I using it wrong? The REST binding for
that method looks like this:
<wsdl:binding name="booksHttpBinding" type="cbws:booksPortType">
<http:binding verb="POST"/>
<wsdl:operation name="findAuthors">
<http:operation location="findAuthors"/>
<wsdl:input>
<mime:content type="text/xml"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml"/>
</wsdl:output>
</wsdl:operation>
...
</wsdl:binding>
Is there something I need to tweak in here to let clue it in about the
namespaces?
Finally, for good measure, the WSDL type definition looks like this:
elementFormDefault="qualified">
<xsd:element name="findAuthors">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="firstName" type="xsd:string" nillable="true"
minOccurs="0" maxOccurs="1"/>
<xsd:element name="lastName" type="xsd:string" minOccurs="1"
maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
...
I'm using: Apache Axis2 1.1-SNAPSHOT build (October 31 2006), just in case that
matters. Thanks for any hints,
- Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]