Wes,
You need to provide a jibx binding file that maps the xml to the java
objects.
See http://www.jibx.org for details.
my wsdl2java ant target looks like this:
<target name="w2j" depends="clean" >
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true"
failonerror="true">
<classpath>
<path refid="axis-classpath"/>
<path refid="jibx-classpath"/>
</classpath>
<arg value="-o"/>
<arg value="w2j"/>
<arg value="-p"/>
<arg value="${package-name}"/>
<arg value="-d"/>
<arg value="jibx"/>
<arg value="-Ebindingfile"/>
<arg value="${binding-file}"/>
<!-- -uw parameter says generate doc/lit unwrapped -->
<arg value="${unwrappedFlag}"/>
<!-- -ss parameter says generate server code -->
<arg value="-ss"/>
<!-- -sd parameter says generate server deployment files -->
<arg value="-sd"/>
<!-- -ssi parameter says generate Java interface definition. -->
<arg value="-ssi"/>
<arg value="-uri"/>
<arg value="${wsdl-path}"/>
</java>
</target>
Linus
Gamble, Wesley (WG10) wrote:
Generating for ADB databinding ("-d adb" in wsdl2java command) seems
to at least successfully generate the code, but wondering about the
JiBX issue if anyone knows.
Wes
------------------------------------------------------------------------
*From:* Gamble, Wesley (WG10) [mailto:[EMAIL PROTECTED]
*Sent:* Tuesday, September 11, 2007 2:54 PM
*To:* [email protected]
*Subject:* Problem generating JiBX client for existing Web service
All,
I am attempting to use wsdl2java to generate client stub code for
an existing Web service (WSDL:
https://api.channeladvisor.com/ChannelAdvisorAPI/v1/InventoryService.asmx?WSDL).
Notice the .asmx on the end of that URL - don't know if it
matters, just thought I would point it out :).
When I run the appropriate command, I see the following:
C:\axis2-1.3\bin>wsdl2java -uri
http://api.channeladvisor.com/ChannelAdvisorAPI/v1/InventoryService.asmx?WSDL
-p my.package.name -d jibx -s -uw
-o "C:\eclipse\workspace\B2C Amazon Interfaces - Axis2\src"
Using AXIS2_HOME: C:\axis2-1.3
Using JAVA_HOME: C:\Program Files\Java\jdk1.6.0_01
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException
: java.lang.RuntimeException: No mapping defined for element
{http://api.channeladvisor.com/webservices/}APICredentials
No mapping for APICredentials, huh?
Here is the type definition for APICredentials from the WSDL:
<s:element name="APICredentials" type="tns:APICredentials"/>
<s:complexType name="APICredentials">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DeveloperKey"
type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Password"
type="s:string"/>
</s:sequence>
<s:anyAttribute/>
</s:complexType>
Is there something else that I should have in my WSDL file? Is
this error specific to the type of databinding (JiBX) that I've
requested, etc.?
Thanks,
Wes
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]