axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis Sosnoski (JIRA)" <>
Subject [jira] Commented: (AXIS2-2088) wsdl2java JiBX code generator and -Ebindingfile option unavailable in ant task
Date Sat, 21 Apr 2007 20:45:15 GMT


Dennis Sosnoski commented on AXIS2-2088:

Sorry, Jorge, my error in looking at your former binding.

There are two ways of working with JiBX in Axis2, wrapped and unwrapped. Wrapped is what you
get by default, and in looking at your WSDL it looks like that's what you're trying to use.
For wrapped handling you need to use concrete <mapping> definitions in your binding,
meaning they do not have abstract='true' and they *do* have a name='...' that matches the
element name used in the WSDL for a message part.

Unwrapped is the other alternative, which would normally be simpler. For that you use abstract
mappings with a type-name rather than a name, and you specify the '-uw' option to WSDL2Java.
However, your WSDL uses element references for all the string values being passed rather than
defining them inline, and for this to be used with unwrapped you'd need to actually define
a separate mapping for each of these elements. The default wrapped handling is actually simpler
in this case.

So take off the abstract='true' attributes on your binding, and change the type-name='...'
attributes to name='...' attributes. That should get you what you want.

For more details on the wrapped vs. unwrapped handling see
and the linked pages (especially the Unwrapped Example and Document/Literal Example pages).
For more on understanding JiBX bindings see the tutorial at
and especially the page on mappings at

> wsdl2java  JiBX code generator and -Ebindingfile option unavailable in ant task
> -------------------------------------------------------------------------------
>                 Key: AXIS2-2088
>                 URL:
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: codegen
>    Affects Versions: 1.1.1
>         Environment: Windows XP SP2, jre 1.5 update 10, and 1.7.0
>            Reporter: Jorge Fernández
>         Assigned To: Dennis Sosnoski
>         Attachments: binding.xml, build.xml, LoginServiceJiBX.wsdl, new_binding.xml,,
> First the little question:  is there any way for passing the -Ebindingfile in the ant
task of wsdl2java? because I didn't find it.
> The big one: I'm having a problem with wsdl2java code generation. I'm trying JiBX databinding
in wrapped mode. I've got my objects defined, my wsdl definition of the service and  I made
my binding definition manually. I also made an ant task, following the steps of the jibx tutorial.
I generated the binding definition with JiBX tools.
> This is the problem:
> When I use the ant task for compiling the binding definition with the build.xml, everything
seems to go alright. After that, I would have to type some code for running the service and
that's why I decided to use wsdl2java.  When I use wsdl2java for code generation I get this
> I use the command like this:
> wsdl2java -uri LoginServiceJiBX.wsdl -o src\ -p loginjibx -ss -sd -d jibx -g -sn LoginServiceJiBX
-pn LoginEndpointPort -ns2p http://login=login,,http://login/types=login.types,http:/
> /,http://schemas.xmls
> -ssi -Ebindingfile binding.xml
> This is the trace:
> Using AXIS2_HOME:   D:\Programas\PFC\axis2-1.1.1
> Using JAVA_HOME:    D:\Programas\Java\jdk1.5.0_09
> Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
> : java.lang.NullPointerException
>         at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener
>         at org.apache.axis2.wsdl.WSDL2Code.main(
>         at org.apache.axis2.wsdl.WSDL2Java.main(
> Caused by: java.lang.NullPointerException
>         at org.jibx.runtime.impl.StAXReaderWrapper.getNamespace(StAXReaderWrappe
>         at org.jibx.runtime.impl.UnmarshallingContext.getNamespaceUri(Unmarshall
>         at org.jibx.runtime.QName.deserialize(
>         at org.jibx.binding.model.MappingElement.setQualifiedTypeName(MappingEle
>         at org.jibx.binding.model.MappingElement.JiBX_binding_unmarshalAttr_5_0(
>         at org.jibx.binding.model.JiBX_bindingMappingElement_access.unmarshal()
>         at org.jibx.binding.model.BindingElement.JiBX_binding_unmarshal_3_0(Bind
>         at org.jibx.binding.model.JiBX_bindingBindingElement_access.unmarshal()
>         at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unmarshal
>         at org.jibx.binding.model.BindingElement.readBinding(
> :609)
>         at org.jibx.binding.model.BindingElement.readBinding(
> :625)
>         at org.apache.axis2.jibx.CodeGenerationUtility.engage(CodeGenerationUtil
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>         at java.lang.reflect.Method.invoke(
>         at org.apache.axis2.wsdl.codegen.extension.JiBXExtension.engage(JiBXExte
>         at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener
>         ... 2 more
> I made it also in unwrapped mode and there was no problem with that.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message