I am working on integration with an ASP.NET WebService provider. We are working on an architecture that does not make it easy to use SOAP resources. However, our provider supports HTTP POST and HTTP GET (using the / x -www-form-encoded query strings). The problem we are facing is authentication.
The WebService in question through SOAP requires a SoapHeader with a ClientCredentials node containing username and password nodes. We assume that they use soap authentication. How can we use this WebService without resorting to SOAP?
Example SOAP request (for each WSDL):
POST /webservices/service1.asmx HTTP / 1.1
Host: localhost
Content-Type: application / soap + xml; charset = utf-8
Content-Length: length
<? xml version = "1.0" encoding = "utf-8"?>
<soap: Envelope xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: xsd = "http://www.w3.org/2001/XMLSchema" xmlns: soapenc = "http : //schemas.xmlsoap.org/soap/encoding/ "xmlns: tns =" https: // localhost "xmlns: types =" https: // localhost / encodedTypes "xmlns: soap =" http: //schemas.xmlsoap .org / soap / envelope / ">
<soap: Header>
<types: ClientCredentials>
<username xsi: type = "xsd: string"> string </username>
<password xsi: type = "xsd: string"> string </password>
</ types: ClientCredentials>
</ soap: Header>
<soap: Body soap: encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/">
<tns: Method>
<parameter xsi: type = "xsd: string"> string </parameter>
</ tns: Method>
</ soap: Body>
</ soap: Envelope>
Similarly, .ASMX describes the availability of using HTTP GET or HTTP POST, as shown below:
POST /webservices/service1.asmx/Method HTTP / 1.1
Host: localhost
Content-Type: application / x-www-form-urlencoded
Content-Length: length
parameter = string
Please note that the above information is not described.
We tried things like:
username = user & password = pass & parameter = string
ClientCredentials = <username> user </username> <password> pass </password> & parameter = string
as well as various HTTP authentication options. Nothing works, and the support we get makes no sense - they literally cannot tell us how their web service works.
- ?