You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by nmt999 <nm...@yahoo.com> on 2009/03/26 19:04:06 UTC

wsdl2java error when change version from 2.1.3 to 2.2

Hi

The command 
wsdl2java -p com.test.appl.service -d build -exsh true -verbose -b
ServiceBinding.xml TheService.wsdl
works with wsdl2java - Apache CXF 2.1.3 but gives the error below when used
with

     [java] wsdl2java - Apache CXF 2.2
     [java] WSDLToJava Error: -p option cannot be used when wsdl contains
mutiple schemas
     [java] org.apache.cxf.tools.common.ToolException: -p option cannot be
used when wsdl contains mutiple schemas
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:175)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:238)
     [java]     at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
     [java]     at
org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)

Nothing else changed only the cxf jars have changed to use the newer
version.

nmt
-- 
View this message in context: http://www.nabble.com/wsdl2java-error-when-change-version-from-2.1.3-to-2.2-tp22727714p22727714.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: wsdl2java error when change version from 2.1.3 to 2.2

Posted by Daniel Kulp <dk...@apache.org>.
On Thu March 26 2009 2:29:11 pm nmt999 wrote:
> There are multiple wsdl files provided by yahoo. The reason -p option is
> used is to create a package for each of the service. If the -p option is
> not use the ws2dltojava keeps overwriting the ObjectFactory.java.  Could
> you suggest me the solution for this

The -p still works, but you have to be more specific.   For example, your wsdl 
has two schemas.   Thus, you need to map them individually:

/wsdl2java -p http://schemas.xmlsoap.org/ws/2002/07/secext=com.foo -p 
http://marketing.ews.yahooapis.com/V5=com.blah ~/tmp/AccountService.wsdl

Your wsdl exactly shows the problem.   The generated ObjectFactory COULD be 
from the "secext" namespace or it COULD be from the V5 namespace.   Just 
depends on which JAXB feels like generating last.   That's where the randomly 
fails stuff comes in.   Making sure they go to separate packages makes sure 
they work correctly.

Dan



>
> nmt
>
> dkulp wrote:
> > I believe 2.1.4 would show the same error.
> >
> > Basically, the -p option is NOT safe to use if there are multiple
> > schemas. Previously, we didn't catch that and the generated code would
> > "randomly work"
> > and "randomly not work" which is not good.   It's basically a JAXB issue.
> > JAXB needs each schema to get generated into it's own package so that it
> > can
> > have a package-info.java and ObjectFactory.java per schema.
> >
> > Dan
> >
> > On Thu March 26 2009 2:04:06 pm nmt999 wrote:
> >> Hi
> >>
> >> The command
> >> wsdl2java -p com.test.appl.service -d build -exsh true -verbose -b
> >> ServiceBinding.xml TheService.wsdl
> >> works with wsdl2java - Apache CXF 2.1.3 but gives the error below when
> >> used
> >> with
> >>
> >>      [java] wsdl2java - Apache CXF 2.2
> >>      [java] WSDLToJava Error: -p option cannot be used when wsdl
> >> contains mutiple schemas
> >>      [java] org.apache.cxf.tools.common.ToolException: -p option cannot
> >> be
> >> used when wsdl contains mutiple schemas
> >>      [java]     at
> >> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContai
> >>ner .java:175) [java]     at
> >> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContai
> >>ner .java:238) [java]     at
> >> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:
> >>83) [java]     at
> >> org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
> >>      [java]     at
> >> org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
> >>
> >> Nothing else changed only the cxf jars have changed to use the newer
> >> version.
> >>
> >> nmt
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: wsdl2java error when change version from 2.1.3 to 2.2

Posted by nmt999 <nm...@yahoo.com>.
There are multiple wsdl files provided by yahoo. The reason -p option is used
is to create a package for each of the service. If the -p option is not use
the ws2dltojava keeps overwriting the ObjectFactory.java.  Could you suggest
me the solution for this

nmt


dkulp wrote:
> 
> 
> 
> I believe 2.1.4 would show the same error.
> 
> Basically, the -p option is NOT safe to use if there are multiple schemas.   
> Previously, we didn't catch that and the generated code would "randomly
> work" 
> and "randomly not work" which is not good.   It's basically a JAXB issue.   
> JAXB needs each schema to get generated into it's own package so that it
> can 
> have a package-info.java and ObjectFactory.java per schema.  
> 
> Dan
> 
> 
> 
> On Thu March 26 2009 2:04:06 pm nmt999 wrote:
>> Hi
>>
>> The command
>> wsdl2java -p com.test.appl.service -d build -exsh true -verbose -b
>> ServiceBinding.xml TheService.wsdl
>> works with wsdl2java - Apache CXF 2.1.3 but gives the error below when
>> used
>> with
>>
>>      [java] wsdl2java - Apache CXF 2.2
>>      [java] WSDLToJava Error: -p option cannot be used when wsdl contains
>> mutiple schemas
>>      [java] org.apache.cxf.tools.common.ToolException: -p option cannot
>> be
>> used when wsdl contains mutiple schemas
>>      [java]     at
>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>>.java:175) [java]     at
>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>>.java:238) [java]     at
>> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>>      [java]     at
>> org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>>      [java]     at
>> org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
>>
>> Nothing else changed only the cxf jars have changed to use the newer
>> version.
>>
>> nmt
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/wsdl2java-error-when-change-version-from-2.1.3-to-2.2-tp22727714p22728206.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: wsdl2java error when change version from 2.1.3 to 2.2

Posted by Daniel Kulp <dk...@apache.org>.

I believe 2.1.4 would show the same error.

Basically, the -p option is NOT safe to use if there are multiple schemas.   
Previously, we didn't catch that and the generated code would "randomly work" 
and "randomly not work" which is not good.   It's basically a JAXB issue.   
JAXB needs each schema to get generated into it's own package so that it can 
have a package-info.java and ObjectFactory.java per schema.  

Dan



On Thu March 26 2009 2:04:06 pm nmt999 wrote:
> Hi
>
> The command
> wsdl2java -p com.test.appl.service -d build -exsh true -verbose -b
> ServiceBinding.xml TheService.wsdl
> works with wsdl2java - Apache CXF 2.1.3 but gives the error below when used
> with
>
>      [java] wsdl2java - Apache CXF 2.2
>      [java] WSDLToJava Error: -p option cannot be used when wsdl contains
> mutiple schemas
>      [java] org.apache.cxf.tools.common.ToolException: -p option cannot be
> used when wsdl contains mutiple schemas
>      [java]     at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>.java:175) [java]     at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>.java:238) [java]     at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
>      [java]     at
> org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
>      [java]     at
> org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
>
> Nothing else changed only the cxf jars have changed to use the newer
> version.
>
> nmt

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog