axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Sprat <rexclaim...@yahoo.com>
Subject Re: [Axis2] REST web service
Date Tue, 31 Jul 2012 21:12:20 GMT
There is a comment before the response element but it is not commented out.  I don't think
the SOAP request would work if the response was commented out.

It looks like the original message has been lost.  I can access the web service with REST
but always get a blank response.

I have a WSDL 1.1 web service with 2 operations.  The service was generated with 
wsdl2java in 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
 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; />


Thanks.
-J

________________________________
From: Martin Gainty <mgainty@hotmail.com>
To: java-user@axis.apache.org 
Sent: Tuesday, July 31, 2012 4:11 PM
Subject: RE: [Axis2] REST web service



any reason why your response element is commented out?

<!-- Echo Response Type --><xsd:element name="echoResponse" type="xsd:string"/>can
you un-comment echoResponse and redeploy?

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung


> Date: Tue, 31 Jul 2012 12:49:40 -0700
> From: rexclaimer2@yahoo.com
> Subject: Re: [Axis2] REST web service
> To: java-user@axis.apache.org; rexclaimer2@yahoo.com
> 
> Kishanthan, Sagara, anyone..
> 
> Can someone assist with my problem?  I cannot get my web service to work via REST. 
It works perfectly with a SOAP request.
> 
> Thanks.
> J
> 
> ________________________________
> From: Jack Sprat <rexclaimer2@yahoo.com>
> To: "java-user@axis.apache.org" <java-user@axis.apache.org> 
> Sent: Monday, July 23, 2012 4:35 PM
> Subject: Re: [Axis2] REST web service
> 
> Hi Kishanthan.
> 
> I'm fairly certain that the WSDL is correct.  It works fine with a SOAP request and
"echoRequest" is the correct element name. With REST I get a response with the correct format
but the value is blank (see my first message for the details).  I don't know where the code
snippet you included below came from.  This is the snippet from the WSDL:
> 
> <xsd:simpleType name="EchoRequestType">
>     <xsd:restriction base="xsd:string">
>      <xsd:maxLength value="100"/>
>     </xsd:restriction>
>    </xsd:simpleType>
> 
> The following SOAP request works fine:
> 
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/%22; xmlns:ship="http://ws.estesexpress.com/shipmenttracking%22;>
>    <soapenv:Header/>
>    <soapenv:Body>
>       <ship:echoRequest>ping</ship:echoRequest>
>    </soapenv:Body>
> </soapenv:Envelope>
> 
> I still don't know where the problem lies.  Any help is appreciated.
> 
> Thanks,
> J
> 
> 
> ________________________________
> From: Kishanthan Thangarajah <kshanth2101@gmail.com>
> To: java-user@axis.apache.org; Jack Sprat <rexclaimer2@yahoo.com> 
> Cc: "axis-user@ws.apache.org" <axis-user@ws.apache.org> 
> Sent: Saturday, July 21, 2012 3:25 PM
> Subject: Re: [Axis2] REST web service
> 
> 
> Hi,
> 
> 
> On Fri, Jul 6, 2012 at 2:39 AM, Jack Sprat <rexclaimer2@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=thissstest
> 
> 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:simpleType name="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-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Mime
View raw message