Setting HTTP headers in a SOAP message

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting HTTP headers in a SOAP message

alexeshadow (Bugzilla)
Hello fellow ESBers,

I'm not sure any of you are familiar with the Progress OpenEdge
WebServices Adapter. It's a proprietary Java EE web app to enable
execution of Progress OpenEdge procedures (4GL) using SOAP requests.

Whenever I try to proxy it's services within the ESB and invoke it, I
get the response Error in SOAP Envelope: Content length must be
specified. (10913).

If I invoke it directly through soapUI, it works AS LONG as I provide
the Content-Length header manually.

So what I need to do is setup an input sequence that adds the
Content-Length headers with the payload + soap headers size. I tried
using the Header mediator but it only adds the SOAP headers, not HTTP.

Is there any way to do this in Synapse/WSO2 ESB, maybe even using a
script mediator?

Thank you,

Alex



--
Alexandre M. Reis
Enterprise Architect
Datasize Tecnologia da Informação Ltda.
Brasil & Movimento S.A.
www.sundownnet.com.br
+55-41-3276-6232
+55-41-8801-9154
+55-11-2103-4800

_______________________________________________
Esb-java-user mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
Reply | Threaded
Open this post in threaded view
|

Re: Setting HTTP headers in a SOAP message

Paul Fremantle-2
Alex

Firstly, can you raise a JIRA about automatically adding Content-Length
headers to the message?

Secondly, you can add transport headers to the message.

  <property name="string" action='set' value="literal" |
expression="xpath") scope=transport|axis2|axis2-client]/>

However, I don't know how you are going to calculate it!

Asankha - is there already a way to turn on adding content-length in the
NIO HTTP client?

Paul

Alex Reis wrote:

> Hello fellow ESBers,
>
> I'm not sure any of you are familiar with the Progress OpenEdge
> WebServices Adapter. It's a proprietary Java EE web app to enable
> execution of Progress OpenEdge procedures (4GL) using SOAP requests.
>
> Whenever I try to proxy it's services within the ESB and invoke it, I
> get the response Error in SOAP Envelope: Content length must be
> specified. (10913).
>
> If I invoke it directly through soapUI, it works AS LONG as I provide
> the Content-Length header manually.
>
> So what I need to do is setup an input sequence that adds the
> Content-Length headers with the payload + soap headers size. I tried
> using the Header mediator but it only adds the SOAP headers, not HTTP.
>
> Is there any way to do this in Synapse/WSO2 ESB, maybe even using a
> script mediator?
>
> Thank you,
>
> Alex
>
>
>

--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

Office: +1 646 290 8050
Cell: +44 798 447 4618

blog: http://pzf.fremantle.org
[hidden email]

"Oxygenating the Web Service Platform", www.wso2.com

_______________________________________________
Esb-java-user mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
Reply | Threaded
Open this post in threaded view
|

Re: Setting HTTP headers in a SOAP message

alexeshadow (Bugzilla)
Created JIRA ESBJAVA-415.

Is it possible to get the whole message, envelope included with
something like MessageContext.getXMLPayload()? I could use a script
mediator to calculate it if something like that exists, but I'd think
that the SOAP envelopes are added only at the send mediator. I thought
of using the xpath function string-length over the serialized XML, but
I'm not quite sure how.




On Dec 21, 2007 9:29 AM, Paul Fremantle <[hidden email]> wrote:

> Alex
>
> Firstly, can you raise a JIRA about automatically adding Content-Length
> headers to the message?
>
> Secondly, you can add transport headers to the message.
>
>   <property name="string" action='set' value="literal" |
> expression="xpath") scope=transport|axis2|axis2-client]/>
>
> However, I don't know how you are going to calculate it!
>
> Asankha - is there already a way to turn on adding content-length in the
> NIO HTTP client?
>
> Paul
>
> Alex Reis wrote:
> > Hello fellow ESBers,
> >
> > I'm not sure any of you are familiar with the Progress OpenEdge
> > WebServices Adapter. It's a proprietary Java EE web app to enable
> > execution of Progress OpenEdge procedures (4GL) using SOAP requests.
> >
> > Whenever I try to proxy it's services within the ESB and invoke it, I
> > get the response Error in SOAP Envelope: Content length must be
> > specified. (10913).
> >
> > If I invoke it directly through soapUI, it works AS LONG as I provide
> > the Content-Length header manually.
> >
> > So what I need to do is setup an input sequence that adds the
> > Content-Length headers with the payload + soap headers size. I tried
> > using the Header mediator but it only adds the SOAP headers, not HTTP.
> >
> > Is there any way to do this in Synapse/WSO2 ESB, maybe even using a
> > script mediator?
> >
> > Thank you,
> >
> > Alex
> >
> >
> >
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> Office: +1 646 290 8050
> Cell: +44 798 447 4618
>
> blog: http://pzf.fremantle.org
> [hidden email]
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> _______________________________________________
> Esb-java-user mailing list
> [hidden email]
> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>



--
Alexandre M. Reis
Enterprise Architect
Datasize Tecnologia da Informação Ltda.
Brasil & Movimento S.A.
www.sundownnet.com.br
+55-41-3276-6232
+55-41-8801-9154
+55-11-2103-4800

_______________________________________________
Esb-java-user mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
Reply | Threaded
Open this post in threaded view
|

Re: Setting HTTP headers in a SOAP message

alexeshadow (Bugzilla)
Paul/All

(Reposting this under the right thread)

I've tried adding the property mediator as paul said, but the request
sent to the proxyed endpoint still doesn't have Content-Length. Tcp
monitor show the following request being sent:

--
POST http://localhost:12345/wsa/wsa1 HTTP/1.1
Host: 192.168.5.30:12345
SOAPAction: ""
Content-Type: text/xml; charset=UTF-8
Transfer-Encoding: chunked
Connection: Keep-Alive
User-Agent: Synapse-HttpComponents-NIO

14d
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:dtsl.ems2.cadastros.services.itemdocument:ItemDocument"><soapenv:Body>
     <urn:getItems>
        <urn:idGrupoEstoque>81</urn:idGrupoEstoque>
     </urn:getItems>
  </soapenv:Body></soapenv:Envelope>
0
--

synapse XML config follows:

<?xml version="1.0" encoding="UTF-8"?>

<syn:definitions xmlns:syn="http://ws.apache.org/ns/synapse">

   <syn:registry provider="org.wso2.esb.registry.ESBRegistry">

       <syn:parameter name="root">file:registry/</syn:parameter>

   </syn:registry>

   <syn:proxy name="ItemNovo" transports="http" startOnLoad="true"
statistics="enable" trace="enable">

       <syn:target>

           <syn:endpoint>

               <syn:address uri="http://localhost:12345/wsa/wsa1"/>

           </syn:endpoint>

           <syn:inSequence>

               <syn:property name="Content-Length" value="328"
scope="transport"/>

               <syn:log level="full" separator="--"/>

           </syn:inSequence>

           <syn:outSequence>

               <syn:send/>

           </syn:outSequence>

       </syn:target>

       <syn:publishWSDL
uri="http://192.168.5.30:8080/wsa/wsa1/wsdl?targetURI=urn:dtsl.ems2.cadastros.services.itemdocument"/>

   </syn:proxy>

   <syn:sequence statistics="enable" name="main" trace="enable">

       <syn:in>

           <syn:log level="full"/>

           <syn:filter source="get-property('To')"
regex="<a href="http://localhost:9000.*">http://localhost:9000.*">

               <syn:send/>

           </syn:filter>

       </syn:in>

       <syn:out>

           <syn:send/>

       </syn:out>

   </syn:sequence>

   <syn:sequence statistics="enable" name="fault" trace="enable">

       <syn:log/>

   </syn:sequence>

</syn:definitions>

On Dec 21, 2007 9:55 AM, Alex Reis <[hidden email]> wrote:

