Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe what you are looking for is the <code>REST_URL_POSTFIX</code> property. If you set this property, the value will be appended to the rest endpoint url. </p> <p>It can be defined as follows with the scope of axis2.</p> <pre><code>&lt;property name="REST_URL_POSTFIX"           expression="//client"           scope="axis2"          type="STRING"/&gt; </code></pre> <p>An example on this can be found in this guide, <a href="http://docs.wso2.org/wiki/display/ESB460/Using+REST+with+a+Proxy+Service#UsingRESTwithaProxyService-SOAPClientandRESTService" rel="nofollow">Using REST with a Proxy Service</a>.</p> <p>EDIT: Following is example using a simple proxy with a POST request using curl. Providing as per the comments. Here, I'm invoking the jaxrs_basic rest service in WSO2 Application Server.</p> <pre><code>curl -H "Content-Type: application/xml" -H "Accept: application/json" -d "&lt;Customer&gt;&lt;name&gt;KasunG&lt;/name&gt;&lt;/Customer&gt;" http://localhost:8281/services/new1/ </code></pre> <p>.</p> <pre><code>curl -H "Content-Type: application/json" -H "Accept: application/json" -d "{ 'Customer' : { 'name' : 'KasunG' } } " http://localhost:8281/services/new1/ </code></pre> <p>.</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;proxy xmlns="http://ws.apache.org/ns/synapse" name="new1" transports="https http" startOnLoad="true" trace="disable"&gt; &lt;description/&gt; &lt;target&gt; &lt;inSequence&gt; &lt;property name="REST_URL_POSTFIX" value="customers" scope="axis2" type="STRING"/&gt; &lt;property name="ContentType" value="text/xml" scope="axis2" type="STRING"/&gt; &lt;switch source="$axis2:HTTP_METHOD"&gt; &lt;case regex="GET"&gt; &lt;property name="HTTP_METHOD" value="GET" scope="axis2" type="STRING"/&gt; &lt;/case&gt; &lt;case regex="POST"&gt; &lt;property name="messageType" value="application/json" scope="axis2"/&gt; &lt;property name="ContentType" value="application/JSON" scope="axis2" type="STRING"/&gt; &lt;property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/&gt; &lt;/case&gt; &lt;default/&gt; &lt;/switch&gt; &lt;send&gt; &lt;endpoint&gt; &lt;address uri="http://localhost:8888/jaxrs_basic/services/customers/customerservice" format="rest"/&gt; &lt;/endpoint&gt; &lt;/send&gt; &lt;/inSequence&gt; &lt;outSequence&gt; &lt;property name="messageType" value="application/json" scope="axis2"/&gt; &lt;send/&gt; &lt;/outSequence&gt; &lt;/target&gt; &lt;/proxy&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload