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

Having trouble formatting SOAP fot a HM request

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



Joined: 27 Jan 2010
Posts: 7

PostPosted: Mon Oct 03, 2016 7:19 am    Post subject: Having trouble formatting SOAP fot a HM request Reply with quote

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



Joined: 16 May 2006
Posts: 2832

PostPosted: Mon Oct 03, 2016 8:30 am    Post subject: Reply with quote

May we see your test settings?
You may export test settings into text file using menu File -> Export to Text file.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cgrieves



Joined: 27 Jan 2010
Posts: 7

PostPosted: Mon Oct 03, 2016 9:18 am    Post subject: Reply with quote

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



Joined: 16 May 2006
Posts: 2832

PostPosted: Mon Oct 03, 2016 10:51 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
cgrieves



Joined: 27 Jan 2010
Posts: 7

PostPosted: Tue Oct 04, 2016 11:04 am    Post subject: Reply with quote

Marvellous- that worked (can't believe I didn't try it!)

Thanks for the support!
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Thu Oct 06, 2016 7:45 am    Post subject: Reply with quote

You are welcome!
Back to top
View user's profile Send private message Send e-mail 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