I don't know of a way.
Is it a great hardship to modify the proxy?
Webservices is a message-based communication model, not a class-based one.
This is the root of the problem you are experiencing. Another option is to
design your webservice interface by starting with the message schema first,
rather than by starting with the class.
See here for more on that:
http://pluralsight.com/blogs/aaron/archive/2004/11/11/3432.aspx
-D
>I have a Entity class defined in a assembly. I then have a web service in
> the same solution, which takes an object of this class as a parameter. It
> expects me to give the fully qualified name of this parameter (complete
> namespace and class in the proxy), - so we have to go and change the proxy
> by hand, because it assumes that the class definition would belong to the
> web service. How can this be avoided ?
Thanks for your reply.
Well, modifying the proxy is alright , but every time the web reference is
refreshed in VS.NET, the proxy gets regenerated and the parameters have to
be re-qualified.
One workaround i MAY have found is to use the same namespace for the custom
class and the web service. It appears to be accepting the custom class
parameter now (touchwood).
>I don't know of a way.
>
[quoted text clipped - 17 lines]
>> by hand, because it assumes that the class definition would belong to the
>> web service. How can this be avoided ?
Mujtaba Syed - 13 Dec 2004 19:19 GMT
Hi Chak:
> Well, modifying the proxy is alright , but every time the web reference is
> refreshed in VS.NET, the proxy gets regenerated and the parameters have to
> be re-qualified.
The problem of proxy changes being overwritten everytime you refresh web
references is very real. The web services team has been working on this.
With .NET 2.0 they are introducing something called 'Schema Importer
Extentions' that offer greater control over proxy generation. You would
write a type which inherits from SchemaImporterExtension and then register
it with the web services infrastructure (eg. web.config).
Mujtaba.
> One workaround i MAY have found is to use the same namespace for the custom
> class and the web service. It appears to be accepting the custom class
> parameter now (touchwood).
Yes. This is guaranteed to work as during resolution the current namespace
is searched first.
> >I don't know of a way.
> >
[quoted text clipped - 22 lines]
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.809 / Virus Database: 551 - Release Date: 12/9/2004