Re: passing custom classes or stucture as arguments




Hi Joe,

Web services communicate using XML/SOAP. As soon as you reference the web
service on the client a proxy is generated, the proxy class handless the
work mapping parameters to XML elements and then sending the SOAP message
over the nerwork. Your web service and clients exchange messages, not
objects!

The WSDL tool is used to generate a proxy class. I advise you to not alter
these classes. Look at the generated classes as being Data Transfer Objects
(DTO, http://www.martinfowler.com/eaaCatalog/dataTransferObject.html) and
map these against your custom entity classes compiled in your shared
assembly. An alternative is to do Contract-First development (see
http://www.thinktecture.com/Resources/Software/WSContractFirst/default.html).

You have a bit of reading-up to do regarding web services... see
Considerations for Custom Web Service Client Proxy Classes here
http://msdn2.microsoft.com/en-us/library/ms181858.aspx


Best regards,
Paul Gielens

Visit my blog @ http://weblogs.asp.net/pgielens/
###

"Joe Abou Jaoude" <anonymous@xxxxxxxxxx> wrote in message
news:OQkQ5eY$FHA.356@xxxxxxxxxxxxxxxxxxxxxxx
>
>
> Is it possible to pass custom classes or stucture as arguments to a
> webservice method ?
>
> In remoting, I was able to do so by placing the custom class in a shared
> dll referenced by both the client and the server.
>
> I tried this in the web service.I created a shared dll.
> my web application has a reference to the dll, my web service has a
> reference to the same dll.But I can't call the webmethod. For the
> compiler they are two different classes and can't convert one type to
> another.
>
> what can I do abou it ?
> Regards
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
>



.



Relevant Pages