View previous topic :: View next topic |
Author |
Message |
cgrieves
Joined: 27 Jan 2010 Posts: 7
|
Posted: Mon Oct 03, 2016 7:19 am Post subject: Having trouble formatting SOAP fot a HM request |
|
|
Hi all, I've got a webservice that responds via SOAPUI using the following XML:
Code: |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tsws="http://test.com//TSWS" xmlns:tsx="http://schemas.datacontract.org/1/testAPI.Data">
<soapenv:Header>
<tsws:HeaderData>
<tsx:Security>
<tsx:LicenceKey>1234567990</tsx:LicenceKey>
</tsx:Security>
</tsws:HeaderData>
</soapenv:Header>
<soapenv:Body>
<tsws:SearchRequest>
<tsws:SearchRequestData>
<tsx:StartDt>30-Dec-2020</tsx:StartDt>
<tsx:EndDt>31-Dec-2020</tsx:EndDt>
<tsx:AvailOnly>0</tsx:AvailOnly>
<tsx:ServiceSearchCriteria>
<tsx:ServiceIDs>1123</tsx:ServiceIDs>
<tsx:AdditionalSearchFilter>0</tsx:AdditionalSearchFilter>
</tsx:ServiceSearchCriteria>
<PriceCriteria xmlns="http://schemas.datacontract.org/1/testapi.Data">
<PriceReq>1</PriceReq>
<Currency>SYNCHRONOUS</Currency>
<DispAdltChldPrices>1</DispAdltChldPrices>
</PriceCriteria>
<tsx:SearchType>
<tsx:PaxSearch>
<tsx:ServiceOptions>
<tsx:ServiceOption>
<RmNum>1</RmNum>
<tsx:OccID>2</tsx:OccID>
<tsx:OptionID>1225</tsx:OptionID>
<tsx:NoOfAdults>2</tsx:NoOfAdults>
<tsx:NoOfChildren>0</tsx:NoOfChildren>
</tsx:ServiceOption>
</tsx:ServiceOptions>
</tsx:PaxSearch>
</tsx:SearchType>
<tsx:TempSearchIndicator>0</tsx:TempSearchIndicator>
</tsws:SearchRequestData>
</tsws:SearchRequest>
</soapenv:Body>
</soapenv:Envelope>
|
And the following header data:
Code: |
POST http://server1/TSWebService/TSWSSearchAccomodation.svc HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://test.com//TSWS/ISearchService/SearchService"
Content-Length: 1487
Host: server1
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
|
But I'm having real trouble formatting the request and header data in HM (version 10.14). Whatever I try I just get an HTTP/1.1 400 Bad Request error when I click "Test". I'm using HM via an RCC connection to our HM server.
Any help much appreciated, thanks all. |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Mon Oct 03, 2016 8:30 am Post subject: |
|
|
May we see your test settings?
You may export test settings into text file using menu File -> Export to Text file. |
|
Back to top |
|
|
cgrieves
Joined: 27 Jan 2010 Posts: 7
|
Posted: Mon Oct 03, 2016 9:18 am Post subject: |
|
|
Sure! Thanks for the reply.
Code: | ;-----------------------------------------------------------------------------
;- HostMonitor`s export/import file -
;- Generated by RCC 5.14 at 03/10/2016 16:16:58 -
;- Source file: D:\testlist.hml -
;- Generation mode: Selected_Tests -
;-----------------------------------------------------------------------------
; ------- Test #01 -------
Method = SOAP
;--- Common properties ---
;DestFolder = TSWS\
Title = SOAP tsws:SearchRequest
Comment = SOAP http://server1/TSWebService/TSWSSearchAccomodation.svc
RelatedURL =
NamePattern = SOAP %object%
CmntPattern = SOAP %path%
ScheduleMode= Regular
Schedule =
Interval = 60
Alerts =
Alerts2 =
ReverseAlert= No
UnknownIsBad= Yes
WarningIsBad= Yes
UseCommonLog= Yes
PrivLogMode = Default
CommLogMode = Default
;--- Test specific properties ---
URL = http://server1/TSWebService/TSWSSearchAccomodation.svc
UrlUseMacros= No
Timeout = 1000
SoapVersion = 1.1
PostData = <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tsws="http://test.com//TSWS" xmlns:tsx="http://schemas.datacontract.org/1/testAPI.Data"> ^M <soapenv:Header> ^M <tsws:HeaderData> ^M <tsx:Security> ^M <tsx:LicenceKey>1234567990</tsx:LicenceKey> ^M </tsx:Security> ^M </tsws:HeaderData> ^M </soapenv:Header> ^M <soapenv:Body> ^M <tsws:SearchRequest> ^M <tsws:SearchRequestData> ^M <tsx:StartDt>30-Dec-2020</tsx:StartDt> ^M <tsx:EndDt>31-Dec-2020</tsx:EndDt> ^M <tsx:AvailOnly>0</tsx:AvailOnly> ^M <tsx:ServiceSearchCriteria> ^M <tsx:ServiceIDs>1123</tsx:ServiceIDs> ^M <tsx:AdditionalSearchFilter>0</tsx:AdditionalSearchFilter> ^M </tsx:ServiceSearchCriteria> ^M <PriceCriteria xmlns="http://schemas.datacontract.org/1/testapi.Data"> ^M <PriceReq>1</PriceReq> ^M <Currency>SYNCHRONOUS</Currency> ^M <DispAdltChldPrices>1</DispAdltChldPrices> ^M </PriceCriteria> ^M <tsx:SearchType> ^M <tsx:PaxSearch> ^M <tsx:ServiceOptions> ^M <tsx:ServiceOption> ^M <RmNum>1</RmNum> ^M <tsx:OccID>2</tsx:OccID> ^M <tsx:OptionID>1225</tsx:OptionID> ^M <tsx:NoOfAdults>2</tsx:NoOfAdults> ^M <tsx:NoOfChildren>0</tsx:NoOfChildren> ^M </tsx:ServiceOption> ^M </tsx:ServiceOptions> ^M </tsx:PaxSearch> ^M </tsx:SearchType> ^M <tsx:TempSearchIndicator>0</tsx:TempSearchIndicator> ^M </tsws:SearchRequestData> ^M </tsws:SearchRequest> ^M </soapenv:Body> ^M</soapenv:Envelope>
OptHeaders = POST http://server1/TSWebService/TSWSSearchAccomodation.svc HTTP/1.1 ^MAccept-Encoding: gzip,deflate ^MContent-Type: text/xml;charset=UTF-8 ^MSOAPAction: "http://test.com//TSWS/ISearchService/SearchService" ^MContent-Length: 1487 ^MHost: server1
IgnoreUnknCA= No
CheckContents = contain
Expression = ZZZ
CaseSensitive = No
WholeWordsOnly= No
ExprUseMacros = No
;-----------------------------------------------------------------------------
; Exported 1 items
|
I've replaced the server name, schemas and some of the data elements for security. |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Mon Oct 03, 2016 10:51 am Post subject: |
|
|
Could you try leaving only SOAPAction header:
SOAPAction: "http://test.com//TSWS/ISearchService/SearchService"
Also, please check if it is correct (e.g. replace double slach with sibgle one after test.com) |
|
Back to top |
|
|
cgrieves
Joined: 27 Jan 2010 Posts: 7
|
Posted: Tue Oct 04, 2016 11:04 am Post subject: |
|
|
Marvellous- that worked (can't believe I didn't try it!)
Thanks for the support! |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Thu Oct 06, 2016 7:45 am Post subject: |
|
|
You are welcome! |
|
Back to top |
|
|
|