> Created JIRA ESBJAVA-415.
>
> Is it possible to get the whole message, envelope included with
> something like MessageContext.getXMLPayload()? I could use a script
> mediator to calculate it if something like that exists, but I'd think
> that the SOAP envelopes are added only at the send mediator. I thought
> of using the xpath function string-length over the serialized XML, but
> I'm not quite sure how.
>
>
>
>
>
> On Dec 21, 2007 9:29 AM, Paul Fremantle <[hidden email]> wrote:
> > Alex
> >
> > Firstly, can you raise a JIRA about automatically adding Content-Length
> > headers to the message?
> >
> > Secondly, you can add transport headers to the message.
> >
> >   <property name="string" action='set' value="literal" |
> > expression="xpath") scope=transport|axis2|axis2-client]/>
> >
> > However, I don't know how you are going to calculate it!
> >
> > Asankha - is there already a way to turn on adding content-length in the
> > NIO HTTP client?
> >
> > Paul
> >
> > Alex Reis wrote:
> > > Hello fellow ESBers,
> > >
> > > I'm not sure any of you are familiar with the Progress OpenEdge
> > > WebServices Adapter. It's a proprietary Java EE web app to enable
> > > execution of Progress OpenEdge procedures (4GL) using SOAP requests.
> > >
> > > Whenever I try to proxy it's services within the ESB and invoke it, I
> > > get the response Error in SOAP Envelope: Content length must be
> > > specified. (10913).
> > >
> > > If I invoke it directly through soapUI, it works AS LONG as I provide
> > > the Content-Length header manually.
> > >
> > > So what I need to do is setup an input sequence that adds the
> > > Content-Length headers with the payload + soap headers size. I tried
> > > using the Header mediator but it only adds the SOAP headers, not HTTP.
> > >
> > > Is there any way to do this in Synapse/WSO2 ESB, maybe even using a
> > > script mediator?
> > >
> > > Thank you,
> > >
> > > Alex
> > >
> > >
> > >
> >
> > --
> > Paul Fremantle
> > Co-Founder and VP of Technical Sales, WSO2
> > OASIS WS-RX TC Co-chair
> >
> > Office: +1 646 290 8050
> > Cell: +44 798 447 4618
> >
> > blog: http://pzf.fremantle.org
> > [hidden email]
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> > _______________________________________________
> > Esb-java-user mailing list
> > [hidden email]
> > http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
> >
>
>
>
>
> --
> Alexandre M. Reis
> Enterprise Architect
> Datasize Tecnologia da Informação Ltda.
> Brasil & Movimento S.A.
> www.sundownnet.com.br
> +55-41-3276-6232
> +55-41-8801-9154
> +55-11-2103-4800
>



--
Alexandre M. Reis
Enterprise Architect
Datasize Tecnologia da Informação Ltda.
Brasil & Movimento S.A.
www.sundownnet.com.br
+55-41-3276-6232
+55-41-8801-9154
+55-11-2103-4800

_______________________________________________
Esb-java-user mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
Reply | Threaded
Open this post in threaded view
|

Re: Setting HTTP headers in a SOAP message

Sanjiva Weerawarana-2
Hi Alex,

What the message shows is chunked encoding being used to transport the
message- which means instead of sending content length, you are sending
the message a small chunk at a time. The advantage is that the message can
then be streamed - if you require content length then it cannot.

In this situation, I'll bet our transport is ignoring your request to set
the content length because "it knows better".

However, it sounds like you're using a legacy HTTP environment which
doesn't do HTTP 1.1 correctly and doesn't handled chunked encoding
correctly. In which case, we'll need to write in some special flag which
tells the synapse http driver to ignore streaming, buffer the message,
count the size and set content length and then send it.

Another thing that may work is using the non-NIO transport. Someone else
will have to give the details on how turn that on.

Sanjiva.

Alex Reis wrote:

> Paul/All
>
> (Reposting this under the right thread)
>
> I've tried adding the property mediator as paul said, but the request
> sent to the proxyed endpoint still doesn't have Content-Length. Tcp
> monitor show the following request being sent:
>
> --
> POST http://localhost:12345/wsa/wsa1 HTTP/1.1
> Host: 192.168.5.30:12345
> SOAPAction: ""
> Content-Type: text/xml; charset=UTF-8
> Transfer-Encoding: chunked
> Connection: Keep-Alive
> User-Agent: Synapse-HttpComponents-NIO
>
> 14d
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:urn="urn:dtsl.ems2.cadastros.services.itemdocument:ItemDocument"><soapenv:Body>
>      <urn:getItems>
>         <urn:idGrupoEstoque>81</urn:idGrupoEstoque>
>      </urn:getItems>
>   </soapenv:Body></soapenv:Envelope>
> 0
> --
>
> synapse XML config follows:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <syn:definitions xmlns:syn="http://ws.apache.org/ns/synapse">
>
>    <syn:registry provider="org.wso2.esb.registry.ESBRegistry">
>
>        <syn:parameter name="root">file:registry/</syn:parameter>
>
>    </syn:registry>
>
>    <syn:proxy name="ItemNovo" transports="http" startOnLoad="true"
> statistics="enable" trace="enable">
>
>        <syn:target>
>
>            <syn:endpoint>
>
>                <syn:address uri="http://localhost:12345/wsa/wsa1"/>
>
>            </syn:endpoint>
>
>            <syn:inSequence>
>
>                <syn:property name="Content-Length" value="328"
> scope="transport"/>
>
>                <syn:log level="full" separator="--"/>
>
>            </syn:inSequence>
>
>            <syn:outSequence>
>
>                <syn:send/>
>
>            </syn:outSequence>
>
>        </syn:target>
>
>        <syn:publishWSDL
> uri="http://192.168.5.30:8080/wsa/wsa1/wsdl?targetURI=urn:dtsl.ems2.cadastros.services.itemdocument"/>
>
>    </syn:proxy>
>
>    <syn:sequence statistics="enable" name="main" trace="enable">
>
>        <syn:in>
>
>            <syn:log level="full"/>
>
>            <syn:filter source="get-property('To')"
> regex="<a href="http://localhost:9000.*">http://localhost:9000.*">
>
>                <syn:send/>
>
>            </syn:filter>
>
>        </syn:in>
>
>        <syn:out>
>
>            <syn:send/>
>
>        </syn:out>
>
>    </syn:sequence>
>
>    <syn:sequence statistics="enable" name="fault" trace="enable">
>
>        <syn:log/>
>
>    </syn:sequence>
>
> </syn:definitions>
>
> On Dec 21, 2007 9:55 AM, Alex Reis <[hidden email]> wrote:
>> Created JIRA ESBJAVA-415.
>>
>> Is it possible to get the whole message, envelope included with
>> something like MessageContext.getXMLPayload()? I could use a script
>> mediator to calculate it if something like that exists, but I'd think
>> that the SOAP envelopes are added only at the send mediator. I thought
>> of using the xpath function string-length over the serialized XML, but
>> I'm not quite sure how.
>>
>>
>>
>>
>>
>> On Dec 21, 2007 9:29 AM, Paul Fremantle <[hidden email]> wrote:
>>> Alex
>>>
>>> Firstly, can you raise a JIRA about automatically adding Content-Length
>>> headers to the message?
>>>
>>> Secondly, you can add transport headers to the message.
>>>
>>>   <property name="string" action='set' value="literal" |
>>> expression="xpath") scope=transport|axis2|axis2-client]/>
>>>
>>> However, I don't know how you are going to calculate it!
>>>
>>> Asankha - is there already a way to turn on adding content-length in the
>>> NIO HTTP client?
>>>
>>> Paul
>>>
>>> Alex Reis wrote:
>>>> Hello fellow ESBers,
>>>>
>>>> I'm not sure any of you are familiar with the Progress OpenEdge
>>>> WebServices Adapter. It's a proprietary Java EE web app to enable
>>>> execution of Progress OpenEdge procedures (4GL) using SOAP requests.
>>>>
>>>> Whenever I try to proxy it's services within the ESB and invoke it, I
>>>> get the response Error in SOAP Envelope: Content length must be
>>>> specified. (10913).
>>>>
>>>> If I invoke it directly through soapUI, it works AS LONG as I provide
>>>> the Content-Length header manually.
>>>>
>>>> So what I need to do is setup an input sequence that adds the
>>>> Content-Length headers with the payload + soap headers size. I tried
>>>> using the Header mediator but it only adds the SOAP headers, not HTTP.
>>>>
>>>> Is there any way to do this in Synapse/WSO2 ESB, maybe even using a
>>>> script mediator?
>>>>
>>>> Thank you,
>>>>
>>>> Alex
>>>>
>>>>
>>>>
>>> --
>>> Paul Fremantle
>>> Co-Founder and VP of Technical Sales, WSO2
>>> OASIS WS-RX TC Co-chair
>>>
>>> Office: +1 646 290 8050
>>> Cell: +44 798 447 4618
>>>
>>> blog: http://pzf.fremantle.org
>>> [hidden email]
>>>
>>> "Oxygenating the Web Service Platform", www.wso2.com
>>>
>>> _______________________________________________
>>> Esb-java-user mailing list
>>> [hidden email]
>>> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>>>
>>
>>
>>
>> --
>> Alexandre M. Reis
>> Enterprise Architect
>> Datasize Tecnologia da Informação Ltda.
>> Brasil & Movimento S.A.
>> www.sundownnet.com.br
>> +55-41-3276-6232
>> +55-41-8801-9154
>> +55-11-2103-4800
>>
>
>
>

