KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

How to test XML Posts with HTTP Test?

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
mpriess



Joined: 02 Jul 2002
Posts: 112
Location: Arizona, USA

PostPosted: Mon Mar 22, 2004 3:49 pm    Post subject: How to test XML Posts with HTTP Test? Reply with quote

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
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Tue Mar 23, 2004 1:28 am    Post subject: Reply with quote

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:
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
Back to top
View user's profile Send private message Visit poster's website
mpriess



Joined: 02 Jul 2002
Posts: 112
Location: Arizona, USA

PostPosted: Wed Mar 24, 2004 11:05 am    Post subject: XML Post Reply with quote

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
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Wed Mar 24, 2004 2:31 pm    Post subject: Reply with quote

Quote:
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.

Quote:
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
Back to top
View user's profile Send private message Visit poster's website
mpriess



Joined: 02 Jul 2002
Posts: 112
Location: Arizona, USA

PostPosted: Thu Mar 25, 2004 7:13 am    Post subject: XML Posts Reply with quote

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.
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Thu Mar 25, 2004 12:34 pm    Post subject: Reply with quote

Quote:
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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index