This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CXF supports wsdl 2.0?

 
Nira Amit
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i'm trying to use wsdl2java by typing:
C:\dev\apache-cxf-2.2.3\bin>wsdl2java -wv 2.0 -p my.pkg -client -d src C:/my/service.wsdl
and all i get is

WSDLToJava Error: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

i did manage to generate code from this wsdl using axis2, but i want to use cxf because it lets you use xjc plugins (by passing parameters directly to the xjc).

any ideas? i've been googling for ages...
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this was my problem I would look at the full exception dump for the line in the CXF code where it hit the empty array causing this error.

Hopefully learning the identity of the array will help you figure out what is missing in your WSDL document.

Getting the source is a bit of a pain but this directory listing shows it.

Bill
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
You should be able to validate the WSDL document in Eclipse, NetBeans or an XML editor like Oxygene and, if no XML-related issues exist, it should pass validation. This will at least exclude errors in the format of the WSDL.
Best wishes!
 
Nira Amit
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys, thanks for answering.
the wsdl has no errors, so i checked the latest code distribution (apache-cxf-2.2.3-src) as you suggested and here's what i found:
the problem is with a list called "serviceList" that is being filled in WSDLToJavaContainer by the following code:

List<ServiceInfo> serviceList = (List<ServiceInfo>)context.get(ToolConstants.SERVICE_LIST);
if (serviceList == null) {
serviceList = new ArrayList<ServiceInfo>();

// Build the ServiceModel from the WSDLModel
if (version == WSDLConstants.WSDLVersion.WSDL11) {
@SuppressWarnings("unchecked")
AbstractWSDLBuilder<Definition> builder = (AbstractWSDLBuilder<Definition>)frontend
.getWSDLBuilder();
builder.setContext(context);

// yada-yada-yada... doing more stuff...

} else {
// TODO: wsdl2.0 support
}
}

so basically, support for wsdl 2.0 is not implemented
but looking at the bug repository of the CXF project you see stuff like: https://issues.apache.org/jira/browse/CXF-48?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
which leads innocent people like me to believe that wsdl2.0 is supported...

anybody knows of a wsdl2java tool that supports wsdl2.0 AND lets you pass parameters to xjc?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I haven't tried myself, but the Axis2 webpage here claims WSDL 2.0 support: http://ws.apache.org/axis2/
Don't know if it also allows you to pass parameters to XJC...
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic