You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by hans jung <ju...@googlemail.com> on 2012/05/23 12:24:48 UTC

Trying to build a http post request with xml content in jmeter

Hello everybody, I am completely new to jmeter and I am trying to simulate
a Post Request with XML content.

The Post request I am trying to simulate looks like this:

http://12.123.250.45:8000/zgfx_mde ?POST
&sap-client=200&sap-language=DE&sap-user=user001&sap-password=++++++++++
HTTP/1.1<?xml version="1.0"
encoding="ISO-8859-1"?><MSG><MSG_HDR><SENDER>SAPHttp</SENDER><RECEIVER>MDE-10</RECEIVER><THEME>MDE-10T02</THEME><TCODE>RS</TCODE><STORE>1001</STORE><MDE_ID>mde-agf</MDE_ID></MSG_HDR><MSG_DATA><EAN>4008122010777</EAN></MSG_DATA></MSG>


Now I try to build it i jMeter (using a Thread group and under that an http
sampler and a tree results element.).
I created the HTTP Sampler, set the Method to POST, enter server name, port
number, path and entered all the name/value pairs you see above
(sap-client, sap language, etc) in the parameters section.
But where do I put the XML??
Apparently I cannot put anything in the Post Body (Message "Cannot convert
parameter to raw post body because one of the parameters has a name)".



Regards & Thanks in advance,

Junghans

Re: Trying to build a http post request with xml content in jmeter

Posted by Shaba K <sh...@gmail.com>.
Hey there ,

You need to add User defined variables sampler

& pass there, or if you are sending it with your request.

Send it within the http sampler

As i mentioned earlier have a look at the blog forwarded to you .

On Wed, May 23, 2012 at 8:38 PM, hans jung <ju...@googlemail.com>wrote:

