Problems with wsdl2java JiBX codegenerator
-------------------------------------------
Key: AXIS2-2088
URL: https://issues.apache.org/jira/browse/AXIS2-2088
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
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 attached all the
files). I also made an ant task, following the steps of the jibx tutorial.
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 error:
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
: java.lang.RuntimeException: No mapping defined for element {http://login/types
}WebLoginElement
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener
ationEngine.java:224)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
Caused by: java.lang.RuntimeException: No mapping defined for element {http://lo
gin/types}WebLoginElement
at org.apache.axis2.jibx.CodeGenerationUtility.mapQName(CodeGenerationUt
ility.java:928)
at org.apache.axis2.jibx.CodeGenerationUtility.mapMessage(CodeGeneration
Utility.java:914)
at org.apache.axis2.jibx.CodeGenerationUtility.engage(CodeGenerationUtil
ity.java:384)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.axis2.wsdl.codegen.extension.JiBXExtension.engage(JiBXExte
nsion.java:74)
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener
ationEngine.java:177)
... 2 more
... 2 more
I use the command like this:
wsdl2java -uri LoginServiceJiBX.wsdl -o build -ss -sd -g -d jibx -ssi
-Ebindingfile binding.xml -ns2p
http://login=login,http://login/types=login.types
I tried it in many ways, defining all the mappings between namespaces and
packages and without them... I think the problem is with that mapping but I
don't know if I'm doing something wrong or it's tool's problem.
I made it also in unwrapped mode and there was no problem with that.
And also another question: is there any way for passing the -Ebindingfile in
the ant task of wsdl2java? because I didn't find it.
binding.xml
<binding>
<mapping name="WebLoginElement" class="login.types.WebLoginElement">
<value name="localUser_nameElement" field="localUser_nameElement"
get-method="getUser_nameElement" set-method="setUser_nameElement"/>
<value name="localUser_passwordElement"
field="localUser_passwordElement" get-method="getUser_passwordElement"
set-method="setUser_passwordElement"/>
</mapping>
<mapping name="ReturnWebLoginElement"
class="login.types.ReturnWebLoginElement">
<value name="localWeb_user_nameElement"
field="localWeb_user_nameElement" get-method="getWeb_user_nameElement"
set-method="setWeb_user_nameElement"/>
<value name="localSoap_session_idElement"
field="localSoap_session_idElement" get-method="getSoap_session_idElement"
set-method="setSoap_session_idElement"/>
</mapping>
</binding>
build.xml
<project basedir="." default="generate.all">
<property environment="env"/>
<property name="AXIS2_HOME" value="${env.AXIS2_HOME}"/>
<property name="JIBX_LIB" value="${env.JIBX_LIB}"/>
<property name="ECLIPSE_WORKSPACE"
value="${env.ECLIPSE_WORKSPACE}"/>
<property name="build.dir" value="build"/>
<!-- Run JiBX binding compiler -->
<target name="binding">
<!-- JiBX binding compiler task definition -->
<taskdef name="bind" classname="org.jibx.binding.ant.CompileTask"
classpath="${JIBX_LIB}/jibx-bind.jar"/>
<bind verbose="true" load="true" binding="binding.xml">
<classpathset dir="${build.dir}"/>
</bind>
</target>
</project>
LoginServiceJiBX.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="LoginServiceJiBX" targetNamespace="http://login"
xmlns:tns="http://login"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:ns2="http://login/types">
<types>
<schema targetNamespace="http://login/types"
xmlns:tns="http://login/types"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<element name="ReturnWebLoginElement">
<complexType>
<sequence>
<element
ref="tns:soap_session_idElement"/>
<element
ref="tns:web_user_nameElement"/>
</sequence>
</complexType>
</element>
<element name="WebLoginElement">
<complexType>
<sequence>
<element ref="tns:user_nameElement"/>
<element
ref="tns:user_passwordElement"/>
</sequence>
</complexType>
</element>
<element name="user_nameElement" type="string"/>
<element name="user_passwordElement" type="string"/>
<element name="soap_session_idElement" type="string"/>
<element name="web_user_nameElement" type="string"/>
</schema>
</types>
<message name="LoginEndpoint_webLogin">
<part name="parameters" element="ns2:WebLoginElement"/>
</message>
<message name="LoginEndpoint_webLoginResponse">
<part name="result" element="ns2:ReturnWebLoginElement"/>
</message>
<portType name="LoginEndpoint">
<operation name="webLogin">
<input message="tns:LoginEndpoint_webLogin"
name="LoginEndpoint_webLogin"/>
<output message="tns:LoginEndpoint_webLoginResponse"
name="LoginEndpoint_webLoginResponse"/>
</operation>
</portType>
<binding name="LoginEndpointBinding" type="tns:LoginEndpoint">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<operation name="webLogin">
<soap:operation soapAction="webLogin"/>
<input name="LoginEndpoint_webLogin">
<soap:body use="literal"/>
</input>
<output name="LoginEndpoint_webLoginResponse">
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="LoginServiceJiBX">
<port name="LoginEndpointPort" binding="tns:LoginEndpointBinding">
<soap:address
location="http://localhost:8080/axis2/services/LoginServiceJiBX"/>
</port>
</service>
</definitions>
ReturnWebLoginElement.java
/**
* ReturnWebLoginElement.java
*
* This file was auto-generated from WSDL
* by the Apache Axis2 version: #axisVersion# #today#
*/
package login.types;
/**
* ReturnWebLoginElement bean class
*/
public class ReturnWebLoginElement{
/**
* field for Soap_session_idElement
*/
protected String localSoap_session_idElement ;
/**
* Auto generated getter method
* @return String
*/
public String getSoap_session_idElement(){
return localSoap_session_idElement;
}
/**
* Auto generated setter method
* @param param Soap_session_idElement
*/
public void setSoap_session_idElement(String param){
this.localSoap_session_idElement=param;
}
/**
* field for Web_user_nameElement
*/
protected String localWeb_user_nameElement ;
/**
* Auto generated getter method
* @return String
*/
public String getWeb_user_nameElement(){
return localWeb_user_nameElement;
}
/**
* Auto generated setter method
* @param param Web_user_nameElement
*/
public void setWeb_user_nameElement(String param){
this.localWeb_user_nameElement=param;
}
}
WebLoginElement.java
package login.types;
/**
* WebLoginElement bean class
*/
public class WebLoginElement{
/**
* field for User_nameElement
*/
protected String localUser_nameElement ;
/**
* Auto generated getter method
* @return String
*/
public String getUser_nameElement(){
return localUser_nameElement;
}
/**
* Auto generated setter method
* @param param User_nameElement
*/
public void setUser_nameElement(String param){
this.localUser_nameElement=param;
}
/**
* field for User_passwordElement
*/
protected String localUser_passwordElement ;
/**
* Auto generated getter method
* @return String
*/
public String getUser_passwordElement(){
return localUser_passwordElement;
}
/**
* Auto generated setter method
* @param param User_passwordElement
*/
public void setUser_passwordElement(String param){
this.localUser_passwordElement=param;
}
}
--
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]