Well after a few days intense investigation I have managed to get the XML API working with classic ASP.
We have managed to do the following
use the referral program (have made a referral program), to also set up records within my secondry control panel account details)
i am working on a second control panel, to manage a mass mail manager, Archive manager (passworded), and referral program
i also have a WWF forum running under the same thing.
i have made the XML collection/request into a function if anyone would like to use it. i have 2 verbles within the Function
Envelope and Service
Envelope is teh soap request
Service is used to look at the right .jws
Below is the function
Function GetSoapReturn(strEnvelope, strService)
Dim objHTTP
Dim strReturn
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
strSendingEnvelope = " <soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""> " & _
"<soap:Header > </soap:Header> " & _
" <soap:Body>" & _
"" & strEnvelope & "" & _
"</soap:Body>" & _
"</soap:Envelope>"
'Set up to post to our local server
objHTTP.open "post", "https://cp.your cp url.com:443/psoft/servlet/" & strService &".jws", False
'Set a standard SOAP/ XML header for the content-type
objHTTP.setRequestHeader "Content-Type", "text/xml"
'Set a header for the method to be called
objHTTP.setRequestHeader "SOAPAction", "urn:" & strService &""
'Make the SOAP call
objHTTP.send strSendingEnvelope
'Get the return envelope
strReturn = objHTTP.responseText
set objHTTP = Nothing
GetSoapReturn = strReturn
End Function
here is a copy of one envelope that gets the contact details for the clients account
' get contact info for the user
strContactEnvelope = _
" <ns1:getContactInfo xmlns:ns1=""UserServices"">" & _
" <at href=""#id0""/>" & _
" </ns1:getContactInfo>" & _
" <multiRef id=""id0"" soap:root=""0"" xsi:type=""ns2:AuthToken"" xmlns:ns2=""urn:UserServices"">" & _
" <accountId xsi:type=""xsd:int"">0</accountId>" & _
" <login xsi:type=""xsd:string"">reseller username</login>" & _
" <password xsi:type=""xsd:string"">reseller password</password>" & _
"<role href=""#id1""/>" & _
"</multiRef>" & _
"<multiRef id=""id1"" soap:root=""0"" soap:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/"" xsi:type=""ns3:Role"" xmlns:ns3=""urn:UserServices"" xmlns:soap=""http://schemas.xmlsoap.org/soap/encoding/"">" & _
"<accountId xsi:type=""xsd:int"">0</accountId>" & _
"<login xsi:type=""xsd:string"">clients account username</login>" & _
"</multiRef>"
strContactService = "UserServices"
you are able to do it without the reseller part
this page shows the envel;opes
http://www.psoft.net/HSdocumentation/devel/hs_xml_api_ref.html
any questions ill try and reply the best i can, but i think i have it understood
Acknolegments to Scotty_32
he helped with some code snippets that got me onto the correct path and some VB converstions
We have managed to do the following
- Change a users password
- Use the role parameter (admin account running under clients account)
- Get contact information
- Credit an account
- Check /authenticate a user
- Use under HTTP and HTTPS
use the referral program (have made a referral program), to also set up records within my secondry control panel account details)
i am working on a second control panel, to manage a mass mail manager, Archive manager (passworded), and referral program
i also have a WWF forum running under the same thing.
i have made the XML collection/request into a function if anyone would like to use it. i have 2 verbles within the Function
Envelope and Service
Envelope is teh soap request
Service is used to look at the right .jws
Below is the function
Function GetSoapReturn(strEnvelope, strService)
Dim objHTTP
Dim strReturn
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
strSendingEnvelope = " <soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""> " & _
"<soap:Header > </soap:Header> " & _
" <soap:Body>" & _
"" & strEnvelope & "" & _
"</soap:Body>" & _
"</soap:Envelope>"
'Set up to post to our local server
objHTTP.open "post", "https://cp.your cp url.com:443/psoft/servlet/" & strService &".jws", False
'Set a standard SOAP/ XML header for the content-type
objHTTP.setRequestHeader "Content-Type", "text/xml"
'Set a header for the method to be called
objHTTP.setRequestHeader "SOAPAction", "urn:" & strService &""
'Make the SOAP call
objHTTP.send strSendingEnvelope
'Get the return envelope
strReturn = objHTTP.responseText
set objHTTP = Nothing
GetSoapReturn = strReturn
End Function
here is a copy of one envelope that gets the contact details for the clients account
' get contact info for the user
strContactEnvelope = _
" <ns1:getContactInfo xmlns:ns1=""UserServices"">" & _
" <at href=""#id0""/>" & _
" </ns1:getContactInfo>" & _
" <multiRef id=""id0"" soap:root=""0"" xsi:type=""ns2:AuthToken"" xmlns:ns2=""urn:UserServices"">" & _
" <accountId xsi:type=""xsd:int"">0</accountId>" & _
" <login xsi:type=""xsd:string"">reseller username</login>" & _
" <password xsi:type=""xsd:string"">reseller password</password>" & _
"<role href=""#id1""/>" & _
"</multiRef>" & _
"<multiRef id=""id1"" soap:root=""0"" soap:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/"" xsi:type=""ns3:Role"" xmlns:ns3=""urn:UserServices"" xmlns:soap=""http://schemas.xmlsoap.org/soap/encoding/"">" & _
"<accountId xsi:type=""xsd:int"">0</accountId>" & _
"<login xsi:type=""xsd:string"">clients account username</login>" & _
"</multiRef>"
strContactService = "UserServices"
you are able to do it without the reseller part
this page shows the envel;opes
http://www.psoft.net/HSdocumentation/devel/hs_xml_api_ref.html
any questions ill try and reply the best i can, but i think i have it understood
Acknolegments to Scotty_32
he helped with some code snippets that got me onto the correct path and some VB converstions