> Hi Philippe,
>
> but where do I put my parameters (like sap-user and sap-password (see my
> initial post)?
>
> Regards,
>
> Junghans
>
> 2012/5/23 Philippe Mouawad <ph...@gmail.com>
>
> > Hello,
> > Switch to Raw Post body before putting anything in the parameters table
> > then put your XML content in the text area and you're done.
> >
> > Regards
> > Philippe
> >
> > On Wed, May 23, 2012 at 12:24 PM, hans jung <junghansmega@googlemail.com
> > >wrote:
> >
> > > Hello everybody, I am completely new to jmeter and I am trying to
> > simulate
> > > a Post Request with XML content.
> > >
> > > The Post request I am trying to simulate looks like this:
> > >
> > > http://12.123.250.45:8000/zgfx_mde ?POST
> > >
> &sap-client=200&sap-language=DE&sap-user=user001&sap-password=++++++++++
> > > HTTP/1.1<?xml version="1.0"
> > >
> > >
> >
> encoding="ISO-8859-1"?><MSG><MSG_HDR><SENDER>SAPHttp</SENDER><RECEIVER>MDE-10</RECEIVER><THEME>MDE-10T02</THEME><TCODE>RS</TCODE><STORE>1001</STORE><MDE_ID>mde-agf</MDE_ID></MSG_HDR><MSG_DATA><EAN>4008122010777</EAN></MSG_DATA></MSG>
> > >
> > >
> > > Now I try to build it i jMeter (using a Thread group and under that an
> > http
> > > sampler and a tree results element.).
> > > I created the HTTP Sampler, set the Method to POST, enter server name,
> > port
> > > number, path and entered all the name/value pairs you see above
> > > (sap-client, sap language, etc) in the parameters section.
> > > But where do I put the XML??
> > > Apparently I cannot put anything in the Post Body (Message "Cannot
> > convert
> > > parameter to raw post body because one of the parameters has a name)".
> > >
> > >
> > >
> > > Regards & Thanks in advance,
> > >
> > > Junghans
> > >
> >
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
> >
>

Re: Trying to build a http post request with xml content in jmeter

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,
I think I read your mail too fast and zoomed on Raw Post body.
Looking at your initial request:
http://12.123.250.45:8000/zgfx_mde ?POST
> > &sap-client=200&sap-language=
DE&sap-user=user001&sap-password=++++++++++
> > HTTP/1.1<?xml version="1.0"
> >
> >
>
encoding="ISO-8859-1"?><MSG><MSG_HDR><SENDER>SAPHttp</SENDER><RECEIVER>MDE-10</RECEIVER><THEME>MDE-10T02</THEME><TCODE>RS</TCODE><STORE>1001</STORE><MDE_ID>mde-agf</MDE_ID></MSG_HDR><MSG_DATA><EAN>4008122010777</EAN></MSG_DATA></MSG>

What is this request exactly:

   - Is POST a parameter or the method in Header ?
   - I don't understand why there is HTTP/1.1 between sap-password and
   <?xml
   - Are you sure it's the exact request ? how did you get it ?

Are these 4 parameters headers or parameters ?:

   - sap-client=200&sap-language=
   DE&sap-user=user001&sap-password=



It would be better to try to capture the request with JMeter Proxy or
Fiddler to see what the request looks like.

Regards
Philippe

On Wed, May 23, 2012 at 9:38 PM, hans jung <ju...@googlemail.com>wrote:

> Hi Philippe,
>
> but where do I put my parameters (like sap-user and sap-password (see my
> initial post)?
>
> Regards,
>
> Junghans
>
> 2012/5/23 Philippe Mouawad <ph...@gmail.com>
>
> > Hello,
> > Switch to Raw Post body before putting anything in the parameters table
> > then put your XML content in the text area and you're done.
> >
> > Regards
> > Philippe
> >
> > On Wed, May 23, 2012 at 12:24 PM, hans jung <junghansmega@googlemail.com
> > >wrote:
> >
> > > Hello everybody, I am completely new to jmeter and I am trying to
> > simulate
> > > a Post Request with XML content.
> > >
> > > The Post request I am trying to simulate looks like this:
> > >
> > > http://12.123.250.45:8000/zgfx_mde ?POST
> > >
> &sap-client=200&sap-language=DE&sap-user=user001&sap-password=++++++++++
> > > HTTP/1.1<?xml version="1.0"
> > >
> > >
> >
> encoding="ISO-8859-1"?><MSG><MSG_HDR><SENDER>SAPHttp</SENDER><RECEIVER>MDE-10</RECEIVER><THEME>MDE-10T02</THEME><TCODE>RS</TCODE><STORE>1001</STORE><MDE_ID>mde-agf</MDE_ID></MSG_HDR><MSG_DATA><EAN>4008122010777</EAN></MSG_DATA></MSG>
> > >
> > >
> > > Now I try to build it i jMeter (using a Thread group and under that an
> > http
> > > sampler and a tree results element.).
> > > I created the HTTP Sampler, set the Method to POST, enter server name,
> > port
> > > number, path and entered all the name/value pairs you see above
> > > (sap-client, sap language, etc) in the parameters section.
> > > But where do I put the XML??
> > > Apparently I cannot put anything in the Post Body (Message "Cannot
> > convert
> > > parameter to raw post body because one of the parameters has a name)".
> > >
> > >
> > >
> > > Regards & Thanks in advance,
> > >
> > > Junghans
> > >
> >
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
> >
>



-- 
Cordialement.
Philippe Mouawad.

Re: Trying to build a http post request with xml content in jmeter

Posted by hans jung <ju...@googlemail.com>.
Hi Philippe,

but where do I put my parameters (like sap-user and sap-password (see my
initial post)?

Regards,

Junghans

2012/5/23 Philippe Mouawad <ph...@gmail.com>

> Hello,
> Switch to Raw Post body before putting anything in the parameters table
> then put your XML content in the text area and you're done.
>
> Regards
> Philippe
>
> On Wed, May 23, 2012 at 12:24 PM, hans jung <junghansmega@googlemail.com
> >wrote:
>
> > Hello everybody, I am completely new to jmeter and I am trying to
> simulate
> > a Post Request with XML content.
> >
> > The Post request I am trying to simulate looks like this:
> >
> > http://12.123.250.45:8000/zgfx_mde ?POST
> > &sap-client=200&sap-language=DE&sap-user=user001&sap-password=++++++++++
> > HTTP/1.1<?xml version="1.0"
> >
> >
> encoding="ISO-8859-1"?><MSG><MSG_HDR><SENDER>SAPHttp</SENDER><RECEIVER>MDE-10</RECEIVER><THEME>MDE-10T02</THEME><TCODE>RS</TCODE><STORE>1001</STORE><MDE_ID>mde-agf</MDE_ID></MSG_HDR><MSG_DATA><EAN>4008122010777</EAN></MSG_DATA></MSG>
> >
> >
> > Now I try to build it i jMeter (using a Thread group and under that an
> http
> > sampler and a tree results element.).
> > I created the HTTP Sampler, set the Method to POST, enter server name,
> port
> > number, path and entered all the name/value pairs you see above
> > (sap-client, sap language, etc) in the parameters section.
> > But where do I put the XML??
> > Apparently I cannot put anything in the Post Body (Message "Cannot
> convert
> > parameter to raw post body because one of the parameters has a name)".
> >
> >
> >
> > Regards & Thanks in advance,
> >
> > Junghans
> >
>
>
>
> --
> Cordialement.
> Philippe Mouawad.
>

Re: Trying to build a http post request with xml content in jmeter

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,
Switch to Raw Post body before putting anything in the parameters table
then put your XML content in the text area and you're done.

Regards
Philippe

On Wed, May 23, 2012 at 12:24 PM, hans jung <ju...@googlemail.com>wrote:

> Hello everybody, I am completely new to jmeter and I am trying to simulate
> a Post Request with XML content.
>
> The Post request I am trying to simulate looks like this:
>
> http://12.123.250.45:8000/zgfx_mde ?POST
> &sap-client=200&sap-language=DE&sap-user=user001&sap-password=++++++++++
> HTTP/1.1<?xml version="1.0"
>
> encoding="ISO-8859-1"?><MSG><MSG_HDR><SENDER>SAPHttp</SENDER><RECEIVER>MDE-10</RECEIVER><THEME>MDE-10T02</THEME><TCODE>RS</TCODE><STORE>1001</STORE><MDE_ID>mde-agf</MDE_ID></MSG_HDR><MSG_DATA><EAN>4008122010777</EAN></MSG_DATA></MSG>
>
>
> Now I try to build it i jMeter (using a Thread group and under that an http
> sampler and a tree results element.).
> I created the HTTP Sampler, set the Method to POST, enter server name, port
> number, path and entered all the name/value pairs you see above
> (sap-client, sap language, etc) in the parameters section.
> But where do I put the XML??
> Apparently I cannot put anything in the Post Body (Message "Cannot convert
> parameter to raw post body because one of the parameters has a name)".
>
>
>
> Regards & Thanks in advance,
>
> Junghans
>



-- 
Cordialement.
Philippe Mouawad.

Re: Trying to build a http post request with xml content in jmeter

Posted by Shaba K <sh...@gmail.com>.
If you go through the blog from extracting using xpath

I am assuming you want to build a http request from your previous response.

Have a detailed eye onto the blog you'l sail through

On Wed, May 23, 2012 at 11:59 AM, hans jung <ju...@googlemail.com>wrote:

> Thanks Shaba. I can now see the contents of the jmeter properties file just
> as described.
> But ho does that help me with building the post request? (Maybe I am
> missing something?)
>
>
> Regards & Thx in advance,
>
>
> Junghans
>
> 2012/5/23 Shaba K <sh...@gmail.com>
>
> > Hi There,
> >
> > Check this blog to get started
> >
> >
> >
> http://automationwithselenium.blogspot.co.uk/2012/02/gui-view-system-jmeter-properties.html
> >
> >
> > If it helps
> >
> > Cheers,
> > -S
> >
> > On Wed, May 23, 2012 at 11:24 AM, hans jung <junghansmega@googlemail.com
> > >wrote:
> >
> > > Hello everybody, I am completely new to jmeter and I am trying to
> > simulate
> > > a Post Request with XML content.
> > >
> > > The Post request I am trying to simulate looks like this:
> > >
> > > http://12.123.250.45:8000/zgfx_mde ?POST
> > >
> &sap-client=200&sap-language=DE&sap-user=user001&sap-password=++++++++++
> > > HTTP/1.1<?xml version="1.0"
> > >
> > >
> >
> encoding="ISO-8859-1"?><MSG><MSG_HDR><SENDER>SAPHttp</SENDER><RECEIVER>MDE-10</RECEIVER><THEME>MDE-10T02</THEME><TCODE>RS</TCODE><STORE>1001</STORE><MDE_ID>mde-agf</MDE_ID></MSG_HDR><MSG_DATA><EAN>4008122010777</EAN></MSG_DATA></MSG>
> > >
> > >
> > > Now I try to build it i jMeter (using a Thread group and under that an
> > http
> > > sampler and a tree results element.).
> > > I created the HTTP Sampler, set the Method to POST, enter server name,
> > port
> > > number, path and entered all the name/value pairs you see above
> > > (sap-client, sap language, etc) in the parameters section.
> > > But where do I put the XML??
> > > Apparently I cannot put anything in the Post Body (Message "Cannot
> > convert
> > > parameter to raw post body because one of the parameters has a name)".
> > >
> > >
> > >
> > > Regards & Thanks in advance,
> > >
> > > Junghans
> > >
> >
>

Re: Trying to build a http post request with xml content in jmeter

Posted by hans jung <ju...@googlemail.com>.
Thanks Shaba. I can now see the contents of the jmeter properties file just
as described.
But ho does that help me with building the post request? (Maybe I am
missing something?)


Regards & Thx in advance,


Junghans

2012/5/23 Shaba K <sh...@gmail.com>

> Hi There,
>
> Check this blog to get started
>
>
> http://automationwithselenium.blogspot.co.uk/2012/02/gui-view-system-jmeter-properties.html
>
>
> If it helps
>
> Cheers,
> -S
>
> On Wed, May 23, 2012 at 11:24 AM, hans jung <junghansmega@googlemail.com
> >wrote:
>
> > Hello everybody, I am completely new to jmeter and I am trying to
> simulate
> > a Post Request with XML content.
> >
> > The Post request I am trying to simulate looks like this:
> >
> > http://12.123.250.45:8000/zgfx_mde ?POST
> > &sap-client=200&sap-language=DE&sap-user=user001&sap-password=++++++++++
> > HTTP/1.1<?xml version="1.0"
> >
> >
> encoding="ISO-8859-1"?><MSG><MSG_HDR><SENDER>SAPHttp</SENDER><RECEIVER>MDE-10</RECEIVER><THEME>MDE-10T02</THEME><TCODE>RS</TCODE><STORE>1001</STORE><MDE_ID>mde-agf</MDE_ID></MSG_HDR><MSG_DATA><EAN>4008122010777</EAN></MSG_DATA></MSG>
> >
> >
> > Now I try to build it i jMeter (using a Thread group and under that an
> http
> > sampler and a tree results element.).
> > I created the HTTP Sampler, set the Method to POST, enter server name,
> port
> > number, path and entered all the name/value pairs you see above
> > (sap-client, sap language, etc) in the parameters section.
> > But where do I put the XML??
> > Apparently I cannot put anything in the Post Body (Message "Cannot
> convert
> > parameter to raw post body because one of the parameters has a name)".
> >
> >
> >
> > Regards & Thanks in advance,
> >
> > Junghans
> >
>

Re: Trying to build a http post request with xml content in jmeter

Posted by Shaba K <sh...@gmail.com>.
Hi There,

Check this blog to get started

http://automationwithselenium.blogspot.co.uk/2012/02/gui-view-system-jmeter-properties.html


If it helps

Cheers,
-S

On Wed, May 23, 2012 at 11:24 AM, hans jung <ju...@googlemail.com>wrote:

> Hello everybody, I am completely new to jmeter and I am trying to simulate
> a Post Request with XML content.
>
> The Post request I am trying to simulate looks like this:
>
> http://12.123.250.45:8000/zgfx_mde ?POST
> &sap-client=200&sap-language=DE&sap-user=user001&sap-password=++++++++++
> HTTP/1.1<?xml version="1.0"
>
> encoding="ISO-8859-1"?><MSG><MSG_HDR><SENDER>SAPHttp</SENDER><RECEIVER>MDE-10</RECEIVER><THEME>MDE-10T02</THEME><TCODE>RS</TCODE><STORE>1001</STORE><MDE_ID>mde-agf</MDE_ID></MSG_HDR><MSG_DATA><EAN>4008122010777</EAN></MSG_DATA></MSG>
>
>
> Now I try to build it i jMeter (using a Thread group and under that an http
> sampler and a tree results element.).
> I created the HTTP Sampler, set the Method to POST, enter server name, port
> number, path and entered all the name/value pairs you see above
> (sap-client, sap language, etc) in the parameters section.
> But where do I put the XML??
> Apparently I cannot put anything in the Post Body (Message "Cannot convert
> parameter to raw post body because one of the parameters has a name)".
>
>
>
> Regards & Thanks in advance,
>
> Junghans
>