Adding Authentication in C# client for gSOAP C++ webservices........
-
Hi CP gurus, I have a gSoap Web Service written using C++, it uses SOAP username and password authentication. I also have a C# client consuming the web service, all this was working fine until I added the authentication on the server, now I can not get the client to authenticate web service methods. Can someone tell me how to add authentication info to the SOAP message posted from the C# SOAP client. It may look something like this... <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://localhost:80/Service.wsdl" xmlns:ns2="http://tempuri.org/ns1.xsd">SOAP-ENV:Bodyns2:getBatteryLevel</ns2:getBatteryLevel></SOAP-ENV:Body></SOAP-ENV:Envelope>POST / HTTP/1.1 Host: localhost:8080 User-Agent: gSOAP/2.7 Content-Type: text/xml; charset=utf-8 Content-Length: 489 Connection: close Authorization: Basic dXNlcjpwYXNz SOAPAction: "" <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://localhost:8080/Service.wsdl" xmlns:ns2="http://tempuri.org/ns1.xsd">SOAP-ENV:Bodyns2:GetDBOldestPendingRow<iMaxRows>100</iMaxRows></ns2:GetDBOldestPendingRow></SOAP-ENV:Body></SOAP-ENV:Envelope> No how to add the blocked Authentication line in the SOAP message.....??? Searched Google... but no clue is left.... Thank in advance for your help.....
Have a Happy Coding.....