tags:

views:

207

answers:

2

Say, I have a WebService SettingsWebService with a WebMethod AddUser(User userObject).
The User class is in the SettingsWebService solution.
When i generate a proxy for the SettingsWebService it creates a class for asmx which contains the AddUser webmethod.
It also generates a class for the User class.

The client now uses

Proxy.AddUser(Proxy.User user)

interface.

Is there any way to tell wsdl to not generate a class for the User class, so that the signature remains :

Proxy.AddUser(SettingsWebService.User user)

The Client will have a reference to the proxy and the SettingsWebSerice dlls.


Right now I am having to manually remove the code for the User partial class in the proxy and add a usings reference to the WebSettings dll.



Many thanks in advance!

A: 

You'll need to add a schemaInmporterExtensions element to your machine.config before generating the proxy. Make this point to the assembly which contains your SettingsWebservice.User class and a proxy will not be generated.

Gerrie Schenck
A: 

Why you need to do this? If it is a web service you don't need to distribute the SettingsWebService.dll with your code

Shamika
consider a scenario where i insert a user using the webservice , the webservice inserts it into the DB and then pushes a user object to a tib rv queue. the queue is read by another app which deserializes the string to the user object. The app which reads the queue does not need any of the proxy references.