Hi
everybody,
I'm using a Web Services that was not written by me. Anyway, when i call the
client proxy (stub) i receive the follow exception
An unhandled exception of type
'System.InvalidOperationException' occurred in system.web.services.dll
Additional information: Method Selection_Archive.ListEntitledSelection can not
be reflected.
I can't understand why
i have this exception. This is the client stub's code (automatically generated with wsdl.exe):
public SL ListUserSelection(string user, string pwd) {
object[] results =
this.Invoke("ListUserSelection", new object[] {user, pwd});
return ((SL)(results[0]));
}
Hope you can help me.
Cheers

Method can not be reflected
Lawrence Ricci
You have to post full exception information. incliding all inner exceptions.
Thanks,
Elena
George Papadopoulos
This is the exception's output.
I don't have so many skills about Web Services. I'd like to know if i can fix this problem without change the server side's code. I am implementing the client side and for this reason i am only able to modify the client side
cheers
EmilianoCapoccia
Hi,
I found your solution link in some forums but the your solution page is giving Error 404 - Not Found message. If you have a solution please share it to me.
your link is here http://vijaymodi.wordpress.com/2007/02/01/web-services-error-method-testdata-cannot-be-reflected/
Thanks for interesting.
Omer.
ocolakoglu@istikbal.com.tr
Riyaz
Id found a solution
In my web service, the return type is an object made by myself (Owner).
I made a dll with all the types and I made a reference to it in both Client Project and WebService project.
The problem was that the proxy makes their own Owner object - a very different tpye from the original Owner object.
So, I Only had to change the reference to the object in the Reference.cs (or reference.vb) file.
Like this:
-In the client, in the Solution Explorer, click in the view all files button.
-Click in the WebReference folder and expand the localhost icon
- Expand the somethingMap folder (Id forget the name
, sorry)
- Double click in the Reference.cs file
-Locate you web method and change the return type to the class object that you really expect (in my case, was change the ...Localhost.Owner type to ...Common.Entities.Owner type)
- And voila! it should compile!!!
check it and let me know if you still have the problem.
PS: (you should note that your return type must implement the IXMLSerializable interface and have a default constructor)
Regards
jluis
efarook
What is the full exception message including all inner exceptoins
Could you call ToString() on the exception
Thanks,
Elena
jmsp
This is the full exception message:
'DefaultDomain': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded.
'ingestion': Loaded 'C:\Documents and Settings\as1610\Documenti\Visual Studio Projects\Ingestion Adapter\projects\Ingestion Adapter\ingestion\bin\Debug\ingestion.exe', Symbols loaded.
'ingestion.exe': Loaded 'c:\documents and settings\as1610\documenti\visual studio projects\ingestion adapter\projects\ingestion adapter\ingestion\bin\debug\stub.dll', Symbols loaded.
'ingestion.exe': Loaded 'c:\windows\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll', No symbols loaded.
'ingestion.exe': Loaded 'c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No symbols loaded.
'ingestion.exe': Loaded 'c:\windows\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll', No symbols loaded.
'ingestion.exe': Loaded 'c:\windows\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll', No symbols loaded.
An unhandled exception of type 'System.InvalidOperationException' occurred in system.web.services.dll
Additional information: Method Selection_Archive.ListEntitledSelection can not be reflected.
The program '[2112] ingestion.exe' has exited with code 0 (0x0).
And i can't use toString() on the exception..
Pablomano
WebServices framework wraps all exceptions in InvalidOperationException, to see what is really went wrong, you need to see all InnerExceptions of the top-level InvalidOperationException.
It would be impossible to tell what is wrong without seeing them all.
Where do you see the exception
Can you have debugger attached to the asp.net process to see what is the inner exception is
Thanks,
Elena
LSF
Hi All,
I was facing the same problme. I have resolve my issue. You can find the solution on the following link.
http://vijaymodi.wordpress.com/2007/02/01/web-services-error-method-testdata-cannot-be-reflected/
Regards, Vijay Modi