T
Taras Overchuk
Hi!
I need to access web service form ASP.NET application with credentials of connected user (Integrated Windows Authenticated)
I think I have to do next steps:
1) Create proxy class for web secvice. (I did it with "Add web reference" dialog box. Visual studio created for me some class (MyProxy) derived from "System.Web.Services.Protocols.SoapHttpClientProtocol" class)
2) In place where I need to call web method I have to write somthing like this:
/*ms-help://MS.VSCC.2003/MS.MSDNQTR.2003JUL.1033/dnnetsec/html/SecNetch11.htm)*/
MyProxy my_proxy = new MyProxy();
IDictionary channelProperties;
channelProperties = ChannelServices.GetChannelSinkProperties(my_proxy);
channelProperties ["credentials"] = CredentialCache.DefaultCredentials;
my_proxy.GetSomeData();
In this code an exception is generated with message "Object reference not set to an instance of an object".
What am I doing wrong?
(Maybe it's important: I do it from WebPart for SharePoint)
I need to access web service form ASP.NET application with credentials of connected user (Integrated Windows Authenticated)
I think I have to do next steps:
1) Create proxy class for web secvice. (I did it with "Add web reference" dialog box. Visual studio created for me some class (MyProxy) derived from "System.Web.Services.Protocols.SoapHttpClientProtocol" class)
2) In place where I need to call web method I have to write somthing like this:
/*ms-help://MS.VSCC.2003/MS.MSDNQTR.2003JUL.1033/dnnetsec/html/SecNetch11.htm)*/
MyProxy my_proxy = new MyProxy();
IDictionary channelProperties;
channelProperties = ChannelServices.GetChannelSinkProperties(my_proxy);
channelProperties ["credentials"] = CredentialCache.DefaultCredentials;
my_proxy.GetSomeData();
In this code an exception is generated with message "Object reference not set to an instance of an object".
What am I doing wrong?
(Maybe it's important: I do it from WebPart for SharePoint)