Moderator |
|
Hallo,
Ik ben bezig om dmv SOAP gegevens van een webservice aan te roepen.
Ik wil de volgende code via SOAP naar een webservice geven:
POST test.asmx HTTP/1.1
Host: https://test.nl
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?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>
<GetDataCollection xmlns="urn:Test.Services">
<userId>blala</userId>
<password>test</password>
</GetDataCollection>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?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>
<GetDataCollectionResponse xmlns="urn:Test.Services">
<GetDataCollectionResult>string</GetDataCollectionResult>
</GetDataCollectionResponse>
</soap12:Body>
</soap12:Envelope>
POST test.asmx HTTP/1.1 Host: https://test.nl Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?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> <GetDataCollection xmlns="urn:Test.Services"> <userId>blala</userId> <password>test</password> </GetDataCollection> </soap12:Body> </soap12:Envelope> HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?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> <GetDataCollectionResponse xmlns="urn:Test.Services"> <GetDataCollectionResult>string</GetDataCollectionResult> </GetDataCollectionResponse> </soap12:Body> </soap12:Envelope>
Hoe kan ik deze via ASP via SOAP naar die webservice krijgen.
Ik heb de volgende code, maar weet niet of dit goed is.
url = "http://test.nl/test.asmx"
set objHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
Dim strEnvelope
set objReturn = Server.CreateObject("Microsoft.XMLDOM")
Dim dblTax
Dim strQuery
objHTTP.open "POST", url, False
objHTTP.setRequestHeader "Content-Type", "application/soap+xml"
objHTTP.setRequestHeader "SOAPMethodName", "Logon"
objHTTP.send strEnvelope
strReturn = objHTTP.responseText
response.write(strReturn)
url = "http://test.nl/test.asmx" set objHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP") Dim strEnvelope set objReturn = Server.CreateObject("Microsoft.XMLDOM") Dim dblTax Dim strQuery objHTTP.open "POST", url, False objHTTP.setRequestHeader "Content-Type", "application/soap+xml" objHTTP.setRequestHeader "SOAPMethodName", "Logon" objHTTP.send strEnvelope strReturn = objHTTP.responseText response.write(strReturn)
In strEnvelope heb ik de XML gezet.
Kan iemand helpen?
|