jwo
June 4th, 2002, 07:29 AM
Hi,
In a C# .net test I've made two webservices with one webmethod each. The first one returns a set of random values which are used in a client web app. The values are returned as member var's of a class SupportClass that is the return type of the webmethod. The webmethod in the second one gets the SupportClass as input parameter and does some calculation. Both services have a reference to SupportClass. The client web app also has SupportClass as reference.
I tested the web app by calling the webmethod of the first web service. No problem so far, the webmethod fills all member vars randomly which can be displayed in the client app.
To use the webmethod of the second webservice I added a web reference and reference and implemented the code to call the method. Trying to compile the web app again I get the following warning(s): c:\inetpub\wwwroot\OraWebApp1\WebForm1.aspx.cs(30): 'SupportClass' is defined in multiple places; using definition from 'C:\Inetpub\wwwroot\OraWebApp1\bin\Service1.dll'
Running the client app (and ignoring the warnings) I noticed that the webmethod of the first service returns without giving any random member vars (debugger gives <has no runtime value>). I suspect the compiler is confused about the different definitions of SupportClass. Also when calling the second webmethod I get the run-time error 'invalid cast' although I pass the right (SupportClass) parameter type.
Anyone got a solution for this problem and still use a common class like SupportClass ?
In a C# .net test I've made two webservices with one webmethod each. The first one returns a set of random values which are used in a client web app. The values are returned as member var's of a class SupportClass that is the return type of the webmethod. The webmethod in the second one gets the SupportClass as input parameter and does some calculation. Both services have a reference to SupportClass. The client web app also has SupportClass as reference.
I tested the web app by calling the webmethod of the first web service. No problem so far, the webmethod fills all member vars randomly which can be displayed in the client app.
To use the webmethod of the second webservice I added a web reference and reference and implemented the code to call the method. Trying to compile the web app again I get the following warning(s): c:\inetpub\wwwroot\OraWebApp1\WebForm1.aspx.cs(30): 'SupportClass' is defined in multiple places; using definition from 'C:\Inetpub\wwwroot\OraWebApp1\bin\Service1.dll'
Running the client app (and ignoring the warnings) I noticed that the webmethod of the first service returns without giving any random member vars (debugger gives <has no runtime value>). I suspect the compiler is confused about the different definitions of SupportClass. Also when calling the second webmethod I get the run-time error 'invalid cast' although I pass the right (SupportClass) parameter type.
Anyone got a solution for this problem and still use a common class like SupportClass ?