Config Info
Name Web Services monitor
Version 1.0

About

ATTENTION: Deprecated.

Web Services monitoring have been implemented both for Structis PoC and Yves Rocher

How to use it

1. First, you need to run SOAPUI and create a project with the WSDL to monitor. The open source software will provide the corresponding URI and the envelope_template for all the availbale requests

 

2. Once you have the enveloppe for the request to be executed, change the Pre-Health Check Actions content in the monitor

import sys, httplib
#Put here the URI corresponding to the WSDL (Except Host and port)                                            _post = '/v330/ucawsroot/ucawebservices/ucacheckup/ucaws_ucacheckup.php'
  # Enter Port as appears in URI

_port = 9113
#Host as appears in URI

_host = '10.1.252.72'


#envelope_template is a simple string template that matches the required. It is the envelope corresponfing to the SOAP request you want to execute as appears in SOAPUI
envelope_template = """<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ucaUcaCheckup.webservices.uca.net">
<soapenv:Header/>
<soapenv:Body>
<urn:PerformTest soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</soapenv:Body>
</soapenv:Envelope>"""

# populate the outbound SOAP envelope
#envelope = envelope_template%( _license_key, _query, _start, _maxResults, _filter, _restrict)
envelope =envelope_template
# now, we open an HTTP connection, set required headers, and send the SOAP envelope
envlen = len(envelope)
http_conn = httplib.HTTP(_host, _port)

http_conn.putrequest('POST', _post)
http_conn.putheader('Host', _host)
http_conn.putheader('Content-Type', 'text/xml; charset="utf-8"')
http_conn.putheader('Content-Length', str(envlen))
http_conn.putheader('SOAPAction', )
http_conn.endheaders()
http_conn.send(envelope)
#fetch HTTP reply headers and the response
(status_code, message, reply_headers) = http_conn.getreply()
response = http_conn.getfile().read()
#dump raw xml
result = ""
result = result + "----------------------------------------\n"
result = result + "send headers:\n"+ str(http_conn.headers)
result = result + "\n----------------------------------------\n"
result = result + "send body:\n"+ envelope
result = result + "\n----------------------------------------\n"
result = result + "\nstatus code:\n"+ str(status_code)
result = result + "\nstatus message:\n"+ str(message)
result = result + "\nreply headers:\n"+ str(reply_headers)
result = result + "\n----------------------------------------\n"
result = result + "response body:\n \n" + response

 

3. Result for the attached template based on Yves Rocher Implementation is the following

----------------------------------------
send headers:
Date: Wed, 18 Aug 2010 12:07:14 GMT

Server: Apache/1.3.33 (Unix) mod_gzip/1.3.26.1a PHP/5.2.11

Vary: *

X-Powered-By: PHP/5.2.11

X-SOAP-Server: NuSOAP/0.6.9 (1.4)

Content-Length: 580

Connection: close

Content-Type: text/xml; charset=ISO-8859-1


----------------------------------------
send body:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ucaUcaCheckup.webservices.uca.net">
<soapenv:Header/>
<soapenv:Body>
<urn:PerformTest soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</soapenv:Body>
</soapenv:Envelope>
----------------------------------------

status code:
200
status message:
OK
reply headers:
Date: Wed, 18 Aug 2010 12:07:14 GMT

Server: Apache/1.3.33 (Unix) mod_gzip/1.3.26.1a PHP/5.2.11

Vary: *

X-Powered-By: PHP/5.2.11

X-SOAP-Server: NuSOAP/0.6.9 (1.4)

Content-Length: 580

Connection: close

Content-Type: text/xml; charset=ISO-8859-1


----------------------------------------
response body:

<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd"><SOAP-ENV:Body><ns1:PerformTestResponse xmlns:ns1="urn:ucaUcaCheckup.webservices.uca.net"><return xsi:type="xsd:boolean">true</return></ns1:PerformTestResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

 

Configuration

Note

: Health assessment in not configured in the sample


Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: October 23, 2018