Hi,

On Fri, Jul 6, 2012 at 2:39 AM, Jack Sprat <rexclaim...@yahoo.com> wrote:

> I have a WSDL 1.1 web service with 2 operations.  The service was
> generated from the WSDL with Axis2 1.6.1.  One operation is a simple echo
> that I am trying to invoke via REST.  The echo operation should return the
> request string in the response.  I can access the operation but nothing
> comes back in the response.  I thought it should work like this:
>
> http://mywebservice.com/test/services/ShipmentTrackingService/echo?echoRequest=test
>
>
I went through the given wsdl and schema. I think the issue here is that
"echoRequest" is not the name of the request element defined in wsdl and
that is why having it in the url fails. The following is my understanding
on how to make this work.

For example, if you have the following as the definition
for EchoRequestType in your wsdl,

   <xsd:complexType name="EchoRequestType">
     <xsd:sequence>
      <xsd:element minOccurs="0" name="val" nillable="true"
type="xsd:string"/>
     </xsd:sequence>
   </xsd:complexType>

Then invoking the echo operation via REST would be like,

http://localhost:8080/axis2/services/ShipmentTrackingService/echo?val=<http://localhost:8080/axis2/services/ShipmentTrackingService/echo?val=thisss>
test

You can see that the name of request element is "val" and it is given as
the request parameter in the url.

Thanks,
Kishanthan.


> I get a response but there is nothing in the response element.  It works
> fine when invoked via SOAP with soapUI.  The response I get is:
> <ship:echoResponse xmlns:ship=http://mynamespace.com/shipmenttracking; />
>
> The pertinent parts of the WSDL are shown below.
>
> <wsdl:types>
> <xsd:schema attributeFormDefault="qualified"
> elementFormDefault="qualified" targetNamespace="
> http://mywebservice.com/shipmenttracking%22; xmlns:xsd="
> http://www.w3.org/2001/XMLSchema%22%3Epe%3E%3Cxsd:simpleTypename="EchoRequestType";>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="100"/>
> </xsd:restriction>
> </xsd:simpleType>
> <!-- Echo Request Type -->
> <xsd:element name="echoRequest" type="tns:EchoRequestType"/>
> <!-- Echo Response Type --><xsd:element name="echoResponse"
> type="xsd:string"/>
> </xsd:schema>
> </wsdl:types>
>
> <!-- Define SOAP message names. -->
> <wsdl:message name="echoRequestMsg"><wsdl:part name="echoRequest"
> element="tns:echoRequest"></wsdl:part></wsdl:message>
> <wsdl:message name="echoResponseMsg"><wsdl:part name="echoResponse"
> element="tns:echoResponse"></wsdl:part></wsdl:message>
>
> Any help is appreciated.
>
> Thanks.
> J
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
> For additional commands, e-mail: java-user-h...@axis.apache.org
>
>

Reply via email to