Is it possible to merge all your wsdls into a same wsdl file? Or specify a same namespace for all of them?



Anand Natrajan wrote:

Hello!

As part of my .NET and Axis interoperability work, I am facing a piquant
situation. I have written multiple web services using Axis. Each of these
web services defines a particular complex data structure called Principal.
The definition, XML namespace and package name for this structure are
identical in each WSDL generated for my services. I have written Axis-based
Java clients and SOAP::Lite-based Perl clients that invoke operations from
multiple WSDLs within the same program. Call these clients "cross-WSDL
clients" - they work perfectly, especially when I have to pass the same
instance of Principal to different operations.

Now, I'd like to write cross-WSDL .NET clients. I am using Visual Studio
.NET, and using Visual Basic to write such a client. Here, I face a
namespace issue in the client. In order to invoke operations in a WSDL from
a VB client, I have to import the WSDL as a web reference. When I do so,
.NET gives the WSDL a name, somewhat similar to a package name in Java.
Different WSDLs get different names. However, because of this practice, I
end up with multiple definitions of Principal viz., WSDL1.Principal and
WSDL2.Principal. Now, I find I cannot use a single instance of Principal to
invoke operations from different WSDLs. VB's type-checking system forces me
to use WSDL1.Principal when invoking operations defined in WSDL1 and
WSDL2.Principal when invoking operations defined in WSDL2.

Recall, these multiple definitions are actually identical. Because of the
way .NET imports and names WSDLs, I am forced to create multiple instances
for the same principal and keep them consistent. How can I avoid doing so?

I have tried defining Principal in a common schema file and
importing/including it into each WSDL - that has no effect. Thinking through
it, I realise that it cannot have any effect because .NET will continue to
give different names to each WSDL, whether or not the WSDLs happen to import
other schema files. I also tried tinkering with the namespace of Principal,
to no avail.

I have tried adding the schema file as a web reference, but that fails
because .NET wants a WSDL, not an XSD file. Backing off from the schema
approach, I tried casting WSDL1.Principal into a WSDL2.Principal, but .NET
refused to sanction that. Is there anything else I can try? Has anyone
encountered this situation before?

Thank you for any help, and for even reading this. I will peruse this group
regularly for any response, but I'd also appreciate a copy sent to
[EMAIL PROTECTED]

Anand Natrajan





Reply via email to