You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Rune Sindahl <rs...@lpt.dk> on 2011/10/24 16:10:45 UTC

REST PUT with optional parameters in URL

Hi Axis2C user group.

 

I have been struggling some time figuring out how to fetch the optional
parameters from the URL in a REST PUT request. Originally I had a query
string(key/value-list) in my http payload, but we decided to change this so
we instead receive an XML-payload in the body of the http-request. With the
query string I had no troubles fetching the key/value pairs from both the
URL and the body of the http-request, as this was automatically inserted
into the beginning of the axiom_node_t* that I retrieved all my values from.

 

The service.xml looks like this:

----SNIP----

<operation name="SetBusStopVisits"
mep="http://www.w3.org/2004/08/wsdl/in-out">

    <parameter
name="wsamapping">http://www.busservices.com/StopVisitsService/SetBusStopVis
its</parameter>

    <parameter name="RESTMethod">PUT</parameter>

    <parameter
name="RESTLocation">SetBusStopVisits/{BusNo}/{OriginTime}</parameter> 

    <!--BusNo and OriginTime are the optional parameters-->

</operation>

----SNIP----

 

With the XML-payload it seems different, I simply cannot find the parameters
{BusNo} and {OriginTime} inside the axiom_node_t*. 

 

Does anyone have any clue about how to fetch these values in a different way
than from the axiom_node_t* ?

 

Best Regards,

Rune Sindahl

 

 


SV: REST PUT with optional parameters in URL

Posted by Rune Sindahl <rs...@lpt.dk>.
To follow up on my own question I managed to fetch the parameters from the
URL manually by getting the endpoint_ref from the msg_ctx and then retrieve
the URL string that the requester used to access the resource, by calling
axis2_endpoint_ref_get_address(.). Then all that was left to do was to parse
the requested resource apart from the URL-string

 

Best regards,

Rune Sindahl

 

Fra: Rune Sindahl [mailto:rs@lpt.dk] 
Sendt: 24. oktober 2011 16:11
Til: c-user@axis.apache.org
Emne: REST PUT with optional parameters in URL

 

Hi Axis2C user group.

 

I have been struggling some time figuring out how to fetch the optional
parameters from the URL in a REST PUT request. Originally I had a query
string(key/value-list) in my http payload, but we decided to change this so
we instead receive an XML-payload in the body of the http-request. With the
query string I had no troubles fetching the key/value pairs from both the
URL and the body of the http-request, as this was automatically inserted
into the beginning of the axiom_node_t* that I retrieved all my values from.

 

The service.xml looks like this:

----SNIP----

<operation name="SetBusStopVisits"
mep="http://www.w3.org/2004/08/wsdl/in-out">

    <parameter
name="wsamapping">http://www.busservices.com/StopVisitsService/SetBusStopVis
its</parameter>

    <parameter name="RESTMethod">PUT</parameter>

    <parameter
name="RESTLocation">SetBusStopVisits/{BusNo}/{OriginTime}</parameter> 

    <!--BusNo and OriginTime are the optional parameters-->

</operation>

----SNIP----

 

With the XML-payload it seems different, I simply cannot find the parameters
{BusNo} and {OriginTime} inside the axiom_node_t*. 

 

Does anyone have any clue about how to fetch these values in a different way
than from the axiom_node_t* ?

 

Best Regards,

Rune Sindahl

 

 

Ingen virus fundet i denne indkommende meddelelse.
Kontrolleret af AVG - www.avg.com
Version: 9.0.917 / Virusdatabase: 271.1.1/3970 - Udgivelsesdato: 10/23/11
20:33:00