You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Oleg Aleshko <ol...@gmail.com> on 2011/10/06 01:59:30 UTC

axis2 Transport Error: 201 Created

Hi.

I'm using wso2 3.0.1 server and axis2 on client to access proxy service.
In the proxy service i access a REST service like this:

<!-- inSequence -->
<sequence name="Service_In" xmlns="http://ws.apache.org/ns/synapse"  
statistics="enable">
<!-- some transformations omitted -->
     <send>
         <endpoint name="Service">
             <address uri="${service.url}" format="pox" statistics="enable">
                 <suspendOnFailure>
                     <initialDuration>0</initialDuration>
                     <maximumDuration>0</maximumDuration>
                     <progressionFactor>0.0</progressionFactor>
                 </suspendOnFailure>
             </address>
         </endpoint>
     </send>
     <log level="full"/>
</sequence>

<!-- outSequence -->
<sequence name="Service_Out" xmlns="http://ws.apache.org/ns/synapse"  
statistics="enable">
<!-- some transformations omitted -->
     <log level="full"/>
     <send/>
</sequence>

The problem is that REST service returns 201 code for successful calls and  
axis2 client fails with "org.apache.axis2.AxisFault: Transport error: 201  
Error: Created" message.

Is there a way to fix this?

Thanks, Oleg.

Re: axis2 Transport Error: 201 Created

Posted by Oleg Aleshko <ol...@gmail.com>.
Thank you Hiranya.

On Thu, 06 Oct 2011 12:40:47 +0300, Hiranya Jayathilaka  
<hi...@gmail.com> wrote:

