> Hi,
>
[quoted text clipped - 21 lines]
> 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.

Signature
John Saunders [MVP]
Mani - 13 Apr 2007 04:56 GMT
> > Hi,
> >
[quoted text clipped - 40 lines]
> 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.
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.
John Saunders [MVP] - 13 Apr 2007 16:53 GMT
>> > Hi,
>> >
[quoted text clipped - 62 lines]
> with
> out adding as a parameter in the web-method.
No, there is no simple way to do this.
If these are just helper classes, then they should be in their own assembly,
which you could distribute to the clients. They could use these classes to
produce the values sent to the web service.

Signature
John Saunders [MVP]
Marc - 19 Apr 2007 21:30 GMT
Hello,
I have a similar situation where I would like to expose some additional
classes and have them passed / returned from a webservice method. For
example:
class requestType1
class responseType1
class requestType2
class responseType2
requestType1 would have different member fields than requestType2 and
similarly with the responseType1 and responseType2.
I would like to have a webservice method defined as:
public object MethodCall(object request)
{
object Reponse = null;
// Based on the type of the request parameter different methods would be
called
// returning the corresponding responseType for the requestType.
// ie if request is requestType2 then the result value of the method
called would
// be responseType2 and assigned to the Response variable and returned.
return Response;
}
I hope that this all makes sense.
Regards and thanks in advance,
Marc
arjun Arora - 20 Apr 2007 19:54 GMT
I am doing same, any solution so far?? Thanks
> Hello,
>
[quoted text clipped - 31 lines]
> Regards and thanks in advance,
> Marc