Creating multiple namespaces on proxy


N

nyathancha

Hi,
I am creating some SOAP web services in .net 2.0. The services (and
classes) on the server side live in different namespaces. I was
wondering if there was anyway to preserve the namespace seperation on
the client side (the wsdl proxy thats generated by the microsoft
wsdl.exe tool) and still have the object hierarchy.

For example on the server, I have a base "ServiceRequest" Object which
is under the MyApp.ServiceContracts namespace. This object is
inherited by two different objects which live under different
namespaces. For example a "CreateEmployeeServiceRequest" object which
is under "MyApp.EmployeeServices" and the
"CreateProjectServiceRequest" object which is under
"MyApp.ProjectServices"

I am exposing the services that use these objects through the same web
service, but the problem is that in the proxy the
"CreateEmployeeServiceRequest" and the "CreateProjectServiceRequest"
are under the same namespace (the webreference alias that i specify).

If I expose them through different webservices, they will be under
different namespace and each will inherit from the ServiceRequest
object that is in its namespace, so there is no inheritance
relationship between the two different request objects on the client
side.

So is there anyway to segregate different objects/webmethods into
different namespaces on the client side proxy while still maintaining
the object hierarchy? Does the SOAP specification allow for this?
 
Ad

Advertisements

J

John Saunders [MVP]

Hi,
I am creating some SOAP web services in .net 2.0. The services (and
classes) on the server side live in different namespaces. I was
wondering if there was anyway to preserve the namespace seperation on
the client side (the wsdl proxy thats generated by the microsoft
wsdl.exe tool) and still have the object hierarchy.

For example on the server, I have a base "ServiceRequest" Object which
is under the MyApp.ServiceContracts namespace. This object is
inherited by two different objects which live under different
namespaces. For example a "CreateEmployeeServiceRequest" object which
is under "MyApp.EmployeeServices" and the
"CreateProjectServiceRequest" object which is under
"MyApp.ProjectServices"

I am exposing the services that use these objects through the same web
service, but the problem is that in the proxy the
"CreateEmployeeServiceRequest" and the "CreateProjectServiceRequest"
are under the same namespace (the webreference alias that i specify).

If I expose them through different webservices, they will be under
different namespace and each will inherit from the ServiceRequest
object that is in its namespace, so there is no inheritance
relationship between the two different request objects on the client
side.

So is there anyway to segregate different objects/webmethods into
different namespaces on the client side proxy while still maintaining
the object hierarchy? Does the SOAP specification allow for this?

C# namespaces are one of many platform-specific things which do not travel
to the client through web services. Web Services are meant to be
platform-neutral, so it shouldn't be a surprise to find that they don't
support platform-specific things like namespaces (or constructors, or
indexers, etc.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top