You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Guy With Question <gu...@yahoo.com> on 2006/11/27 16:29:29 UTC

Best way to send XML to a servlet?

Hi,

I am using HTTP client 3.0.

I have a very large XML string I want to send to a servlet. I have the liberty to choose whatever transport I want, since I will be writing both the client and the servlet. The servlet ultimately needs the XML as an input stream to perform XSLT transformations.

What would be the best way to send this large XML data, SOAP document, NV pairs, or is there some other easier way?

Thanks very much!


Re: Best way to send XML to a servlet?

Posted by Doug Lochart <dl...@gmail.com>.
Ditto on the above comments. Post it to the servlet either using gzip
encoding or you can prgramatically bzip it before and unbzip it afterwards
in your servlet.  If security is involved you can use anyone of a myriad of
authentication mechanisms and/or use SSL

On 11/27/06, Mark Claassen <mc...@ocie.net> wrote:
>
> You might also want to consider using GZIP encoding.  I am not sure if
> there
> is an automatic way to do this using HttpClient.  But if you are sending
> large XML messages, a quick GZIP can reduce the transfer size by around
> 90%.
>
> -----Original Message-----
> From: Christopher L Merrill [mailto:chris@webperformance.com]
> Sent: Monday, November 27, 2006 10:43 AM
> To: HttpClient User Discussion
> Subject: Re: Best way to send XML to a servlet?
>
> Guy With Question wrote:
> > I have a very large XML string I want to send to a servlet. I have the
> > liberty to choose whatever transport I want, since I will be writing
> > both the client and the servlet. The servlet ultimately needs the XML as
> an input stream to perform XSLT transformations.
> >
> > What would be the best way to send this large XML data, SOAP document,
> > NV pairs, or is there some other easier way?
>
> Why not just POST it using standard HTTP?  If there is only one
> transaction
> in the session, than SOAP may be overkill.  Is there authentication
> involved?
>
> Chris
>
>
> --
> ------------------------------------------------------------------------ -
> Chris Merrill                           |  Web Performance, Inc.
> chris@webperformance.com                |  http://webperformance.com
> 919-433-1762                            |  919-845-7601
>
> Website Load Testing and Stress Testing Software & Services
> ------------------------------------------------------------------------ -
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>


-- 
What profits a man if he gains the whole world yet loses his soul?

RE: Best way to send XML to a servlet?

Posted by Mark Claassen <mc...@ocie.net>.
You might also want to consider using GZIP encoding.  I am not sure if there
is an automatic way to do this using HttpClient.  But if you are sending
large XML messages, a quick GZIP can reduce the transfer size by around 90%.
 
-----Original Message-----
From: Christopher L Merrill [mailto:chris@webperformance.com] 
Sent: Monday, November 27, 2006 10:43 AM
To: HttpClient User Discussion
Subject: Re: Best way to send XML to a servlet?

Guy With Question wrote:
> I have a very large XML string I want to send to a servlet. I have the 
> liberty to choose whatever transport I want, since I will be writing 
> both the client and the servlet. The servlet ultimately needs the XML as
an input stream to perform XSLT transformations.
> 
> What would be the best way to send this large XML data, SOAP document, 
> NV pairs, or is there some other easier way?

Why not just POST it using standard HTTP?  If there is only one transaction
in the session, than SOAP may be overkill.  Is there authentication
involved?

Chris


--
------------------------------------------------------------------------ -
Chris Merrill                           |  Web Performance, Inc.
chris@webperformance.com                |  http://webperformance.com
919-433-1762                            |  919-845-7601

Website Load Testing and Stress Testing Software & Services
------------------------------------------------------------------------ -

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


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


Re: Best way to send XML to a servlet?

Posted by Christopher L Merrill <ch...@webperformance.com>.
Guy With Question wrote:
> I have a very large XML string I want to send to a servlet. I have the liberty to choose whatever
> transport I want, since I will be writing both the client and the servlet. The servlet ultimately
> needs the XML as an input stream to perform XSLT transformations.
> 
> What would be the best way to send this large XML data, SOAP document, NV pairs, or is there some
> other easier way?

Why not just POST it using standard HTTP?  If there is only one transaction
in the session, than SOAP may be overkill.  Is there authentication involved?

Chris


-- 
------------------------------------------------------------------------ -
Chris Merrill                           |  Web Performance, Inc.
chris@webperformance.com                |  http://webperformance.com
919-433-1762                            |  919-845-7601

Website Load Testing and Stress Testing Software & Services
------------------------------------------------------------------------ -

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