How to test XML Posts with HTTP Test?

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
User avatar
mpriess
Posts: 112
Joined: Tue Jul 02, 2002 6:00 pm
Location: Arizona, USA

How to test XML Posts with HTTP Test?

Post by mpriess »

Is it possible to test this type of XML post using the HTTP test?
Since the post data text box is only one line, when I paste it in it only displays the first line of the file. But, it does put the following into the "optional headers' section .......
Content-Type: application/x-www-form-urlencoded

I'm not real familiar with these type of posts myself but I'm trying to add them for the web team...any assistance is appreciated. Thx.

DTO-clientname WEB-CAT 3
HTTP MAX post to: http://someurlhere
XML to send to MAX:
<!DOCTYPE copy SYSTEM "http://someurlhere" >
<xtiinput>
<inputheader>
<actionset>
<action>get_shpntax</action>
</actionset>
</inputheader>
<inputdata>
<customerid>916452</customerid>
<shipping_addr>
<address_1>43 TEST ST</address_1>
<address_2/>
<city>SAN FRANCISCO</city>
<state>CA</state>
<zip>94118</zip>
<country/>
</shipping_addr>
<shipping_codes>
<method>
<code/>
<description/>
<price/>
<account_number/>
</method>
</shipping_codes>
<shopping_cart>
<line_item>
<product>
<product_code>F5C594-TEL</product_code>
<quantity>1</quantity>
<price>9.99</price>
</product>
</line_item>
<line_item>
<product>
<product_code>F3X171-10</product_code>
<quantity>1</quantity>
<price>19.99</price>
</product>
</line_item>
</shopping_cart>
</inputdata>
</xtiinput>
Check for: <action type="result" code="250" message="250">

Thx,
Mark
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Yes, "Post data" field accepts just single line (don't really remember why).
But I think you may use "Optional headers" field. You need to add :
- Content-Length: <length of post data>
- empty line
- data that you want to post
E.g.

Code: Select all

Content-Type: application/x-www-form-urlencoded
Content-Length: 988

DTO-clientname WEB-CAT 3 
HTTP MAX post to: http://someurlhere 
XML to send to MAX: 
<!DOCTYPE copy SYSTEM "http://someurlhere" > 
<xtiinput> 
<inputheader> 
<actionset> 
<action>get_shpntax</action> 
</actionset> 
</inputheader> 
<inputdata> 
<customerid>916452</customerid> 
<shipping_addr> 
<address_1>43 TEST ST</address_1> 
<address_2/> 
<city>SAN FRANCISCO</city> 
<state>CA</state> 
<zip>94118</zip> 
<country/> 
</shipping_addr> 
<shipping_codes> 
<method> 
<code/> 
<description/> 
<price/> 
<account_number/> 
</method> 
</shipping_codes> 
<shopping_cart> 
<line_item> 
<product> 
<product_code>F5C594-TEL</product_code> 
<quantity>1</quantity> 
<price>9.99</price> 
</product> 
</line_item> 
<line_item> 
<product> 
<product_code>F3X171-10</product_code> 
<quantity>1</quantity> 
<price>19.99</price> 
</product> 
</line_item> 
</shopping_cart> 
</inputdata> 
</xtiinput> 
Check for: <action type="result" code="250" message="250"> 
Regards
Alex
User avatar
mpriess
Posts: 112
Joined: Tue Jul 02, 2002 6:00 pm
Location: Arizona, USA

XML Post

Post by mpriess »

Hi Alex,

I receive "Error 2" HTTP component has nothing to post.

Is there anything I should put in the post data text box to tell it to use the optional headers data?

Also, is the content length simply the number of characters (without spaces) in the post? Or is this something else?

Thx again,
Mark
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I receive "Error 2" HTTP component has nothing to post.
Is there anything I should put in the post data text box to tell it to use the optional headers data?
Oh, yes. You should put anything in Post Data field. If script on server side process Content-Length parameter correctly, it will ignore additional data.
Also, is the content length simply the number of characters (without spaces) in the post? Or is this something else?
Why without spaces? Content length - the number of characters including spaces.

Regards
Alex
User avatar
mpriess
Posts: 112
Joined: Tue Jul 02, 2002 6:00 pm
Location: Arizona, USA

XML Posts

Post by mpriess »

We haven't been able to get it to work by putting the post data in the optional headers section but have got it to work by:

Removing all carriage returns and placing the data in the post data text box preceded with "xmldoc="

It requires a little extra work but it'll work for now.

Thx for your help Alex.
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Removing all carriage returns and placing the data in the post data text box preceded with "xmldoc="
This idea is better than mine

Regards
Alex
Post Reply