A problem occurs in the program that uses C # To dynamically generate a Soap call:
My program can only call those WS that allow anonymous access and cannot access those WS that integrate Windows authentication.
I use MSSOAPLib30 to call Soap, and it supports the method of adding authentication, but I still don't understand how to use it? I tried n methods.
1 using MSSOAPLib30;
2
3
4 HttpConnector30Class connector = new HttpConnector30Class ();
5
6
7 connector. set_Property ("AuthUser", soapInfo. AuthUser );
8 connector. set_Property ("AuthPassword", soapInfo. AuthPassword );
9 connector. set_Property ("ConnectTimeout", soapInfo. ConnectTimeOut );
10 connector. set_Property ("WinHTTPAuthScheme", 0x01 | 0x02 | 0x08 | 0x10 );
11 connector. set_Property ("EndPointURL", soapInfo. WSDL. ToLower (). Replace ("? Wsdl ",""));
12 connector. set_Property ("Timeout", soapInfo. RequestTimeOut );
13
14 connector. Connect ();
15 connector. ConnectWSDL (soapPort );
16 connector. BeginMessageWSDL (operation );
17
18
I changed n methods for the definition in row 10th, but it still doesn't work!
The example in the SDK is 1 Dim Connector As ISoapConnector.
2 Set Connector = New HttpConnector30
3 Connector. Property ("EndPointURL") = "some URL"
4 Connector. Property ("SoapAction") = "a SOAP Action"
Description of the WinHTTPAuthScheme attribute Enables you to choose acceptable an authentication mechanism. it applies only to clients running on Windows XP, Windows 2000 or Windows NT 4.0. these are the accetable values. you can combine these values (bitwise OR ).
0x1-basic authentication
0x2-ntlm auth
0x8-digest auth
0x10-negotiate auth
The default value for this property is 0x12 (ntlm and negotiate ).
How should I configure this attribute?