--
Sanjiva Weerawarana, Ph.D.
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
email: [hidden email]; cell: +1 650 265 8311 | +94 77 787 6880

"Oxygenating the Web Service Platform."

_______________________________________________
Esb-java-user mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
Reply | Threaded
Open this post in threaded view
|

Re: Setting HTTP headers in a SOAP message

alexeshadow (Bugzilla)
Ty for the Reply Sanjiva. I'll love to get the Old IO based driver
working, as our main system (Datasul ERP) is all writtten in progress,
so the use of the ESB pretty much depends on it.

It seems sometimes legacy application/platform vendors supplying their
own web-service adapters is a worse shot than having to write things
from scratch.

Cheers,

Alex

On Dec 21, 2007 1:58 PM, Sanjiva Weerawarana <[hidden email]> wrote:

> Hi Alex,
>
> What the message shows is chunked encoding being used to transport the
> message- which means instead of sending content length, you are sending
> the message a small chunk at a time. The advantage is that the message can
> then be streamed - if you require content length then it cannot.
>
> In this situation, I'll bet our transport is ignoring your request to set
> the content length because "it knows better".
>
> However, it sounds like you're using a legacy HTTP environment which
> doesn't do HTTP 1.1 correctly and doesn't handled chunked encoding
> correctly. In which case, we'll need to write in some special flag which
> tells the synapse http driver to ignore streaming, buffer the message,
> count the size and set content length and then send it.
>
> Another thing that may work is using the non-NIO transport. Someone else
> will have to give the details on how turn that on.
>
> Sanjiva.
>
>
> Alex Reis wrote:
> > Paul/All
> >
> > (Reposting this under the right thread)
> >
> > I've tried adding the property mediator as paul said, but the request
> > sent to the proxyed endpoint still doesn't have Content-Length. Tcp
> > monitor show the following request being sent:
> >
> > --
> > POST http://localhost:12345/wsa/wsa1 HTTP/1.1
> > Host: 192.168.5.30:12345
> > SOAPAction: ""
> > Content-Type: text/xml; charset=UTF-8
> > Transfer-Encoding: chunked
> > Connection: Keep-Alive
> > User-Agent: Synapse-HttpComponents-NIO
> >
> > 14d
> > <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> > xmlns:urn="urn:dtsl.ems2.cadastros.services.itemdocument:ItemDocument"><soapenv:Body>
> >      <urn:getItems>
> >         <urn:idGrupoEstoque>81</urn:idGrupoEstoque>
> >      </urn:getItems>
> >   </soapenv:Body></soapenv:Envelope>
> > 0
> > --
> >
> > synapse XML config follows:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <syn:definitions xmlns:syn="http://ws.apache.org/ns/synapse">
> >
> >    <syn:registry provider="org.wso2.esb.registry.ESBRegistry">
> >
> >        <syn:parameter name="root">file:registry/</syn:parameter>
> >
> >    </syn:registry>
> >
> >    <syn:proxy name="ItemNovo" transports="http" startOnLoad="true"
> > statistics="enable" trace="enable">
> >
> >        <syn:target>
> >
> >            <syn:endpoint>
> >
> >                <syn:address uri="http://localhost:12345/wsa/wsa1"/>
> >
> >            </syn:endpoint>
> >
> >            <syn:inSequence>
> >
> >                <syn:property name="Content-Length" value="328"
> > scope="transport"/>
> >
> >                <syn:log level="full" separator="--"/>
> >
> >            </syn:inSequence>
> >
> >            <syn:outSequence>
> >
> >                <syn:send/>
> >
> >            </syn:outSequence>
> >
> >        </syn:target>
> >
> >        <syn:publishWSDL
> > uri="http://192.168.5.30:8080/wsa/wsa1/wsdl?targetURI=urn:dtsl.ems2.cadastros.services.itemdocument"/>
> >
> >    </syn:proxy>
> >
> >    <syn:sequence statistics="enable" name="main" trace="enable">
> >
> >        <syn:in>
> >
> >            <syn:log level="full"/>
> >
> >            <syn:filter source="get-property('To')"
> > regex="<a href="http://localhost:9000.*">http://localhost:9000.*">
> >
> >                <syn:send/>
> >
> >            </syn:filter>
> >
> >        </syn:in>
> >
> >        <syn:out>
> >
> >            <syn:send/>
> >
> >        </syn:out>
> >
> >    </syn:sequence>
> >
> >    <syn:sequence statistics="enable" name="fault" trace="enable">
> >
> >        <syn:log/>
> >
> >    </syn:sequence>
> >
> > </syn:definitions>
> >
> > On Dec 21, 2007 9:55 AM, Alex Reis <[hidden email]> wrote:
> >> Created JIRA ESBJAVA-415.
> >>
> >> Is it possible to get the whole message, envelope included with
> >> something like MessageContext.getXMLPayload()? I could use a script
> >> mediator to calculate it if something like that exists, but I'd think
> >> that the SOAP envelopes are added only at the send mediator. I thought
> >> of using the xpath function string-length over the serialized XML, but
> >> I'm not quite sure how.
> >>
> >>
> >>
> >>
> >>
> >> On Dec 21, 2007 9:29 AM, Paul Fremantle <[hidden email]> wrote:
> >>> Alex
> >>>
> >>> Firstly, can you raise a JIRA about automatically adding Content-Length
> >>> headers to the message?
> >>>
> >>> Secondly, you can add transport headers to the message.
> >>>
> >>>   <property name="string" action='set' value="literal" |
> >>> expression="xpath") scope=transport|axis2|axis2-client]/>
> >>>
> >>> However, I don't know how you are going to calculate it!
> >>>
> >>> Asankha - is there already a way to turn on adding content-length in the
> >>> NIO HTTP client?
> >>>
> >>> Paul
> >>>
> >>> Alex Reis wrote:
> >>>> Hello fellow ESBers,
> >>>>
> >>>> I'm not sure any of you are familiar with the Progress OpenEdge
> >>>> WebServices Adapter. It's a proprietary Java EE web app to enable
> >>>> execution of Progress OpenEdge procedures (4GL) using SOAP requests.
> >>>>
> >>>> Whenever I try to proxy it's services within the ESB and invoke it, I
> >>>> get the response Error in SOAP Envelope: Content length must be
> >>>> specified. (10913).
> >>>>
> >>>> If I invoke it directly through soapUI, it works AS LONG as I provide
> >>>> the Content-Length header manually.
> >>>>
> >>>> So what I need to do is setup an input sequence that adds the
> >>>> Content-Length headers with the payload + soap headers size. I tried
> >>>> using the Header mediator but it only adds the SOAP headers, not HTTP.
> >>>>
> >>>> Is there any way to do this in Synapse/WSO2 ESB, maybe even using a
> >>>> script mediator?
> >>>>
> >>>> Thank you,
> >>>>
> >>>> Alex
> >>>>
> >>>>
> >>>>
> >>> --
> >>> Paul Fremantle
> >>> Co-Founder and VP of Technical Sales, WSO2
> >>> OASIS WS-RX TC Co-chair
> >>>
> >>> Office: +1 646 290 8050
> >>> Cell: +44 798 447 4618
> >>>
> >>> blog: http://pzf.fremantle.org
> >>> [hidden email]
> >>>
> >>> "Oxygenating the Web Service Platform", www.wso2.com
> >>>
> >>> _______________________________________________
> >>> Esb-java-user mailing list
> >>> [hidden email]
> >>> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
> >>>
> >>
> >>
> >>
> >> --
> >> Alexandre M. Reis
> >> Enterprise Architect
> >> Datasize Tecnologia da Informação Ltda.
> >> Brasil & Movimento S.A.
> >> www.sundownnet.com.br
> >> +55-41-3276-6232
> >> +55-41-8801-9154
> >> +55-11-2103-4800
> >>
> >
> >
> >
>
> --
> Sanjiva Weerawarana, Ph.D.
> Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
> email: [hidden email]; cell: +1 650 265 8311 | +94 77 787 6880
>
> "Oxygenating the Web Service Platform."
>
>
> _______________________________________________
> Esb-java-user mailing list
> [hidden email]
> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>



