Re: How to expose a class in the Webservice.
- From: Mani <Mani@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 12 Apr 2007 20:56:00 -0700
"John Saunders [MVP]" wrote:
Mani" <Mani@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0C221C25-4841-4E78-A254-3BB513183154@xxxxxxxxxxxxxxxx
Hi,
I have a webservice which uses a c# Dll,This Dll is a C# class library
which
contain few class[Class One, Class Two] .
I am able to see the class when in the Web service but when i create a
stubb
class of the webservice using wsdl.exe then these classes are not
exposed.Both the class are public.
I tried for a while and found that if I use these class(one and two) as
the
parameter in the WebMethods the web service and generate the Stubb class
then
these class are exposed.
For ex::
[WebMethod(EnableSession = true)]
public string GetClass(One one)
{
return ;
}
//Method1
This is one way but is there any other way of exposing the class without
exposing in the WebMethod?
What do you want to do with the class on the client if you don't want to
send it to the web service or receive it from the web service?
A web service isn't a class library. It is a way to perform particular
operations on particular kinds of data, expressed in XML and described in
XML.
Also, please be aware that even if your client referred to the same C# DLL
as the Web Service does, the two would not be able to communicate directly
using classes in the C# DLL. The client and server are very strongly
separated in the case of Web Services, and they only communicate via XML,
XML Schema and WSDL. One thing they cannot communicate is the identity of
classes. Therefore, class "ClassLibrary.Class1" on the client and class
"ClassLibrary.Class1" on the server, are two totally different and unrelated
classes.
I hope that's not too discouraging. Please provide more detail of what
you're trying to accomplish, and maybe we'll be of more help.
--
John Saunders [MVP]
The reson behind why i want to expose the classes with out using in the
Web-Method is ,there are few classes which perform some calucalation and
operation(For Ex:: Class Calculate) and it is been used in the class One and
Two and i dont want to add all these classes in the webmethod as the
parameter.
So when i generate a Stubb class using the Wsdl.exe the class Calculate is
not exposed as it is not been passed as parameter in the WebMethod.This is
just one small example of a class , I have few more classes like this which i
want to expose in the web-service client so that i perform few
operations(validating and calculating) before calling the webmethod.
How can i achive this ?.Is there any way through which i can say a
particlular class to be exposed in the Stubbed class(Webservice Class) with
out adding as a parameter in the web-method.
Regards
Mani.
.
- Follow-Ups:
- Re: How to expose a class in the Webservice.
- From: John Saunders [MVP]
- Re: How to expose a class in the Webservice.
- References:
- Re: How to expose a class in the Webservice.
- From: John Saunders [MVP]
- Re: How to expose a class in the Webservice.
- Prev by Date: Re: How to expose a class in the Webservice.
- Next by Date: Problem calling method when cookieless is set to true
- Previous by thread: Re: How to expose a class in the Webservice.
- Next by thread: Re: How to expose a class in the Webservice.
- Index(es):
Relevant Pages
|