Calling a method on a webservice
- From: bjornms@xxxxxxxxx
- Date: 29 Mar 2007 02:19:48 -0700
Hi,
I have a question related to webservices on the Microsoft platform.
Context:
I have two projects. One is called LogService. The other is called
client. The LogService is a C# webservice developed on VS.NET 2005.
The client is a seperate project developed in VS.NET 2005 which uses
(in the project using a webreference) the webservice LogService.
Introduction:
I'm trying to call the method Log with an argument Window on a
webservice called LogService. This Window Class is defined under the
namespace House in the webservice project. So if i want to instantiate
a Window in the LogService, i do the following: "House.Window window =
new House.Window();".
If i want to call the Log method on the client project which has a web
reference to the LogService named LogService i do the following:
LogService.LogService logService = new LogService.LogService();
LogService.window window = new LogService.Window();
logService.Log(window);
But...:
My situation is different.
For some reason ( i'm not going to explain it here ), i do not use the
Window definition from LogService. Instead, on the client project i
also have a namespace House with a class Window, which is exactly
identical to that on the webservice LogService. To call the method Log
i do the following:
LogService.LogService logService = new LogService.LogService();
House.Window window = new House.Window();
logService.Log(window);
But... then i get some errors which i can not get rid of.
The errors i get:
1) The best overloaded method match for
'LogService.LogService.Log(LogService.Window)' has some invalid
arguments
2) Argument '1': cannot convert from House.Window to LogService.Window
And i also can't cast between the two classes.
My Question: Does somebody know how to fix those errors? Has it
something to do with Namespaces? I'm lost here.
.
- Follow-Ups:
- Re: Calling a method on a webservice
- From: John Saunders
- Re: Calling a method on a webservice
- Prev by Date: RE: Problem with invoking web method
- Next by Date: SoapHttpClientProtocol thread safety issue
- Previous by thread: RE: Can't see public method on object returned from web service
- Next by thread: Re: Calling a method on a webservice
- Index(es):
Relevant Pages
|