--
Alexandre M. Reis
Enterprise Architect
Datasize Tecnologia da Informação Ltda.
Brasil & Movimento S.A.
www.sundownnet.com.br
+55-41-3276-6232
+55-41-8801-9154
+55-11-2103-4800

_______________________________________________
Esb-java-user mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
Reply | Threaded
Open this post in threaded view
|

Re: Setting HTTP headers in a SOAP message

Paul Fremantle-2
Alex

One more thing you can try:

<property name="FORCE_HTTP_1.0" value="true"/>

Paul

Alex Reis wrote:

> Ty for the Reply Sanjiva. I'll love to get the Old IO based driver
> working, as our main system (Datasul ERP) is all writtten in progress,
> so the use of the ESB pretty much depends on it.
>
> It seems sometimes legacy application/platform vendors supplying their
> own web-service adapters is a worse shot than having to write things
> from scratch.
>
> Cheers,
>
> Alex
>
> On Dec 21, 2007 1:58 PM, Sanjiva Weerawarana <[hidden email]> wrote:
>> Hi Alex,
>>
>> What the message shows is chunked encoding being used to transport the
>> message- which means instead of sending content length, you are sending
>> the message a small chunk at a time. The advantage is that the message can
>> then be streamed - if you require content length then it cannot.
>>
>> In this situation, I'll bet our transport is ignoring your request to set
>> the content length because "it knows better".
>>
>> However, it sounds like you're using a legacy HTTP environment which
>> doesn't do HTTP 1.1 correctly and doesn't handled chunked encoding
>> correctly. In which case, we'll need to write in some special flag which
>> tells the synapse http driver to ignore streaming, buffer the message,
>> count the size and set content length and then send it.
>>
>> Another thing that may work is using the non-NIO transport. Someone else
>> will have to give the details on how turn that on.
>>
>> Sanjiva.
>>
>>
>> Alex Reis wrote:
>>> Paul/All
>>>
>>> (Reposting this under the right thread)
>>>
>>> I've tried adding the property mediator as paul said, but the request
>>> sent to the proxyed endpoint still doesn't have Content-Length. Tcp
>>> monitor show the following request being sent:
>>>
>>> --
>>> POST http://localhost:12345/wsa/wsa1 HTTP/1.1
>>> Host: 192.168.5.30:12345
>>> SOAPAction: ""
>>> Content-Type: text/xml; charset=UTF-8
>>> Transfer-Encoding: chunked
>>> Connection: Keep-Alive
>>> User-Agent: Synapse-HttpComponents-NIO
>>>
>>> 14d
>>> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>> xmlns:urn="urn:dtsl.ems2.cadastros.services.itemdocument:ItemDocument"><soapenv:Body>
>>>      <urn:getItems>
>>>         <urn:idGrupoEstoque>81</urn:idGrupoEstoque>
>>>      </urn:getItems>
>>>   </soapenv:Body></soapenv:Envelope>
>>> 0
>>> --
>>>
>>> synapse XML config follows:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <syn:definitions xmlns:syn="http://ws.apache.org/ns/synapse">
>>>
>>>    <syn:registry provider="org.wso2.esb.registry.ESBRegistry">
>>>
>>>        <syn:parameter name="root">file:registry/</syn:parameter>
>>>
>>>    </syn:registry>
>>>
>>>    <syn:proxy name="ItemNovo" transports="http" startOnLoad="true"
>>> statistics="enable" trace="enable">
>>>
>>>        <syn:target>
>>>
>>>            <syn:endpoint>
>>>
>>>                <syn:address uri="http://localhost:12345/wsa/wsa1"/>
>>>
>>>            </syn:endpoint>
>>>
>>>            <syn:inSequence>
>>>
>>>                <syn:property name="Content-Length" value="328"
>>> scope="transport"/>
>>>
>>>                <syn:log level="full" separator="--"/>
>>>
>>>            </syn:inSequence>
>>>
>>>            <syn:outSequence>
>>>
>>>                <syn:send/>
>>>
>>>            </syn:outSequence>
>>>
>>>        </syn:target>
>>>
>>>        <syn:publishWSDL
>>> uri="http://192.168.5.30:8080/wsa/wsa1/wsdl?targetURI=urn:dtsl.ems2.cadastros.services.itemdocument"/>
>>>
>>>    </syn:proxy>
>>>
>>>    <syn:sequence statistics="enable" name="main" trace="enable">
>>>
>>>        <syn:in>
>>>
>>>            <syn:log level="full"/>
>>>
>>>            <syn:filter source="get-property('To')"
>>> regex="<a href="http://localhost:9000.*">http://localhost:9000.*">
>>>
>>>                <syn:send/>
>>>
>>>            </syn:filter>
>>>
>>>        </syn:in>
>>>
>>>        <syn:out>
>>>
>>>            <syn:send/>
>>>
>>>        </syn:out>
>>>
>>>    </syn:sequence>
>>>
>>>    <syn:sequence statistics="enable" name="fault" trace="enable">
>>>
>>>        <syn:log/>
>>>
>>>    </syn:sequence>
>>>
>>> </syn:definitions>
>>>
>>> On Dec 21, 2007 9:55 AM, Alex Reis <[hidden email]> wrote:
>>>> Created JIRA ESBJAVA-415.
>>>>
>>>> Is it possible to get the whole message, envelope included with
>>>> something like MessageContext.getXMLPayload()? I could use a script
>>>> mediator to calculate it if something like that exists, but I'd think
>>>> that the SOAP envelopes are added only at the send mediator. I thought
>>>> of using the xpath function string-length over the serialized XML, but
>>>> I'm not quite sure how.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Dec 21, 2007 9:29 AM, Paul Fremantle <[hidden email]> wrote:
>>>>> Alex
>>>>>
>>>>> Firstly, can you raise a JIRA about automatically adding Content-Length
>>>>> headers to the message?
>>>>>
>>>>> Secondly, you can add transport headers to the message.
>>>>>
>>>>>   <property name="string" action='set' value="literal" |
>>>>> expression="xpath") scope=transport|axis2|axis2-client]/>
>>>>>
>>>>> However, I don't know how you are going to calculate it!
>>>>>
>>>>> Asankha - is there already a way to turn on adding content-length in the
>>>>> NIO HTTP client?
>>>>>
>>>>> Paul
>>>>>
>>>>> Alex Reis wrote:
>>>>>> Hello fellow ESBers,
>>>>>>
>>>>>> I'm not sure any of you are familiar with the Progress OpenEdge
>>>>>> WebServices Adapter. It's a proprietary Java EE web app to enable
>>>>>> execution of Progress OpenEdge procedures (4GL) using SOAP requests.
>>>>>>
>>>>>> Whenever I try to proxy it's services within the ESB and invoke it, I
>>>>>> get the response Error in SOAP Envelope: Content length must be
>>>>>> specified. (10913).
>>>>>>
>>>>>> If I invoke it directly through soapUI, it works AS LONG as I provide
>>>>>> the Content-Length header manually.
>>>>>>
>>>>>> So what I need to do is setup an input sequence that adds the
>>>>>> Content-Length headers with the payload + soap headers size. I tried
>>>>>> using the Header mediator but it only adds the SOAP headers, not HTTP.
>>>>>>
>>>>>> Is there any way to do this in Synapse/WSO2 ESB, maybe even using a
>>>>>> script mediator?
>>>>>>
>>>>>> Thank you,
>>>>>>
>>>>>> Alex
>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>>> Paul Fremantle
>>>>> Co-Founder and VP of Technical Sales, WSO2
>>>>> OASIS WS-RX TC Co-chair
>>>>>
>>>>> Office: +1 646 290 8050
>>>>> Cell: +44 798 447 4618
>>>>>
>>>>> blog: http://pzf.fremantle.org
>>>>> [hidden email]
>>>>>
>>>>> "Oxygenating the Web Service Platform", www.wso2.com
>>>>>
>>>>> _______________________________________________
>>>>> Esb-java-user mailing list
>>>>> [hidden email]
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>>>>>
>>>>
>>>>
>>>> --
>>>> Alexandre M. Reis
>>>> Enterprise Architect
>>>> Datasize Tecnologia da Informação Ltda.
>>>> Brasil & Movimento S.A.
>>>> www.sundownnet.com.br
>>>> +55-41-3276-6232
>>>> +55-41-8801-9154
>>>> +55-11-2103-4800
>>>>
>>>
>>>
>> --
>> Sanjiva Weerawarana, Ph.D.
>> Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
>> email: [hidden email]; cell: +1 650 265 8311 | +94 77 787 6880
>>
>> "Oxygenating the Web Service Platform."
>>
>>
>> _______________________________________________
>> Esb-java-user mailing list
>> [hidden email]
>> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>>
>
>
>

