You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Gamble, Wesley (WG10)" <WG...@tmw.com> on 2007/09/11 21:53:55 UTC

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.asm
x?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
 
 

Re: Problem generating JiBX client for existing Web service

Posted by Linus Kamb <li...@iris.washington.edu>.
perhaps a better place to start is on the axis pages:

http://ws.apache.org/axis2/1_3/jibx/jibx-codegen-integration.html

there are versions for each release, I believe.

Linus Kamb wrote:
> 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:WG10@tmw.com]
>>     *Sent:* Tuesday, September 11, 2007 2:54 PM
>>     *To:* axis-user@ws.apache.org
>>     *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: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Problem generating JiBX client for existing Web service

Posted by Linus Kamb <li...@iris.washington.edu>.
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:WG10@tmw.com]
>     *Sent:* Tuesday, September 11, 2007 2:54 PM
>     *To:* axis-user@ws.apache.org
>     *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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Problem generating JiBX client for existing Web service

Posted by "Gamble, Wesley (WG10)" <WG...@tmw.com>.
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:WG10@tmw.com] 
	Sent: Tuesday, September 11, 2007 2:54 PM
	To: axis-user@ws.apache.org
	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.asm
x?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