You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Bruno Negrao <bn...@gmail.com> on 2006/07/10 17:25:52 UTC

Axis2: How to set "Transfer-encoding" header

Guys,

how to set the "Transfer-encoding" header used on the soap http post?
Also, how to set the other headers

thank you,
bruno

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: How to set "Transfer-encoding" header

Posted by Bruno Negrao <bn...@gmail.com>.
YYYYYEEEEEEEESSSSSS!!!!!!!! thank you very much Robert!!!! :-))))

On 7/10/06, robert lazarski <ro...@gmail.com> wrote:
> Does this help ?
>
> client.getOptions().setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED,org.apache.axis2.Constants.VALUE_FALSE);
>
> Robert
> http://www.braziloutsource.com/
>
> On 7/10/06, Bruno Negrao <bn...@gmail.com> wrote:
> > Oh no... I edited the axis2.xml file to change the transportSender
> > transfer-encoding to "deflated", but magically the packed goes with
> > the "chunked" enabled...
> >
> > does someone could give me a light on this?
> >
> > thank you
> > bruno
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: How to set "Transfer-encoding" header

Posted by robert lazarski <ro...@gmail.com>.
Does this help ?

client.getOptions().setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED,org.apache.axis2.Constants.VALUE_FALSE);

Robert
http://www.braziloutsource.com/

On 7/10/06, Bruno Negrao <bn...@gmail.com> wrote:
> Oh no... I edited the axis2.xml file to change the transportSender
> transfer-encoding to "deflated", but magically the packed goes with
> the "chunked" enabled...
>
> does someone could give me a light on this?
>
> thank you
> bruno
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: How to set "Transfer-encoding" header

Posted by Bruno Negrao <bn...@gmail.com>.
Oh no... I edited the axis2.xml file to change the transportSender
transfer-encoding to "deflated", but magically the packed goes with
the "chunked" enabled...

does someone could give me a light on this?

thank you
bruno

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: How to set "Transfer-encoding" header

Posted by Bruno Negrao <bn...@gmail.com>.
While I don't know what is a handler, I'm trying to set the
TransportOutDescription object. but it's still not workin. the code is
bellow:

TransportOutDescription transportOut =
ClientUtils.inferOutTransport(client.getServiceContext().getAxisService().getAxisConfiguration(),
options.getTo(), new MessageContext());
Parameter transferEncoding = new
Parameter(HTTPConstants.HEADER_TRANSFER_ENCODING, "deflate");
transportOut.addParameter(transferEncoding);
options.setTransportOut(transportOut);
client.setOptions(options);
client.sendReceive(getMessage());

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: How to set "Transfer-encoding" header

Posted by Bruno Negrao <bn...@gmail.com>.
Thank you,
but what is a handler? how can I create one?

On 7/10/06, robert lazarski <ro...@gmail.com> wrote:
> See HttpResponse . There's a method called addHeader() . You'll
> probably need a Handler to get access to it.
>
> HTH,
> Robert
> http://www.braziloutsource.com/
>
> On 7/10/06, Bruno Negrao <bn...@gmail.com> wrote:
> > The header I need to set goes here (look at the <====HERE flag):
> >
> > POST /pfappspabxutils HTTP/1.1
> > User-Agent: Axis2
> > SOAPAction: http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa
> > Host: pfdesenv.planetarium.com.br:8080
> > Transfer-Encoding: chunked                       <===== HERE!!!!
> > Content-Type: text/xml; charset=UTF-8
> >
> > That is outside the xml content. that is the http header... This
> > chunked encoding doesn't work with my soap server.
> >
> > bruno
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: How to set "Transfer-encoding" header

Posted by robert lazarski <ro...@gmail.com>.
See HttpResponse . There's a method called addHeader() . You'll
probably need a Handler to get access to it.

HTH,
Robert
http://www.braziloutsource.com/

On 7/10/06, Bruno Negrao <bn...@gmail.com> wrote:
> The header I need to set goes here (look at the <====HERE flag):
>
> POST /pfappspabxutils HTTP/1.1
> User-Agent: Axis2
> SOAPAction: http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa
> Host: pfdesenv.planetarium.com.br:8080
> Transfer-Encoding: chunked                       <===== HERE!!!!
> Content-Type: text/xml; charset=UTF-8
>
> That is outside the xml content. that is the http header... This
> chunked encoding doesn't work with my soap server.
>
> bruno
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: How to set "Transfer-encoding" header

Posted by Bruno Negrao <bn...@gmail.com>.
The header I need to set goes here (look at the <====HERE flag):

POST /pfappspabxutils HTTP/1.1
User-Agent: Axis2
SOAPAction: http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa
Host: pfdesenv.planetarium.com.br:8080
Transfer-Encoding: chunked                       <===== HERE!!!!
Content-Type: text/xml; charset=UTF-8

That is outside the xml content. that is the http header... This
chunked encoding doesn't work with my soap server.

bruno

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: How to set "Transfer-encoding" header

Posted by Bruno Negrao <bn...@gmail.com>.
Guys, I don't think you understood what header i need to set. I'm
talking about the HTTP
Transfer-encoding header that goes external to the message. Not that
<soap:header> that goes right before the <soap:body>.

I saw that the "chunked" transfer encoding is set by default on the
"axis.xml" file that goes on the distribution:
<transportSender name="http"
                 class="org.apache.axis2.transport.http.
                        CommonsHTTPTransportSender">
   <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
   <parameter name="Transfer-Encoding"
              locked="false">chunked</parameter>
</transportSender>

How can I set this header without editing this file?

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: How to set "Transfer-encoding" header

Posted by robert lazarski <ro...@gmail.com>.
On the client side you can call ServiceClient.addHeader() . On the
server side you need a Handler and a module. From there its
msgContext.getEnvelope().getHeader().getFirstChildWithName(new
QName("MyHeader"))

HTH,
Robert
http://www.braziloutsource.com/

On 7/10/06, Bruno Negrao <bn...@gmail.com> wrote:
> Guys, doesn't anybody know it? please...
>
> On 7/10/06, Bruno Negrao <bn...@gmail.com> wrote:
> > Guys,
> >
> > how to set the "Transfer-encoding" header used on the soap http post?
> > Also, how to set the other headers
> >
> > thank you,
> > bruno
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2: How to set "Transfer-encoding" header

Posted by Bruno Negrao <bn...@gmail.com>.
Guys, doesn't anybody know it? please...

On 7/10/06, Bruno Negrao <bn...@gmail.com> wrote:
> Guys,
>
> how to set the "Transfer-encoding" header used on the soap http post?
> Also, how to set the other headers
>
> thank you,
> bruno
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org