--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

Office: +1 646 290 8050
Cell: +44 798 447 4618

blog: http://pzf.fremantle.org
[hidden email]

"Oxygenating the Web Service Platform", www.wso2.com

_______________________________________________
Esb-java-user mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
Reply | Threaded
Open this post in threaded view
|

Re: Setting HTTP headers in a SOAP message

alexeshadow (Bugzilla)
Unfortunatelly didn't work either Paul, but ty :)

Alex

On Dec 21, 2007 3:12 PM, Paul Fremantle <[hidden email]> wrote:

> Alex
>
> One more thing you can try:
>
> <property name="FORCE_HTTP_1.0" value="true"/>
>
> Paul
>
>
> Alex Reis wrote:
> > Ty for the Reply Sanjiva. I'll love to get the Old IO based driver
> > working, as our main system (Datasul ERP) is all writtten in progress,
> > so the use of the ESB pretty much depends on it.
> >
> > It seems sometimes legacy application/platform vendors supplying their
> > own web-service adapters is a worse shot than having to write things
> > from scratch.
> >
> > Cheers,
> >
> > Alex
> >
> > On Dec 21, 2007 1:58 PM, Sanjiva Weerawarana <[hidden email]> wrote:
> >> Hi Alex,
> >>
> >> What the message shows is chunked encoding being used to transport the
> >> message- which means instead of sending content length, you are sending
> >> the message a small chunk at a time. The advantage is that the message can
> >> then be streamed - if you require content length then it cannot.
> >>
> >> In this situation, I'll bet our transport is ignoring your request to set
> >> the content length because "it knows better".
> >>
> >> However, it sounds like you're using a legacy HTTP environment which
> >> doesn't do HTTP 1.1 correctly and doesn't handled chunked encoding
> >> correctly. In which case, we'll need to write in some special flag which
> >> tells the synapse http driver to ignore streaming, buffer the message,
> >> count the size and set content length and then send it.
> >>
> >> Another thing that may work is using the non-NIO transport. Someone else
> >> will have to give the details on how turn that on.
> >>
> >> Sanjiva.
> >>
> >>
> >> Alex Reis wrote:
> >>> Paul/All
> >>>
> >>> (Reposting this under the right thread)
> >>>
> >>> I've tried adding the property mediator as paul said, but the request
> >>> sent to the proxyed endpoint still doesn't have Content-Length. Tcp
> >>> monitor show the following request being sent:
> >>>
> >>> --
> >>> POST http://localhost:12345/wsa/wsa1 HTTP/1.1
> >>> Host: 192.168.5.30:12345
> >>> SOAPAction: ""
> >>> Content-Type: text/xml; charset=UTF-8
> >>> Transfer-Encoding: chunked
> >>> Connection: Keep-Alive
> >>> User-Agent: Synapse-HttpComponents-NIO
> >>>
> >>> 14d
> >>> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> >>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> >>> xmlns:urn="urn:dtsl.ems2.cadastros.services.itemdocument:ItemDocument"><soapenv:Body>
> >>>      <urn:getItems>
> >>>         <urn:idGrupoEstoque>81</urn:idGrupoEstoque>
> >>>      </urn:getItems>
> >>>   </soapenv:Body></soapenv:Envelope>
> >>> 0
> >>> --
> >>>
> >>> synapse XML config follows:
> >>>
> >>> <?xml version="1.0" encoding="UTF-8"?>
> >>>
> >>> <syn:definitions xmlns:syn="http://ws.apache.org/ns/synapse">
> >>>
> >>>    <syn:registry provider="org.wso2.esb.registry.ESBRegistry">
> >>>
> >>>        <syn:parameter name="root">file:registry/</syn:parameter>
> >>>
> >>>    </syn:registry>
> >>>
> >>>    <syn:proxy name="ItemNovo" transports="http" startOnLoad="true"
> >>> statistics="enable" trace="enable">
> >>>
> >>>        <syn:target>
> >>>
> >>>            <syn:endpoint>
> >>>
> >>>                <syn:address uri="http://localhost:12345/wsa/wsa1"/>
> >>>
> >>>            </syn:endpoint>
> >>>
> >>>            <syn:inSequence>
> >>>
> >>>                <syn:property name="Content-Length" value="328"
> >>> scope="transport"/>
> >>>
> >>>                <syn:log level="full" separator="--"/>
> >>>
> >>>            </syn:inSequence>
> >>>
> >>>            <syn:outSequence>
> >>>
> >>>                <syn:send/>
> >>>
> >>>            </syn:outSequence>
> >>>
> >>>        </syn:target>
> >>>
> >>>        <syn:publishWSDL
> >>> uri="http://192.168.5.30:8080/wsa/wsa1/wsdl?targetURI=urn:dtsl.ems2.cadastros.services.itemdocument"/>
> >>>
> >>>    </syn:proxy>
> >>>
> >>>    <syn:sequence statistics="enable" name="main" trace="enable">
> >>>
> >>>        <syn:in>
> >>>
> >>>            <syn:log level="full"/>
> >>>
> >>>            <syn:filter source="get-property('To')"
> >>> regex="<a href="http://localhost:9000.*">http://localhost:9000.*">
> >>>
> >>>                <syn:send/>
> >>>
> >>>            </syn:filter>
> >>>
> >>>        </syn:in>
> >>>
> >>>        <syn:out>
> >>>
> >>>            <syn:send/>
> >>>
> >>>        </syn:out>
> >>>
> >>>    </syn:sequence>
> >>>
> >>>    <syn:sequence statistics="enable" name="fault" trace="enable">
> >>>
> >>>        <syn:log/>
> >>>
> >>>    </syn:sequence>
> >>>
> >>> </syn:definitions>
> >>>
> >>> On Dec 21, 2007 9:55 AM, Alex Reis <[hidden email]> wrote:
> >>>> Created JIRA ESBJAVA-415.
> >>>>
> >>>> Is it possible to get the whole message, envelope included with
> >>>> something like MessageContext.getXMLPayload()? I could use a script
> >>>> mediator to calculate it if something like that exists, but I'd think
> >>>> that the SOAP envelopes are added only at the send mediator. I thought
> >>>> of using the xpath function string-length over the serialized XML, but
> >>>> I'm not quite sure how.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> On Dec 21, 2007 9:29 AM, Paul Fremantle <[hidden email]> wrote:
> >>>>> Alex
> >>>>>
> >>>>> Firstly, can you raise a JIRA about automatically adding Content-Length
> >>>>> headers to the message?
> >>>>>
> >>>>> Secondly, you can add transport headers to the message.
> >>>>>
> >>>>>   <property name="string" action='set' value="literal" |
> >>>>> expression="xpath") scope=transport|axis2|axis2-client]/>
> >>>>>
> >>>>> However, I don't know how you are going to calculate it!
> >>>>>
> >>>>> Asankha - is there already a way to turn on adding content-length in the
> >>>>> NIO HTTP client?
> >>>>>
> >>>>> Paul
> >>>>>
> >>>>> Alex Reis wrote:
> >>>>>> Hello fellow ESBers,
> >>>>>>
> >>>>>> I'm not sure any of you are familiar with the Progress OpenEdge
> >>>>>> WebServices Adapter. It's a proprietary Java EE web app to enable
> >>>>>> execution of Progress OpenEdge procedures (4GL) using SOAP requests.
> >>>>>>
> >>>>>> Whenever I try to proxy it's services within the ESB and invoke it, I
> >>>>>> get the response Error in SOAP Envelope: Content length must be
> >>>>>> specified. (10913).
> >>>>>>
> >>>>>> If I invoke it directly through soapUI, it works AS LONG as I provide
> >>>>>> the Content-Length header manually.
> >>>>>>
> >>>>>> So what I need to do is setup an input sequence that adds the
> >>>>>> Content-Length headers with the payload + soap headers size. I tried
> >>>>>> using the Header mediator but it only adds the SOAP headers, not HTTP.
> >>>>>>
> >>>>>> Is there any way to do this in Synapse/WSO2 ESB, maybe even using a
> >>>>>> script mediator?
> >>>>>>
> >>>>>> Thank you,
> >>>>>>
> >>>>>> Alex
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>> --
> >>>>> Paul Fremantle
> >>>>> Co-Founder and VP of Technical Sales, WSO2
> >>>>> OASIS WS-RX TC Co-chair
> >>>>>
> >>>>> Office: +1 646 290 8050
> >>>>> Cell: +44 798 447 4618
> >>>>>
> >>>>> blog: http://pzf.fremantle.org
> >>>>> [hidden email]
> >>>>>
> >>>>> "Oxygenating the Web Service Platform", www.wso2.com
> >>>>>
> >>>>> _______________________________________________
> >>>>> Esb-java-user mailing list
> >>>>> [hidden email]
> >>>>> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
> >>>>>
> >>>>
> >>>>
> >>>> --
> >>>> Alexandre M. Reis
> >>>> Enterprise Architect
> >>>> Datasize Tecnologia da Informação Ltda.
> >>>> Brasil & Movimento S.A.
> >>>> www.sundownnet.com.br
> >>>> +55-41-3276-6232
> >>>> +55-41-8801-9154
> >>>> +55-11-2103-4800
> >>>>
> >>>
> >>>
> >> --
> >> Sanjiva Weerawarana, Ph.D.
> >> Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
> >> email: [hidden email]; cell: +1 650 265 8311 | +94 77 787 6880
> >>
> >> "Oxygenating the Web Service Platform."
> >>
> >>
> >> _______________________________________________
> >> Esb-java-user mailing list
> >> [hidden email]
> >> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
> >>
> >
> >
> >
>
> --
> Paul Fremantle
> Co-Founder and VP of Technical Sales, WSO2
> OASIS WS-RX TC Co-chair
>
> Office: +1 646 290 8050
> Cell: +44 798 447 4618
>
> blog: http://pzf.fremantle.org
> [hidden email]
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> _______________________________________________
> Esb-java-user mailing list
> [hidden email]
> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>



--
Alexandre M. Reis
Enterprise Architect
Datasize Tecnologia da Informação Ltda.
Brasil & Movimento S.A.
www.sundownnet.com.br
+55-41-3276-6232
+55-41-8801-9154
+55-11-2103-4800

_______________________________________________
Esb-java-user mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
Reply | Threaded
Open this post in threaded view
|

Re: Setting HTTP headers in a SOAP message

Paul Fremantle-2
Alex

Can you do a trace on the HTTP with the new setting... I may not have
given you exactly the right config line.

Paul

Alex Reis wrote:

> Unfortunatelly didn't work either Paul, but ty :)
>
> Alex
>
> On Dec 21, 2007 3:12 PM, Paul Fremantle <[hidden email]> wrote:
>> Alex
>>
>> One more thing you can try:
>>
>> <property name="FORCE_HTTP_1.0" value="true"/>
>>
>> Paul
>>
>>
>> Alex Reis wrote:
>>> Ty for the Reply Sanjiva. I'll love to get the Old IO based driver
>>> working, as our main system (Datasul ERP) is all writtten in progress,
>>> so the use of the ESB pretty much depends on it.
>>>
>>> It seems sometimes legacy application/platform vendors supplying their
>>> own web-service adapters is a worse shot than having to write things
>>> from scratch.
>>>
>>> Cheers,
>>>
>>> Alex
>>>
>>> On Dec 21, 2007 1:58 PM, Sanjiva Weerawarana <[hidden email]> wrote:
>>>> Hi Alex,
>>>>
>>>> What the message shows is chunked encoding being used to transport the
>>>> message- which means instead of sending content length, you are sending
>>>> the message a small chunk at a time. The advantage is that the message can
>>>> then be streamed - if you require content length then it cannot.
>>>>
>>>> In this situation, I'll bet our transport is ignoring your request to set
>>>> the content length because "it knows better".
>>>>
>>>> However, it sounds like you're using a legacy HTTP environment which
>>>> doesn't do HTTP 1.1 correctly and doesn't handled chunked encoding
>>>> correctly. In which case, we'll need to write in some special flag which
>>>> tells the synapse http driver to ignore streaming, buffer the message,
>>>> count the size and set content length and then send it.
>>>>
>>>> Another thing that may work is using the non-NIO transport. Someone else
>>>> will have to give the details on how turn that on.
>>>>
>>>> Sanjiva.
>>>>
>>>>
>>>> Alex Reis wrote:
>>>>> Paul/All
>>>>>
>>>>> (Reposting this under the right thread)
>>>>>
>>>>> I've tried adding the property mediator as paul said, but the request
>>>>> sent to the proxyed endpoint still doesn't have Content-Length. Tcp
>>>>> monitor show the following request being sent:
>>>>>
>>>>> --
>>>>> POST http://localhost:12345/wsa/wsa1 HTTP/1.1
>>>>> Host: 192.168.5.30:12345
>>>>> SOAPAction: ""
>>>>> Content-Type: text/xml; charset=UTF-8
>>>>> Transfer-Encoding: chunked
>>>>> Connection: Keep-Alive
>>>>> User-Agent: Synapse-HttpComponents-NIO
>>>>>
>>>>> 14d
>>>>> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
>>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>>>> xmlns:urn="urn:dtsl.ems2.cadastros.services.itemdocument:ItemDocument"><soapenv:Body>
>>>>>      <urn:getItems>
>>>>>         <urn:idGrupoEstoque>81</urn:idGrupoEstoque>
>>>>>      </urn:getItems>
>>>>>   </soapenv:Body></soapenv:Envelope>
>>>>> 0
>>>>> --
>>>>>
>>>>> synapse XML config follows:
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>
>>>>> <syn:definitions xmlns:syn="http://ws.apache.org/ns/synapse">
>>>>>
>>>>>    <syn:registry provider="org.wso2.esb.registry.ESBRegistry">
>>>>>
>>>>>        <syn:parameter name="root">file:registry/</syn:parameter>
>>>>>
>>>>>    </syn:registry>
>>>>>
>>>>>    <syn:proxy name="ItemNovo" transports="http" startOnLoad="true"
>>>>> statistics="enable" trace="enable">
>>>>>
>>>>>        <syn:target>
>>>>>
>>>>>            <syn:endpoint>
>>>>>
>>>>>                <syn:address uri="http://localhost:12345/wsa/wsa1"/>
>>>>>
>>>>>            </syn:endpoint>
>>>>>
>>>>>            <syn:inSequence>
>>>>>
>>>>>                <syn:property name="Content-Length" value="328"
>>>>> scope="transport"/>
>>>>>
>>>>>                <syn:log level="full" separator="--"/>
>>>>>
>>>>>            </syn:inSequence>
>>>>>
>>>>>            <syn:outSequence>
>>>>>
>>>>>                <syn:send/>
>>>>>
>>>>>            </syn:outSequence>
>>>>>
>>>>>        </syn:target>
>>>>>
>>>>>        <syn:publishWSDL
>>>>> uri="http://192.168.5.30:8080/wsa/wsa1/wsdl?targetURI=urn:dtsl.ems2.cadastros.services.itemdocument"/>
>>>>>
>>>>>    </syn:proxy>
>>>>>
>>>>>    <syn:sequence statistics="enable" name="main" trace="enable">
>>>>>
>>>>>        <syn:in>
>>>>>
>>>>>            <syn:log level="full"/>
>>>>>
>>>>>            <syn:filter source="get-property('To')"
>>>>> regex="<a href="http://localhost:9000.*">http://localhost:9000.*">
>>>>>
>>>>>                <syn:send/>
>>>>>
>>>>>            </syn:filter>
>>>>>
>>>>>        </syn:in>
>>>>>
>>>>>        <syn:out>
>>>>>
>>>>>            <syn:send/>
>>>>>
>>>>>        </syn:out>
>>>>>
>>>>>    </syn:sequence>
>>>>>
>>>>>    <syn:sequence statistics="enable" name="fault" trace="enable">
>>>>>
>>>>>        <syn:log/>
>>>>>
>>>>>    </syn:sequence>
>>>>>
>>>>> </syn:definitions>
>>>>>
>>>>> On Dec 21, 2007 9:55 AM, Alex Reis <[hidden email]> wrote:
>>>>>> Created JIRA ESBJAVA-415.
>>>>>>
>>>>>> Is it possible to get the whole message, envelope included with
>>>>>> something like MessageContext.getXMLPayload()? I could use a script
>>>>>> mediator to calculate it if something like that exists, but I'd think
>>>>>> that the SOAP envelopes are added only at the send mediator. I thought
>>>>>> of using the xpath function string-length over the serialized XML, but
>>>>>> I'm not quite sure how.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Dec 21, 2007 9:29 AM, Paul Fremantle <[hidden email]> wrote:
>>>>>>> Alex
>>>>>>>
>>>>>>> Firstly, can you raise a JIRA about automatically adding Content-Length
>>>>>>> headers to the message?
>>>>>>>
>>>>>>> Secondly, you can add transport headers to the message.
>>>>>>>
>>>>>>>   <property name="string" action='set' value="literal" |
>>>>>>> expression="xpath") scope=transport|axis2|axis2-client]/>
>>>>>>>
>>>>>>> However, I don't know how you are going to calculate it!
>>>>>>>
>>>>>>> Asankha - is there already a way to turn on adding content-length in the
>>>>>>> NIO HTTP client?
>>>>>>>
>>>>>>> Paul
>>>>>>>
>>>>>>> Alex Reis wrote:
>>>>>>>> Hello fellow ESBers,
>>>>>>>>
>>>>>>>> I'm not sure any of you are familiar with the Progress OpenEdge
>>>>>>>> WebServices Adapter. It's a proprietary Java EE web app to enable
>>>>>>>> execution of Progress OpenEdge procedures (4GL) using SOAP requests.
>>>>>>>>
>>>>>>>> Whenever I try to proxy it's services within the ESB and invoke it, I
>>>>>>>> get the response Error in SOAP Envelope: Content length must be
>>>>>>>> specified. (10913).
>>>>>>>>
>>>>>>>> If I invoke it directly through soapUI, it works AS LONG as I provide
>>>>>>>> the Content-Length header manually.
>>>>>>>>
>>>>>>>> So what I need to do is setup an input sequence that adds the
>>>>>>>> Content-Length headers with the payload + soap headers size. I tried
>>>>>>>> using the Header mediator but it only adds the SOAP headers, not HTTP.
>>>>>>>>
>>>>>>>> Is there any way to do this in Synapse/WSO2 ESB, maybe even using a
>>>>>>>> script mediator?
>>>>>>>>
>>>>>>>> Thank you,
>>>>>>>>
>>>>>>>> Alex
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> --
>>>>>>> Paul Fremantle
>>>>>>> Co-Founder and VP of Technical Sales, WSO2
>>>>>>> OASIS WS-RX TC Co-chair
>>>>>>>
>>>>>>> Office: +1 646 290 8050
>>>>>>> Cell: +44 798 447 4618
>>>>>>>
>>>>>>> blog: http://pzf.fremantle.org
>>>>>>> [hidden email]
>>>>>>>
>>>>>>> "Oxygenating the Web Service Platform", www.wso2.com
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Esb-java-user mailing list
>>>>>>> [hidden email]
>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Alexandre M. Reis
>>>>>> Enterprise Architect
>>>>>> Datasize Tecnologia da Informação Ltda.
>>>>>> Brasil & Movimento S.A.
>>>>>> www.sundownnet.com.br
>>>>>> +55-41-3276-6232
>>>>>> +55-41-8801-9154
>>>>>> +55-11-2103-4800
>>>>>>
>>>>>
>>>> --
>>>> Sanjiva Weerawarana, Ph.D.
>>>> Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
>>>> email: [hidden email]; cell: +1 650 265 8311 | +94 77 787 6880
>>>>
>>>> "Oxygenating the Web Service Platform."
>>>>
>>>>
>>>> _______________________________________________
>>>> Esb-java-user mailing list
>>>> [hidden email]
>>>> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>>>>
>>>
>>>
>> --
>> Paul Fremantle
>> Co-Founder and VP of Technical Sales, WSO2
>> OASIS WS-RX TC Co-chair
>>
>> Office: +1 646 290 8050
>> Cell: +44 798 447 4618
>>
>> blog: http://pzf.fremantle.org
>> [hidden email]
>>
>> "Oxygenating the Web Service Platform", www.wso2.com
>>
>> _______________________________________________
>> Esb-java-user mailing list
>> [hidden email]
>> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>>
>
>
>

