Re: Web Service method works on local machine but fails on remote
Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance
- From: "John Saunders" <john.saunders at trizetto.com>
- Date: Mon, 25 Sep 2006 15:43:29 -0400
"Abhi" <Abhi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:29F1899D-8318-4201-B390-699EAED95F77@xxxxxxxxxxxxxxxx
Hi All,
I have a web service method which works fine when called from my local
machine i.e. from localhost but when I publish the web services to a
remote
machine it throws an invalid cast soap exception.
That web service method access Active Directory to get the group names for
the given user. Following is the code.
DirectorySearcher dirSearcher = new DirectorySearcher();
dirSearcher.Filter = String.Format("(cn={0})",
strCommonName);
dirSearcher.PropertiesToLoad.Add("MemberOf");
SearchResult result = dirSearcher.FindOne();
string group = (string)result.Properties["memberOf"][0]
It's the last line where it throws an exception,
Unable to cast object of type 'System.Byte[]' to type 'System.String'.
So, why is it returning System.Byte[]? What's in that byte array?
I suspect that memberOf has a different meaning to your local machine than
it does to your server.
John
.
Relevant Pages
- Re: web service call locks up C# winforms application
... Any variables, database connections, files or any other resources that you are locking while this task is processing? ... My web service method is called "heartbeat" and all it does is let my server ... is there anything else related to WS calls that might freeze the ... (microsoft.public.dotnet.framework.webservices) - Re: calling a web service from a dll developed in C++
... device registry and implemented in DLLs or EXEs on the device. ... The dll returns the result of the web service called by a non dot net ... The point where i am calling the web service method in the code i.e. ... // Uninitialize proxy object. ... (microsoft.public.dotnet.framework.compactframework) - Re: calling a web service from a dll developed in C++
... device registry and implemented in DLLs or EXEs on the device. ... The dll returns the result of the web service called by a non dot net ... The point where i am calling the web service method in the code i.e. ... // Uninitialize proxy object. ... (microsoft.public.dotnet.framework.compactframework) - Re: calling a web service from a dll developed in C++
... no instrument no spam DOT com> wrote: ... The reason for using C++ is because, that this dll ... The dll returns the result of the web service called by a non dot net ... I assum that the web service method has not been called when this ... (microsoft.public.dotnet.framework.compactframework) - Re: calling a web service from a dll developed in C++
... no instrument no spam DOT com> wrote: ... The reason for using C++ is because, that this dll has ... The dll returns the result of the web service called by a non dot net ... I assum that the web service method has not been called when this ... (microsoft.public.dotnet.framework.compactframework) |
|