users@jax-ws.java.net

Re: Multiple WSDL imports with the same namespace?

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Mon, 28 Nov 2005 16:28:46 -0800

Hi Mike,

This looks like a bug. I just verified that it happens in the condition
when a wsdl document imports more than 1 document with the same
namespace, like your case below.

Having said that I must also say that wsimport can import documents with
the same namespace as long as in one wsdl document you have wsdl:imports
with unique namespace :-)

As a workaround can you try importing the wsdls such as:
messages_and_porttypes.wsdl imports portbinding_one.wsdl and
portbinding_one.wsdl imports portbinding_two.wsdl, not pretty but can
help you move along.

Please file a bug on java.net and we will try to fix it.

thanks,

-vivek.







Mike Feldmeier wrote:

> Hi,
>
>
>
> As near as I can tell from the specs and other posts, multiple WSDL
> imports are allowed (not disallowed), but the wsimport tool seems to
> be enforcing a single import per namespace rule:
>
>
>
> ...
>
> <!ENTITY MYSERVICE_NS ‘http://www.examples.com/myservice’>
>
> ...
>
>
>
> <definitions ...>
>
>
>
> <wsdl:import namespace=”&MYSERVICE_NS;”
> location=”&MYSERVICE_WSDLS;/messages_and_porttypes.wsdl”/>
>
> <wsdl:import namespace=”&MYSERVICE_NS;”
> location=”&MYSERVICE_WSDLS;/portbinding_one.wsdl”/>
>
> <wsdl:import namespace=”&MYSERVICE_NS;”
> location=”&MYSERVICE_WSDLS;/portbinding_two.wsdl”/>
>
>
>
> <service name=”MyService”>
>
> <port name=”PortOne” binding=”tns:PortOneBinding”>
>
> ...
>
> </port>
>
> <port name=”PortTwo” binding=”tns:PortTwoBinding>
>
> ...
>
> </port>
>
> </service>
>
>
>
> </definitions>
>
>
>
> yields:
>
>
>
> error: duplicate "import" entity: "http://www.example.com/myservice"
>
>
>
>
>
> Am I misinterpreting things, or is there a way around this, or is this
> an inherently bad thing that wsimport is protecting me from doing?
>
>
>
> Thanks,
>
> Mike
>
>
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.13.3/174 - Release Date: 11/17/2005
>

-- 
Vivek Pandey
Web Services Standards and Technologies
Sun Microsystems Inc.