--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

Office: +1 646 290 8050
Cell: +44 798 447 4618

blog: http://pzf.fremantle.org
[hidden email]

"Oxygenating the Web Service Platform", www.wso2.com

_______________________________________________
Esb-java-user mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
Reply | Threaded
Open this post in threaded view
|

Re: Setting HTTP headers in a SOAP message

Paul Fremantle-2
In reply to this post by alexeshadow (Bugzilla)
So firstly it should have read:
<property action="set" name="FORCE_HTTP_1.0" value="true"/>

Secondly, this is a mediator (in the main sequence flow) and not a
property on the proxy.

Paul

Alex Reis wrote:

> Unfortunatelly didn't work either Paul, but ty :)
>
> Alex
>
> On Dec 21, 2007 3:12 PM, Paul Fremantle <[hidden email]> wrote:
>> Alex
>>
>> One more thing you can try:
>>
>> <property name="FORCE_HTTP_1.0" value="true"/>
>>
>> Paul
>>
>>
>> Alex Reis wrote:
>>> Ty for the Reply Sanjiva. I'll love to get the Old IO based driver
>>> working, as our main system (Datasul ERP) is all writtten in progress,
>>> so the use of the ESB pretty much depends on it.
>>>
>>> It seems sometimes legacy application/platform vendors supplying their
>>> own web-service adapters is a worse shot than having to write things
>>> from scratch.
>>>
>>> Cheers,
>>>
>>> Alex
>>>
>>> On Dec 21, 2007 1:58 PM, Sanjiva Weerawarana <[hidden email]> wrote:
>>>> Hi Alex,
>>>>
>>>> What the message shows is chunked encoding being used to transport the
>>>> message- which means instead of sending content length, you are sending
>>>> the message a small chunk at a time. The advantage is that the message can
>>>> then be streamed - if you require content length then it cannot.
>>>>
>>>> In this situation, I'll bet our transport is ignoring your request to set
>>>> the content length because "it knows better".
>>>>
>>>> However, it sounds like you're using a legacy HTTP environment which
>>>> doesn't do HTTP 1.1 correctly and doesn't handled chunked encoding
>>>> correctly. In which case, we'll need to write in some special flag which
>>>> tells the synapse http driver to ignore streaming, buffer the message,
>>>> count the size and set content length and then send it.
>>>>
>>>> Another thing that may work is using the non-NIO transport. Someone else
>>>> will have to give the details on how turn that on.
>>>>
>>>> Sanjiva.
>>>>
>>>>
>>>> Alex Reis wrote:
>>>>> Paul/All
>>>>>
>>>>> (Reposting this under the right thread)
>>>>>
>>>>> I've tried adding the property mediator as paul said, but the request
>>>>> sent to the proxyed endpoint still doesn't have Content-Length. Tcp
>>>>> monitor show the following request being sent:
>>>>>
>>>>> --
>>>>> POST http://localhost:12345/wsa/wsa1 HTTP/1.1
>>>>> Host: 192.168.5.30:12345
>>>>> SOAPAction: ""
>>>>> Content-Type: text/xml; charset=UTF-8
>>>>> Transfer-Encoding: chunked
>>>>> Connection: Keep-Alive
>>>>> User-Agent: Synapse-HttpComponents-NIO
>>>>>
>>>>> 14d
>>>>> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
>>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>>>> xmlns:urn="urn:dtsl.ems2.cadastros.services.itemdocument:ItemDocument"><soapenv:Body>
>>>>>      <urn:getItems>
>>>>>         <urn:idGrupoEstoque>81</urn:idGrupoEstoque>
>>>>>      </urn:getItems>
>>>>>   </soapenv:Body></soapenv:Envelope>
>>>>> 0
>>>>> --
>>>>>
>>>>> synapse XML config follows:
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>
>>>>> <syn:definitions xmlns:syn="http://ws.apache.org/ns/synapse">
>>>>>
>>>>>    <syn:registry provider="org.wso2.esb.registry.ESBRegistry">
>>>>>
>>>>>        <syn:parameter name="root">file:registry/</syn:parameter>
>>>>>
>>>>>    </syn:registry>
>>>>>
>>>>>    <syn:proxy name="ItemNovo" transports="http" startOnLoad="true"
>>>>> statistics="enable" trace="enable">
>>>>>
>>>>>        <syn:target>
>>>>>
>>>>>            <syn:endpoint>
>>>>>
>>>>>                <syn:address uri="http://localhost:12345/wsa/wsa1"/>
>>>>>
>>>>>            </syn:endpoint>
>>>>>
>>>>>            <syn:inSequence>
>>>>>
>>>>>                <syn:property name="Content-Length" value="328"
>>>>> scope="transport"/>
>>>>>
>>>>>                <syn:log level="full" separator="--"/>
>>>>>
>>>>>            </syn:inSequence>
>>>>>
>>>>>            <syn:outSequence>
>>>>>
>>>>>                <syn:send/>
>>>>>
>>>>>            </syn:outSequence>
>>>>>
>>>>>        </syn:target>
>>>>>
>>>>>        <syn:publishWSDL
>>>>> uri="http://192.168.5.30:8080/wsa/wsa1/wsdl?targetURI=urn:dtsl.ems2.cadastros.services.itemdocument"/>
>>>>>
>>>>>    </syn:proxy>
>>>>>
>>>>>    <syn:sequence statistics="enable" name="main" trace="enable">
>>>>>
>>>>>        <syn:in>
>>>>>
>>>>>            <syn:log level="full"/>
>>>>>
>>>>>            <syn:filter source="get-property('To')"
>>>>> regex="<a href="http://localhost:9000.*">http://localhost:9000.*">
>>>>>
>>>>>                <syn:send/>
>>>>>
>>>>>            </syn:filter>
>>>>>
>>>>>        </syn:in>
>>>>>
>>>>>        <syn:out>
>>>>>
>>>>>            <syn:send/>
>>>>>
>>>>>        </syn:out>
>>>>>
>>>>>    </syn:sequence>
>>>>>
>>>>>    <syn:sequence statistics="enable" name="fault" trace="enable">
>>>>>
>>>>>        <syn:log/>
>>>>>
>>>>>    </syn:sequence>
>>>>>
>>>>> </syn:definitions>
>>>>>
>>>>> On Dec 21, 2007 9:55 AM, Alex Reis <[hidden email]> wrote:
>>>>>> Created JIRA ESBJAVA-415.
>>>>>>
>>>>>> Is it possible to get the whole message, envelope included with
>>>>>> something like MessageContext.getXMLPayload()? I could use a script
>>>>>> mediator to calculate it if something like that exists, but I'd think
>>>>>> that the SOAP envelopes are added only at the send mediator. I thought
>>>>>> of using the xpath function string-length over the serialized XML, but
>>>>>> I'm not quite sure how.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Dec 21, 2007 9:29 AM, Paul Fremantle <[hidden email]> wrote:
>>>>>>> Alex
>>>>>>>
>>>>>>> Firstly, can you raise a JIRA about automatically adding Content-Length
>>>>>>> headers to the message?
>>>>>>>
>>>>>>> Secondly, you can add transport headers to the message.
>>>>>>>
>>>>>>>   <property name="string" action='set' value="literal" |
>>>>>>> expression="xpath") scope=transport|axis2|axis2-client]/>
>>>>>>>
>>>>>>> However, I don't know how you are going to calculate it!
>>>>>>>
>>>>>>> Asankha - is there already a way to turn on adding content-length in the
>>>>>>> NIO HTTP client?
>>>>>>>
>>>>>>> Paul
>>>>>>>
>>>>>>> Alex Reis wrote:
>>>>>>>> Hello fellow ESBers,
>>>>>>>>
>>>>>>>> I'm not sure any of you are familiar with the Progress OpenEdge
>>>>>>>> WebServices Adapter. It's a proprietary Java EE web app to enable
>>>>>>>> execution of Progress OpenEdge procedures (4GL) using SOAP requests.
>>>>>>>>
>>>>>>>> Whenever I try to proxy it's services within the ESB and invoke it, I
>>>>>>>> get the response Error in SOAP Envelope: Content length must be
>>>>>>>> specified. (10913).
>>>>>>>>
>>>>>>>> If I invoke it directly through soapUI, it works AS LONG as I provide
>>>>>>>> the Content-Length header manually.
>>>>>>>>
>>>>>>>> So what I need to do is setup an input sequence that adds the
>>>>>>>> Content-Length headers with the payload + soap headers size. I tried
>>>>>>>> using the Header mediator but it only adds the SOAP headers, not HTTP.
>>>>>>>>
>>>>>>>> Is there any way to do this in Synapse/WSO2 ESB, maybe even using a
>>>>>>>> script mediator?
>>>>>>>>
>>>>>>>> Thank you,
>>>>>>>>
>>>>>>>> Alex
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> --
>>>>>>> Paul Fremantle
>>>>>>> Co-Founder and VP of Technical Sales, WSO2
>>>>>>> OASIS WS-RX TC Co-chair
>>>>>>>
>>>>>>> Office: +1 646 290 8050
>>>>>>> Cell: +44 798 447 4618
>>>>>>>
>>>>>>> blog: http://pzf.fremantle.org
>>>>>>> [hidden email]
>>>>>>>
>>>>>>> "Oxygenating the Web Service Platform", www.wso2.com
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Esb-java-user mailing list
>>>>>>> [hidden email]
>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Alexandre M. Reis
>>>>>> Enterprise Architect
>>>>>> Datasize Tecnologia da Informação Ltda.
>>>>>> Brasil & Movimento S.A.
>>>>>> www.sundownnet.com.br
>>>>>> +55-41-3276-6232
>>>>>> +55-41-8801-9154
>>>>>> +55-11-2103-4800
>>>>>>
>>>>>
>>>> --
>>>> Sanjiva Weerawarana, Ph.D.
>>>> Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
>>>> email: [hidden email]; cell: +1 650 265 8311 | +94 77 787 6880
>>>>
>>>> "Oxygenating the Web Service Platform."
>>>>
>>>>
>>>> _______________________________________________
>>>> Esb-java-user mailing list
>>>> [hidden email]
>>>> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>>>>
>>>
>>>
>> --
>> Paul Fremantle
>> Co-Founder and VP of Technical Sales, WSO2
>> OASIS WS-RX TC Co-chair
>>
>> Office: +1 646 290 8050
>> Cell: +44 798 447 4618
>>
>> blog: http://pzf.fremantle.org
>> [hidden email]
>>
>> "Oxygenating the Web Service Platform", www.wso2.com
>>
>> _______________________________________________
>> Esb-java-user mailing list
>> [hidden email]
>> http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>>
>
>
>

--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

Office: +1 646 290 8050
Cell: +44 798 447 4618

blog: http://pzf.fremantle.org
[hidden email]

"Oxygenating the Web Service Platform", www.wso2.com

_______________________________________________
Esb-java-user mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user