简体   繁体   中英

Generating java classes from wsdl using namespaces and multiple packages

I'm using the apache CFX wsdl2java tool to convert a wsdl into java classes. The general set-up works fine, but I'm having trouble with this command:

 -p [ wsdl-namespace= ] PackageName

The documentation says:

Specifies zero, or more, package names to use for the generated code. Optionally specifies the WSDL namespace to package name mapping.

However, it only works for a single package for me. The first command below works, the second and the third one doesn't. Did I mess up some syntax?

1) -p namespace1=com.name.webservices http://url-to-my-wsdl.com

2) -p namespace1=com.name.webservices com.name.common http://url-to-my-wsdl.com

3) -p namespace1=com.name.webservices namespaceforcommonobjects=com.name.common http://url-to-my-wsdl.com

In the second example, I'm trying to put everything from namespace1 into package webservices, and all the rest into package common.

In the third example I'm trying to put everything from namespace1 into package webservices, and everything from namespaceforcommonbojects into package common.

I keep getting an exception in my console saying: "Unexpacted argument" and then the url to my wsld, except in example 1, which works fine but does not hve the output I desire...).

You need to add -p switch before each namespace to package mapping.

-p namespace1=com.name.webservices -p namespaceforcommonobjects=com.name.common http://url-to-my-wsdl.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM