core-jgi/fitnesse/FitNesseRoot/FitLibraryWeb/WebServicesClient/content.txt

72 lines
2.9 KiB
Plaintext
Raw Normal View History

!*< xml
!define soap11 ({{{<?xml version='1.0' encoding='utf-8'?>
<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
<soap:Body>}}})
!define endSoap11 ({{{</soap:Body></soap:Envelope>}}})
!define soap12 ({{{<?xml version='1.0' encoding='utf-8'?>
<soap12:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap12='http://www.w3.org/2003/05/soap-envelope'>
<soap12:Body>}}})
!define endSoap12 ({{{</soap12:Body></soap12:Envelope>}}})
*!
!3 1. Examples, Tutorial and Specifications
#
|!3 See:|
|[[''Examples''][^WebServicesExamples]]|
|[[''A tutorial on calling web services''][^WebServicesTutorial]]|
|[[''Specifications''][^SpecifiCations]]|
#
----!3 2. Commands
#
* To start it:
!|fitlibrary.ws.WebServicesClientFixture|
* To specify that https certificates are to be ignored (prior to any other calls):
|''accept any certificate''|
* Specify a proxy (prior to any calls other than the one above):
|''proxy url''|http://proxy|''with port''|8099|
* To post a web service call with plain text, soap1.1, soap1.2, or ''raw'' soap:
|''to''|http://localhost:8093/ws|''post text''|count=100|
|''to''|http://localhost:8093/ws|''post soap11''|<Count>100</Count>|
|''to''|http://localhost:8093/ws|''post soap12''|<Count>100</Count>|
|''to''|http://localhost:8093/ws|''as''|SOAP11|''post full soap''|${soap11}<Count>100</Count>${endSoap11}|
''Raw soap'' contains all the soap wrappers, unlike with soap1.1 and soap1.2, where the soap wrappers are added and remove automatically.
* To post a web service call with plain text, soap1.1, soap1.2, or ''raw'' soap from a file:
|''to''|http://localhost:8093/ws|''post text from file''|ws.txt|
|''to''|http://localhost:8093/ws|''post soap11 from file''|ws.xml|
|''to''|http://localhost:8093/ws|''post soap12 from file''|ws.xml|
|''to''|http://localhost:8093/ws|''as''|SOAP11|''post full soap from file''|soap/test.xml|
* To post a web service call with plain text, soap1.1, soap1.2, or ''raw'' soap from a ''relative'' file (ie, relative to the ''!-FitNesseRoot/files-!'' directory):
|''to''|http://localhost:8093/ws|''post text from relative file''|ws.txt|
|''to''|http://localhost:8093/ws|''post soap11 from relative file''|ws.xml|
|''to''|http://localhost:8093/ws|''post soap12 from relative file''|ws.xml|
|''to''|http://localhost:8093/ws|''as''|SOAP11|''post full soap from relative file''|soap/test.xml|
* To use an xpath to pull information out of the last response:
|''xpath''|//ab//cd|''in response''|'''contains'''|tax|
* To check for the existence of an element in the last response, using xpath:
|''xpath''|//ab//cd|''exists in response''|
* To XML diff the last response against expected XML:
|''xml in response same as''|<a><b>B</b></a>|
#
----!3 Implementation
#
This is based on the apache open-source system ''!-HttpClient-!''.
See http://hc.apache.org/httpclient-3.x/ for further details.