I am on really sturbie ground here, this is my first time I have worked with ASMX WebServices, so I am doing a trial and error on this, so please bare with me on this.
I have been able to connect and do a login to the service using below ASP Classic, but have now "hit a wall" which I have not been able to find a solution for neigther here or by googling, propably because I am a noob on this and does not know what to look after.
When I call the below script, I get the following error:
Procedure or function 'stp_ws_GetWebServiceSessionBySessionID' expects parameter '@WebServiceSessionID', which was not supplied
The script I have so far:
Set oXmlHTTP = CreateObject("Microsoft.XMLHTTP")
oXmlHTTP.Open "POST", "https://api.domain.com/services/ws3.asmx", False
oXmlHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
oXmlHTTP.setRequestHeader "SOAPAction", "http://sub.domain.com/GetCurrentCallStats4"
SOAPRequest = _
"<?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>" &_
"<Login xmlns=""http://sub.domain.com/Login"">" &_
"<UserIdentifier>a81aeXX-XXXXXXXXXXX-XXX4bec7</UserIdentifier>" &_
"<PrivateKey>71e3aXX-XXXXXXXXXXX-XXX9e2</PrivateKey>" &_
"<PublicKey>XD87XX-XXXXXXXXXXX-XXXC45</PublicKey>" &_
"</Login>" &_
"<GetCurrentCallStats4Response xmlns=""https://api.domain.com/services/ws3.asmx"">" &_
"<GetCurrentCallStats4Result>" &_
"<StatResult4>" &_
"<CustomerID>int</CustomerID>" &_
"<SiteID>int</SiteID>" &_
"<BrandID>int</BrandID>" &_
"<CategoryID>int</CategoryID>" &_
"<Category>string</Category>" &_
"<TotalCases>int</TotalCases>" &_
"<NewSince>dateTime</NewSince>" &_
"<CasesNewSince>int</CasesNewSince>" &_
"<CasesDue>int</CasesDue>" &_
"</StatResult4>" &_
"</GetCurrentCallStats4Result>" &_
"</GetCurrentCallStats4Response>" &_
"</soap12:Body>" &_
"</soap12:Envelope>"
oXmlHTTP.send SOAPRequest
Response.Write oXmlHTTP.responseText
How can I "catch" the @WebServiceSessionID and send it to the WS again?
*If one also could help me on the next step on how I can catch the data response from the service I would be really thankfully :-)
UPDATE! The little documentation they provided
The for each web service key, you must repeat the following steps to collect the category level statistic information:
Using the web service at https://api.domain.com/services/ws3.asmx:
- Call
Login()
, and save the returned session identifier- Call
GetSite()
, using the session identifier and the private key – save the Name value- Call
GetCurrentCallStats3()
– this will return a list / array of the categories with the different monitor values for each.
- NewCasesSince – we use the start of the current day, older values use more resources and can result in the call being terminated for excessive use of resources. The format of the dates is either YYYY-MM-DD HH:mm e.g. 2017-09-30 00:00 You can select it to a more recent date/time – e.g. 1 hour ago to show a new cases in the last hour.
- HoursUntilDue – this controls the value returned in the result CasesDueInXMinutes Our monitor sets this value to 4 - count of cases due in the next 4 hours.
- Call
Logout()