aspose file tools*
The moose likes Web Services and the fly likes CXF supports wsdl 2.0? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "CXF supports wsdl 2.0?" Watch "CXF supports wsdl 2.0?" New topic
Author

CXF supports wsdl 2.0?

Nira Amit
Greenhorn

Joined: Aug 27, 2009
Posts: 2
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

Joined: Mar 22, 2000
Posts: 12769
    
    5
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

Joined: Oct 04, 2006
Posts: 2198
    
    1
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

Joined: Aug 27, 2009
Posts: 2
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

Joined: Oct 04, 2006
Posts: 2198
    
    1
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
 
subject: CXF supports wsdl 2.0?