XML and HTTP Post

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
Nadir
Posts: 264
Joined: Mon Aug 29, 2005 2:01 am

XML and HTTP Post

Post by Nadir »

Hi,

Could it possible to send XML request to a web server and parse reply to check for key word.

Thanks for help
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

We are going to implement particular test method to check SOAP/XML services, however, it has not been implemented yet.
Anyway, I think you may use "URL" test methods to check SOAP services over HTTP: http://www.ks-soft.net/hostmon.eng/mfra ... ts.htm#url
"URL" test method supports "POST" requests, so you may specify some piece of XML code into "Post data" field" to be sent to the Webservice, available by URL, specified in "URL" field.
Also you may enable "Check content" option to make HostMontor alert you if returned content contains/doesn't contain particular string or expression.

We understand that it is not very convenient to check string in XML content, returned by webservice. That's why we decided to implement dedicated test the check SOAP webservices, based on "URL" test method. Probably, you could point us into right direction? Our vision of this test is described below:

1. User have to specify URL to the Webservice into "URL" field.
2. User may choose between "GET" and "POST" requests to the WebService. In case of "POST" request, user have to provide some part of XML being sent to the web service.
3. User may verify returned XML content using two following approaches:
a) value of specified node in returned content should be equal to specified string
b) we provide ability to specify some XSL code. The result of transforming of the returned content with specified XSL should be equal to specified string

What do you say? Will it suit your needs? Do you have any suggestion at this point?
Your help is greatly appreciated.

Also you may use "Active Script" test method: http://www.ks-soft.net/hostmon.eng/mfra ... htm#script
This method allows you to create come .vb, .js or .pl script to access your web service. For instance, you may use following objects within your scripts: Msxml2.XMLHTTP or Microsoft.XMLHTTP
http://msdn2.microsoft.com/en-us/magazine/cc301512.aspx

Regards,
Max
Nadir
Posts: 264
Joined: Mon Aug 29, 2005 2:01 am

Post by Nadir »

Is http test and URL test use same part of code to do HTTP Post?
If I want to send the following code, I just need to copy it into post data?
<Transaction
xmlns="http://www.exchangefortravel.org/xft/current"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exchangefortravel.org/xft/current file:/C:/Perinfo/XFT/Docs/1.1.15/xft_transaction.xsd"
xsi:type="TransactionRequestType"
TimeStamp="2008-02-13T11:27:27">
<Control>
<Requester Code="%CodeCanalConnexion%" />
</Control>
<Action Code="Status" Purpose="Get"/>
</Transaction>
1. User have to specify URL to the Webservice into "URL" field.
Yes
2. User may choose between "GET" and "POST" requests to the WebService. In case of "POST" request, user have to provide some part of XML being sent to the web service.
yes and macros could be used in code
3. User may verify returned XML content using two following approaches:
a) value of specified node in returned content should be equal to specified string
b) we provide ability to specify some XSL code. The result of transforming of the returned content with specified XSL should be equal to specified string
Great
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Nadir wrote:Is http test and URL test use same part of code to do HTTP Post?
No, they aren't. Both methods perform the same POST request, but using different approaches. "URL" test method uses Microsoft's WinInet/WinHTTP API, while "HTTP" test method uses our own code. Beside that, "HTTTP" test method does not support "HTTPS" requests, but using "HTTP" test method you can define more parameters specific to HTTP protocol and setup more varied checks.
Nadir wrote:If I want to send the following code, I just need to copy it into post data?
Correct. You may use "%HttpPage%" macro variable to see the content, returned by server. Quote from the manual:
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro
===================================
%HttpPage% - Represents contents of the monitored web page (first 32768 (32K) characters of the web page if test was performed by HostMonitor; first 2048 (2K) characters of the page if test was performed by RMA).
===================================
Nadir wrote:yes and macros could be used in code
Not sure I understand what macros do you have in mind? Could you explain, please?

Regards,
Max
Nadir
Posts: 264
Joined: Mon Aug 29, 2005 2:01 am

Post by Nadir »

Date macro variable, folder macro variable, udv macro variable ...
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Nadir wrote:Date macro variable, folder macro variable, udv macro variable ...
Ah, these macros... Good point. Thank you.

Regards,
Max
Nadir
Posts: 264
Joined: Mon Aug 29, 2005 2:01 am

Post by Nadir »

You are welcom
Post Reply