> Hi Oleg,
>
> On Thu, Oct 6, 2011 at 2:15 PM, Oleg Aleshko <ol...@gmail.com> wrote:
>
>> Thanks, this works.
>>
>
> Glad to hear you got it working :)
>
>
>> Sorry for being such a newb.
>>
>> BTW, where can i find the list of available properties?
>>
>
> We don't have a complete listing of all available properties. WSO2 ESB
> documentation contains a catalog of Synapse properties [1] which is  
> fairly
> complete. Hope that will be useful.
>
> Thanks,
> Hiranya
>
> [1] - http://wso2.org/project/esb/java/4.0.0/docs/properties_guide.html
>
>
>>
>> Thanks, Oleg.
>>
>>
>> On Thu, 06 Oct 2011 09:08:12 +0300, Hiranya Jayathilaka <
>> hiranya911@gmail.com> wrote:
>>
>>  First of all this the wrong mailing list to ask WSO2 related questions.
>>> Please use WSO2 mailing lists or forums for such questions.
>>>
>>> Secondly, if the problem is that the REST service returning a 201  
>>> response
>>> (which is a valid success response), you can transform that into a  
>>> valid
>>> SOAP response in the out-sequence of ESB, set the status code to 200  
>>> and
>>> send back to the client. You can use the script mediator to inject a
>>> success
>>> response into the response. Use the property mediator to set the status
>>> code:
>>>
>>> <property name="HTTP_SC" value="200" scope="axis2"/>
>>>
>>> Thanks,
>>> Hiranya
>>>
>>> On Thu, Oct 6, 2011 at 5:29 AM, Oleg Aleshko <ol...@gmail.com>  
>>> wrote:
>>>
>>>  Hi.
>>>>
>>>> I'm using wso2 3.0.1 server and axis2 on client to access proxy  
>>>> service.
>>>> In the proxy service i access a REST service like this:
>>>>
>>>> <!-- inSequence -->
>>>> <sequence name="Service_In"  
>>>> xmlns="http://ws.apache.org/****ns/synapse<http://ws.apache.org/**ns/synapse>
>>>> <http://ws.apache.**org/ns/synapse <http://ws.apache.org/ns/synapse>>"
>>>>
>>>> statistics="enable">
>>>> <!-- some transformations omitted -->
>>>>   <send>
>>>>       <endpoint name="Service">
>>>>           <address uri="${service.url}" format="pox"  
>>>> statistics="enable">
>>>>               <suspendOnFailure>
>>>>                   <initialDuration>0</****initialDuration>
>>>>                   <maximumDuration>0</****maximumDuration>
>>>>                   <progressionFactor>0.0</****progressionFactor>
>>>>
>>>>               </suspendOnFailure>
>>>>           </address>
>>>>       </endpoint>
>>>>   </send>
>>>>   <log level="full"/>
>>>> </sequence>
>>>>
>>>> <!-- outSequence -->
>>>> <sequence name="Service_Out"  
>>>> xmlns="http://ws.apache.org/****ns/synapse<http://ws.apache.org/**ns/synapse>
>>>> <http://ws.apache.**org/ns/synapse <http://ws.apache.org/ns/synapse>>"
>>>>
>>>> statistics="enable">
>>>> <!-- some transformations omitted -->
>>>>   <log level="full"/>
>>>>   <send/>
>>>> </sequence>
>>>>
>>>> The problem is that REST service returns 201 code for successful calls
>>>> and
>>>> axis2 client fails with "org.apache.axis2.AxisFault: Transport error:  
>>>> 201
>>>> Error: Created" message.
>>>>
>>>> Is there a way to fix this?
>>>>
>>>> Thanks, Oleg.
>>>>
>>>>
>>>
>>>
>

Re: axis2 Transport Error: 201 Created

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
Hi Oleg,

On Thu, Oct 6, 2011 at 2:15 PM, Oleg Aleshko <ol...@gmail.com> wrote:

> Thanks, this works.
>

Glad to hear you got it working :)


> Sorry for being such a newb.
>
> BTW, where can i find the list of available properties?
>

We don't have a complete listing of all available properties. WSO2 ESB
documentation contains a catalog of Synapse properties [1] which is fairly
complete. Hope that will be useful.

Thanks,
Hiranya

[1] - http://wso2.org/project/esb/java/4.0.0/docs/properties_guide.html


>
> Thanks, Oleg.
>
>
> On Thu, 06 Oct 2011 09:08:12 +0300, Hiranya Jayathilaka <
> hiranya911@gmail.com> wrote:
>
>  First of all this the wrong mailing list to ask WSO2 related questions.
>> Please use WSO2 mailing lists or forums for such questions.
>>
>> Secondly, if the problem is that the REST service returning a 201 response
>> (which is a valid success response), you can transform that into a valid
>> SOAP response in the out-sequence of ESB, set the status code to 200 and
>> send back to the client. You can use the script mediator to inject a
>> success
>> response into the response. Use the property mediator to set the status
>> code:
>>
>> <property name="HTTP_SC" value="200" scope="axis2"/>
>>
>> Thanks,
>> Hiranya
>>
>> On Thu, Oct 6, 2011 at 5:29 AM, Oleg Aleshko <ol...@gmail.com> wrote:
>>
>>  Hi.
>>>
>>> I'm using wso2 3.0.1 server and axis2 on client to access proxy service.
>>> In the proxy service i access a REST service like this:
>>>
>>> <!-- inSequence -->
>>> <sequence name="Service_In" xmlns="http://ws.apache.org/****ns/synapse<http://ws.apache.org/**ns/synapse>
>>> <http://ws.apache.**org/ns/synapse <http://ws.apache.org/ns/synapse>>"
>>>
>>> statistics="enable">
>>> <!-- some transformations omitted -->
>>>   <send>
>>>       <endpoint name="Service">
>>>           <address uri="${service.url}" format="pox" statistics="enable">
>>>               <suspendOnFailure>
>>>                   <initialDuration>0</****initialDuration>
>>>                   <maximumDuration>0</****maximumDuration>
>>>                   <progressionFactor>0.0</****progressionFactor>
>>>
>>>               </suspendOnFailure>
>>>           </address>
>>>       </endpoint>
>>>   </send>
>>>   <log level="full"/>
>>> </sequence>
>>>
>>> <!-- outSequence -->
>>> <sequence name="Service_Out" xmlns="http://ws.apache.org/****ns/synapse<http://ws.apache.org/**ns/synapse>
>>> <http://ws.apache.**org/ns/synapse <http://ws.apache.org/ns/synapse>>"
>>>
>>> statistics="enable">
>>> <!-- some transformations omitted -->
>>>   <log level="full"/>
>>>   <send/>
>>> </sequence>
>>>
>>> The problem is that REST service returns 201 code for successful calls
>>> and
>>> axis2 client fails with "org.apache.axis2.AxisFault: Transport error: 201
>>> Error: Created" message.
>>>
>>> Is there a way to fix this?
>>>
>>> Thanks, Oleg.
>>>
>>>
>>
>>


-- 
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

Re: axis2 Transport Error: 201 Created

Posted by Oleg Aleshko <ol...@gmail.com>.
Thanks, this works.
Sorry for being such a newb.

BTW, where can i find the list of available properties?

Thanks, Oleg.

On Thu, 06 Oct 2011 09:08:12 +0300, Hiranya Jayathilaka  
<hi...@gmail.com> wrote:

> First of all this the wrong mailing list to ask WSO2 related questions.
> Please use WSO2 mailing lists or forums for such questions.
>
> Secondly, if the problem is that the REST service returning a 201  
> response
> (which is a valid success response), you can transform that into a valid
> SOAP response in the out-sequence of ESB, set the status code to 200 and
> send back to the client. You can use the script mediator to inject a  
> success
> response into the response. Use the property mediator to set the status
> code:
>
> <property name="HTTP_SC" value="200" scope="axis2"/>
>
> Thanks,
> Hiranya
>
> On Thu, Oct 6, 2011 at 5:29 AM, Oleg Aleshko <ol...@gmail.com> wrote:
>
>> Hi.
>>
>> I'm using wso2 3.0.1 server and axis2 on client to access proxy service.
>> In the proxy service i access a REST service like this:
>>
>> <!-- inSequence -->
>> <sequence name="Service_In"  
>> xmlns="http://ws.apache.org/**ns/synapse<http://ws.apache.org/ns/synapse>"
>> statistics="enable">
>> <!-- some transformations omitted -->
>>    <send>
>>        <endpoint name="Service">
>>            <address uri="${service.url}" format="pox"  
>> statistics="enable">
>>                <suspendOnFailure>
>>                    <initialDuration>0</**initialDuration>
>>                    <maximumDuration>0</**maximumDuration>
>>                    <progressionFactor>0.0</**progressionFactor>
>>                </suspendOnFailure>
>>            </address>
>>        </endpoint>
>>    </send>
>>    <log level="full"/>
>> </sequence>
>>
>> <!-- outSequence -->
>> <sequence name="Service_Out"  
>> xmlns="http://ws.apache.org/**ns/synapse<http://ws.apache.org/ns/synapse>"
>> statistics="enable">
>> <!-- some transformations omitted -->
>>    <log level="full"/>
>>    <send/>
>> </sequence>
>>
>> The problem is that REST service returns 201 code for successful calls  
>> and
>> axis2 client fails with "org.apache.axis2.AxisFault: Transport error:  
>> 201
>> Error: Created" message.
>>
>> Is there a way to fix this?
>>
>> Thanks, Oleg.
>>
>
>

Re: axis2 Transport Error: 201 Created

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
First of all this the wrong mailing list to ask WSO2 related questions.
Please use WSO2 mailing lists or forums for such questions.

Secondly, if the problem is that the REST service returning a 201 response
(which is a valid success response), you can transform that into a valid
SOAP response in the out-sequence of ESB, set the status code to 200 and
send back to the client. You can use the script mediator to inject a success
response into the response. Use the property mediator to set the status
code:

<property name="HTTP_SC" value="200" scope="axis2"/>

Thanks,
Hiranya

On Thu, Oct 6, 2011 at 5:29 AM, Oleg Aleshko <ol...@gmail.com> wrote:

> Hi.
>
> I'm using wso2 3.0.1 server and axis2 on client to access proxy service.
> In the proxy service i access a REST service like this:
>
> <!-- inSequence -->
> <sequence name="Service_In" xmlns="http://ws.apache.org/**ns/synapse<http://ws.apache.org/ns/synapse>"
> statistics="enable">
> <!-- some transformations omitted -->
>    <send>
>        <endpoint name="Service">
>            <address uri="${service.url}" format="pox" statistics="enable">
>                <suspendOnFailure>
>                    <initialDuration>0</**initialDuration>
>                    <maximumDuration>0</**maximumDuration>
>                    <progressionFactor>0.0</**progressionFactor>
>                </suspendOnFailure>
>            </address>
>        </endpoint>
>    </send>
>    <log level="full"/>
> </sequence>
>
> <!-- outSequence -->
> <sequence name="Service_Out" xmlns="http://ws.apache.org/**ns/synapse<http://ws.apache.org/ns/synapse>"
> statistics="enable">
> <!-- some transformations omitted -->
>    <log level="full"/>
>    <send/>
> </sequence>
>
> The problem is that REST service returns 201 code for successful calls and
> axis2 client fails with "org.apache.axis2.AxisFault: Transport error: 201
> Error: Created" message.
>
> Is there a way to fix this?
>
> Thanks, Oleg.
>



-- 
Hiranya Jayathilaka
Associate Technical Lead;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com