[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jibx-users
Subject:    [jibx-users] How to use Jibx2WSDL for multiple services sharing
From:       Anuj Bhatia <anujbhatia () gmail ! com>
Date:       2010-01-11 6:51:22
Message-ID: 2fa82e041001102250p3b23d508g23d2e029d790aa55 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi All,

My project has multiple java classes to be exposed as web services. The
operations on those java web services are using a common set of bean classes
(as method arguments) and exception classes (in the throws class).

I'm trying to generate the binding and wsdl files for the multiple services
using the Jibx2WSDL tool but it seems that this scenario is not completely
supported. The generated binding only has one binding definition for each
exception class in the target namespace of one of the web services. But
there are seperate wsdl and xsd files generated for each web service and
each of those xsd files defines an element for the exception class in the
namespace of that particular service. (See exmaple below)

Next I try to generate the Axis2 client stubs from the wsdl files using the
wsdl2java tool from axis2 but it complains that it can't find the binding
definition for the exception classes.

Am I correct in saying that this scenario (i.e. multiple webservices sharing
common exception classes) is not supported in jib2wsdl? Any suggestions on
how to deal with this scenario?

Thanks
Anuj

Example:
--------
AdminWSImpl.java  (input to jibx2wsdl)
--------------------------------------
package com.myproject.admin;

import com.myproject.beans.ProductFamilyBean;
import com.myproject.beans.SessionInfoBean;
import com.myproject.exception.AuthorizationException;
import com.myproject.exception.CachingException;
import com.myproject.exception.InvalidInputDataException;

public class AdminWSImpl {

public SessionInfoBean authenticate(String user, String password)
throws InvalidInputDataException, AuthorizationException {

SessionInfoBean sessionInfoBean = null;
return sessionInfoBean;
}
 public ProductFamilyBean[] getFamilies(SessionInfoBean sessionBean)
throws CachingException,AuthorizationException{
ProductFamilyBean[] productFamilyBeanArray = null;
return productFamilyBeanArray;
}
}




EngineWSImpl.java  (input to jibx2wsdl)
---------------------------------------
package com.myproject.engine;

import com.myproject.beans.ProductBean;
import com.myproject.beans.SessionInfoBean;
import com.myproject.exception.AuthorizationException;
import com.myproject.exception.CachingException;
import com.myproject.exception.IllegalLocaleException;


public class EngineWSImpl {
 public ProductBean[] getProducts(String productFamilyName, SessionInfoBean
sessionBean)
throws CachingException, AuthorizationException {

ProductBean[] productBeanArray = null;
return productBeanArray;
}

public void importCoreLegacyLocSource (String[] processLocales,
SessionInfoBean sessionBean)
throws IllegalLocaleException, AuthorizationException {


}
}


All-binding-customizations.xml (input to jibx2wsdl)
----------------------------------------------
<custom force-classes="true">
<wsdl>
        <service class="com.myproject.admin.AdminWSImpl"
service-name="AdminService"/>
<service class="com.myproject.engine.EngineWSImpl"
service-name="EngineService" />
</wsdl>
</custom>


Jibx2WSDL is invoked from ant using the command line args:

   <java classname="org.jibx.ws.wsdl.tools.Jibx2Wsdl" fork="true"
classpathref="classpath" failonerror="true">
       <arg value="-c"/>
       <arg value="${resources.dir}/jibx/All-binding-customizations.xml"/>
       <arg value="-p"/>
       <arg value="${classes.output.dir}"/>
       <arg value="-t"/>
       <arg value="${output.dir}/wsdl/generated"/>
       <arg value="com.myproject.engine.EngineWSImpl"/>
       <arg value="com.myproject.admin.AdminWSImpl"/>
     </java>

Asuuming all the bean and exception classes are properly defined in the
packages com.myproject.beans and

com.myproject.exception respectively, the output that Jibx2WSDl produces
contains one wsdl and xsd file each for

AdminService and EngineService and one beans.xsd containig scheam
definitions for the common beans classes.

AdminService.wsdl (output from jibx2wsdl)
------------------------------------------
<wsdl:definitions xmlns:wsdl="..." xmlns:soap="..." xmlns:tns="
http://myproject.com/admin/AdminService"

targetNamespace="http://myproject.com/admin/AdminService">
....
      <xs:element name="caching"> <xs:complexType>....</xs:complexType>
</xs:element>
      <xs:element name="invalidInputData">
<xs:complexType>....</xs:complexType> </xs:element>
      <xs:element name="authorization">
<xs:complexType>....</xs:complexType> </xs:element>
....
      <wsdl:message name="invalidInputDataFault"><wsdl:part name="fault"
element="tns:invalidInputData"/></wsdl:message>
      <wsdl:message name="authorizationFault"><wsdl:part name="fault"
element="tns:authorization"/></wsdl:message>
      <wsdl:message name="cachingFault"><wsdl:part name="fault"
element="tns:caching"/></wsdl:message>
....
</wsdl:definitions>

AdminService.xsd (output from jibx2wsdl)
------------------------------------------
<xs:schema xmlns:xs="..." xmlns:tns="http://myproject.com/admin/AdminService"
xmlns:ns1="http://myproject.com/beans"

elementFormDefault="qualified" targetNamespace="
http://myproject.com/admin/AdminService">
....
  <xs:element name="caching"> <xs:complexType>...</xs:complexType>
</xs:element>
  <xs:element name="invalidInputData"> <xs:complexType>....</xs:complexType>
</xs:element>
  <xs:element name="authorization"> <xs:complexType>....</xs:complexType>
</xs:element>
</xs:schema>

admin_AdminServiceBinding.xml (output from jibx2wsdl)
-----------------------------------------------------
<binding xmlns:tns="http://myproject.com/admin/AdminService"
force-classes="true">
  <namespace uri="http://myproject.com/admin/AdminService"
default="elements"/>
  <mapping class="com.myproject.exception.InvalidInputDataExceptionData"
name="invalidInputData">
    ...
  </mapping>
  <mapping class="com.myproject.exception.AuthorizationExceptionData"
name="authorization">
    ...
  </mapping>
  <mapping class="com.myproject.exception.CachingExceptionData"
name="caching">
    ...
  </mapping>
</binding>


EngineService.wsdl (output from jibx2wsdl)
------------------------------------------
<wsdl:definitions xmlns:wsdl="..." xmlns:soap="..." xmlns:tns="
http://myproject.com/admin/AdminService"

targetNamespace="http://myproject.com/admin/AdminService">
....
      <xs:element name="caching"> <xs:complexType>....</xs:complexType>
</xs:element>
      <xs:element name="invalidInputData">
<xs:complexType>....</xs:complexType> </xs:element>
      <xs:element name="authorization">
<xs:complexType>....</xs:complexType> </xs:element>
....
     <wsdl:message name="invalidInputDataFault"><wsdl:part name="fault"
element="tns:invalidInputData"/></wsdl:message>
     <wsdl:message name="authorizationFault"><wsdl:part name="fault"
element="tns:authorization"/></wsdl:message>
     <wsdl:message name="cachingFault"><wsdl:part name="fault"
element="tns:caching"/></wsdl:message>
....
</wsdl:definitions>

EngineService.xsd (output from jibx2wsdl)
------------------------------------------
<xs:schema xmlns:xs="..." xmlns:tns="
http://myproject.com/engine/EngineService" xmlns:ns1="
http://myproject.com/beans"

elementFormDefault="qualified" targetNamespace="
http://myproject.com/engine/EngineService">
....
  <xs:element name="illegalLocale"> <xs:complexType>....</xs:complexType>
</xs:element>
</xs:schema>

engine_EngineServiceBinding.xml (output from jibx2wsdl)
-------------------------------------------------------
<binding xmlns:tns="http://myproject.com/engine/EngineService"
force-classes="true">
  <namespace uri="http://myproject.com/engine/EngineService"
default="elements" prefix="tns"/>
  <mapping class="com.myproject.exception.IllegalLocaleExceptionData"
name="illegalLocale">
   ....
  </mapping>
</binding>


Next the Axis2 WSDL2Java command is run from ant (to produce the Axis2-Jibx
wrapper classes i.e.

AdminServiceMessageReceiverInOut.java and
EngineServiceMessageReceiverInOut.java):
     <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true"
classpathref="classpath">
       <arg line="-o ${axis.output.dir}/${service.name}"/>
       <arg line="-uw -ss -sd"/>
       <arg line="-d jibx"/>
       <arg line="-Ebindingfile ${output.dir}/wsdl/generated/binding.xml"/>
       <arg line="-sn ${service.name}"/>
       <arg line="-uri ${output.dir}/wsdl/generated/${service.name}.wsdl"/>
       <arg line="-p ${service.impl.package}"/>
     </java>

The above command is run twice once for AdminService.wsdl and then of
EngineService.wsdl. It works fine for AdminService

but for EngineService it generates the error:
     [java] Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException:

No mapping defined for element {
http://myproject.com/engine/EngineService}authorization
     [java] at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)
     [java] at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
     [java] at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
     [java] Caused by: java.lang.RuntimeException: No mapping defined for
element {http://myproject.com/engine/EngineService}authorization
     [java] at
org.apache.axis2.jibx.CodeGenerationUtility.mapQName(CodeGenerationUtility.java:1044)
     [java] at
org.apache.axis2.jibx.CodeGenerationUtility.mapMessage(CodeGenerationUtility.java:1030)
     [java] at
org.apache.axis2.jibx.CodeGenerationUtility.engage(CodeGenerationUtility.java:431)
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java] at java.lang.reflect.Method.invoke(Method.java:585)
     [java] at
org.apache.axis2.wsdl.codegen.extension.JiBXExtension.engage(JiBXExtension.java:77)
     [java] at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
     [java] ... 2 more

[Attachment #5 (text/html)]

<div>Hi All,</div><div><br></div><div>My project has multiple java classes to be \
exposed as web services. The operations on those java web services are using a common \
set of bean classes (as method arguments) and exception classes (in the throws \
class).</div> <div><br></div><div>I&#39;m trying to generate the binding and wsdl \
files for the multiple services using the Jibx2WSDL tool but it seems that this \
scenario is not completely supported. The generated binding only has one binding \
definition for each exception class in the target namespace of one of the web \
services. But there are seperate wsdl and xsd files generated for each web service \
and each of those xsd files defines an element for the exception class in the \
namespace of that particular service. (See exmaple below)</div> \
<div><br></div><div>Next I try to generate the Axis2 client stubs from the wsdl files \
using the wsdl2java tool from axis2 but it complains that it can&#39;t find the \
binding definition for the exception classes.</div><div> <br></div><div>Am I correct \
in saying that this scenario (i.e. multiple webservices sharing common exception \
classes) is not supported in jib2wsdl? Any suggestions on how to deal with this \
scenario?</div><div><br></div><div> \
Thanks</div><div>Anuj</div><div><br></div><div>Example: \
</div><div>--------</div><div>AdminWSImpl.java  (input to \
jibx2wsdl)</div><div>--------------------------------------</div><div>package \
com.myproject.admin;</div><div> <br></div><div>import \
com.myproject.beans.ProductFamilyBean;</div><div>import \
com.myproject.beans.SessionInfoBean;</div><div>import \
com.myproject.exception.AuthorizationException;</div><div>import \
com.myproject.exception.CachingException;</div> <div>import \
com.myproject.exception.InvalidInputDataException;</div><div><br></div><div>public \
class AdminWSImpl {</div><div><br></div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>public SessionInfoBean authenticate(String user, \
String password) </div> <div><span class="Apple-tab-span" \
style="white-space:pre">			</span>throws InvalidInputDataException, \
AuthorizationException {</div><div><br></div><div><span class="Apple-tab-span" \
style="white-space:pre">		</span>SessionInfoBean sessionInfoBean = null;</div> \
<div><span class="Apple-tab-span" style="white-space:pre">		</span>return \
sessionInfoBean;</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>}</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span></div> <div><span class="Apple-tab-span" \
style="white-space:pre">	</span>public ProductFamilyBean[] \
getFamilies(SessionInfoBean sessionBean) </div><div><span class="Apple-tab-span" \
style="white-space:pre">			</span>throws \
CachingException,AuthorizationException{</div> <div><span class="Apple-tab-span" \
style="white-space:pre">		</span>ProductFamilyBean[] productFamilyBeanArray = \
null;</div><div><span class="Apple-tab-span" style="white-space:pre">		</span>return \
productFamilyBeanArray;</div> <div><span class="Apple-tab-span" \
style="white-space:pre">	</span>}</div><div>}</div><div><br></div><div><br></div><div><br></div><div><br></div><div>EngineWSImpl.java \
(input to jibx2wsdl)</div><div>---------------------------------------</div> \
<div>package com.myproject.engine;</div><div><br></div><div>import \
com.myproject.beans.ProductBean;</div><div>import \
com.myproject.beans.SessionInfoBean;</div><div>import \
com.myproject.exception.AuthorizationException;</div> <div>import \
com.myproject.exception.CachingException;</div><div>import \
com.myproject.exception.IllegalLocaleException;</div><div><br></div><div><br></div><div>public \
class EngineWSImpl {</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span></div> <div><span class="Apple-tab-span" \
style="white-space:pre">	</span></div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>public ProductBean[] getProducts(String \
productFamilyName, SessionInfoBean sessionBean) </div> <div><span \
class="Apple-tab-span" style="white-space:pre">			</span>throws \
CachingException,<span class="Apple-tab-span" \
style="white-space:pre">	</span>AuthorizationException \
{</div><div><br></div><div><span class="Apple-tab-span" \
style="white-space:pre">		</span>ProductBean[] productBeanArray = null;</div> \
<div><span class="Apple-tab-span" style="white-space:pre">		</span>return \
productBeanArray;</div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>}</div><div><br></div><div><span \
class="Apple-tab-span" style="white-space:pre">	</span>public void \
importCoreLegacyLocSource (String[] processLocales, SessionInfoBean sessionBean) \
</div> <div><span class="Apple-tab-span" style="white-space:pre">			</span>throws \
IllegalLocaleException, AuthorizationException \
{</div><div><br></div><div><br></div><div><span class="Apple-tab-span" \
style="white-space:pre">	</span>}</div> \
<div>}</div><div><br></div><div><br></div><div>All-binding-customizations.xml (input \
to jibx2wsdl)</div><div>----------------------------------------------</div><div>&lt;custom \
force-classes=&quot;true&quot;&gt;</div><div> <span class="Apple-tab-span" \
style="white-space:pre">	</span>&lt;wsdl&gt;</div><div>        &lt;service \
class=&quot;com.myproject.admin.AdminWSImpl&quot; \
service-name=&quot;AdminService&quot;/&gt;</div><div><span class="Apple-tab-span" \
style="white-space:pre">		</span>&lt;service \
class=&quot;com.myproject.engine.EngineWSImpl&quot; \
service-name=&quot;EngineService&quot; /&gt;</div> <div><span class="Apple-tab-span" \
style="white-space:pre">	</span>&lt;/wsdl&gt;</div><div>&lt;/custom&gt;</div><div><br></div><div><br></div><div>Jibx2WSDL \
is invoked from ant using the command line args:</div><div><br></div> <div>   \
&lt;java classname=&quot;org.jibx.ws.wsdl.tools.Jibx2Wsdl&quot; fork=&quot;true&quot; \
classpathref=&quot;classpath&quot; failonerror=&quot;true&quot;&gt;</div><div>       \
&lt;arg value=&quot;-c&quot;/&gt;</div><div>  &lt;arg \
value=&quot;${resources.dir}/jibx/All-binding-customizations.xml&quot;/&gt;</div><div> \
&lt;arg value=&quot;-p&quot;/&gt;</div><div>       &lt;arg \
value=&quot;${classes.output.dir}&quot;/&gt; </div><div>  &lt;arg \
value=&quot;-t&quot;/&gt;</div><div>       &lt;arg \
value=&quot;${output.dir}/wsdl/generated&quot;/&gt;</div><div>       &lt;arg \
value=&quot;com.myproject.engine.EngineWSImpl&quot;/&gt;</div><div>       &lt;arg \
value=&quot;com.myproject.admin.AdminWSImpl&quot;/&gt;</div> <div>     &lt;/java&gt; \
</div><div><br></div><div>Asuuming all the bean and exception classes are properly \
defined in the packages com.myproject.beans and \
</div><div><br></div><div>com.myproject.exception respectively, the output that \
Jibx2WSDl produces contains one wsdl and xsd file each for </div> \
<div><br></div><div>AdminService and EngineService and one beans.xsd containig scheam \
definitions for the common beans classes. </div><div><br></div><div>AdminService.wsdl \
(output from jibx2wsdl)</div><div>------------------------------------------</div> \
<div>&lt;wsdl:definitions xmlns:wsdl=&quot;...&quot; xmlns:soap=&quot;...&quot; \
xmlns:tns=&quot;<a href="http://myproject.com/admin/AdminService">http://myproject.com/admin/AdminService</a>&quot; \
</div><div><br></div><div> targetNamespace=&quot;<a \
href="http://myproject.com/admin/AdminService">http://myproject.com/admin/AdminService</a>&quot;&gt;</div><div>....</div><div> \
&lt;xs:element name=&quot;caching&quot;&gt; \
&lt;xs:complexType&gt;....&lt;/xs:complexType&gt; &lt;/xs:element&gt;</div> <div>     \
&lt;xs:element name=&quot;invalidInputData&quot;&gt; \
&lt;xs:complexType&gt;....&lt;/xs:complexType&gt; &lt;/xs:element&gt;</div><div>      \
&lt;xs:element name=&quot;authorization&quot;&gt; \
&lt;xs:complexType&gt;....&lt;/xs:complexType&gt; &lt;/xs:element&gt;</div> \
<div>....</div><div>      &lt;wsdl:message \
name=&quot;invalidInputDataFault&quot;&gt;&lt;wsdl:part name=&quot;fault&quot; \
element=&quot;tns:invalidInputData&quot;/&gt;&lt;/wsdl:message&gt;</div><div>      \
&lt;wsdl:message name=&quot;authorizationFault&quot;&gt;&lt;wsdl:part \
name=&quot;fault&quot; \
element=&quot;tns:authorization&quot;/&gt;&lt;/wsdl:message&gt;</div> <div>      \
&lt;wsdl:message name=&quot;cachingFault&quot;&gt;&lt;wsdl:part \
name=&quot;fault&quot; \
element=&quot;tns:caching&quot;/&gt;&lt;/wsdl:message&gt;</div><div>....</div><div>&lt;/wsdl:definitions&gt;</div><div><br>
 </div><div>AdminService.xsd (output from \
jibx2wsdl)</div><div>------------------------------------------</div><div>&lt;xs:schema \
xmlns:xs=&quot;...&quot; xmlns:tns=&quot;<a \
href="http://myproject.com/admin/AdminService">http://myproject.com/admin/AdminService</a>&quot; \
xmlns:ns1=&quot;<a href="http://myproject.com/beans">http://myproject.com/beans</a>&quot; \
</div> <div><br></div><div>elementFormDefault=&quot;qualified&quot; \
targetNamespace=&quot;<a \
href="http://myproject.com/admin/AdminService">http://myproject.com/admin/AdminService</a>&quot;&gt;</div><div>....</div><div> \
&lt;xs:element name=&quot;caching&quot;&gt; \
&lt;xs:complexType&gt;...&lt;/xs:complexType&gt; &lt;/xs:element&gt;</div> <div>  \
&lt;xs:element name=&quot;invalidInputData&quot;&gt; \
&lt;xs:complexType&gt;....&lt;/xs:complexType&gt; &lt;/xs:element&gt;</div><div>  \
&lt;xs:element name=&quot;authorization&quot;&gt; \
&lt;xs:complexType&gt;....&lt;/xs:complexType&gt; &lt;/xs:element&gt;</div> \
<div>&lt;/xs:schema&gt;</div><div><br></div><div>admin_AdminServiceBinding.xml \
(output from jibx2wsdl)</div><div>-----------------------------------------------------</div><div>&lt;binding \
xmlns:tns=&quot;<a href="http://myproject.com/admin/AdminService">http://myproject.com/admin/AdminService</a>&quot; \
force-classes=&quot;true&quot;&gt;</div> <div>  &lt;namespace uri=&quot;<a \
href="http://myproject.com/admin/AdminService">http://myproject.com/admin/AdminService</a>&quot; \
default=&quot;elements&quot;/&gt;</div><div>  &lt;mapping \
class=&quot;com.myproject.exception.InvalidInputDataExceptionData&quot; \
name=&quot;invalidInputData&quot;&gt;</div> <div>    ...</div><div>  \
&lt;/mapping&gt;</div><div>  &lt;mapping \
class=&quot;com.myproject.exception.AuthorizationExceptionData&quot; \
name=&quot;authorization&quot;&gt;</div><div>    ...</div><div>  \
&lt;/mapping&gt;</div> <div>  &lt;mapping \
class=&quot;com.myproject.exception.CachingExceptionData&quot; \
name=&quot;caching&quot;&gt;</div><div>    ...</div><div>  \
&lt;/mapping&gt;</div><div>&lt;/binding&gt;</div><div><br></div><div><br></div><div> \
EngineService.wsdl (output from \
jibx2wsdl)</div><div>------------------------------------------</div><div>&lt;wsdl:definitions \
xmlns:wsdl=&quot;...&quot; xmlns:soap=&quot;...&quot; xmlns:tns=&quot;<a \
href="http://myproject.com/admin/AdminService">http://myproject.com/admin/AdminService</a>&quot; \
</div> <div><br></div><div>targetNamespace=&quot;<a \
href="http://myproject.com/admin/AdminService">http://myproject.com/admin/AdminService</a>&quot;&gt;</div><div>....</div><div> \
&lt;xs:element name=&quot;caching&quot;&gt; \
&lt;xs:complexType&gt;....&lt;/xs:complexType&gt; &lt;/xs:element&gt;</div> <div>     \
&lt;xs:element name=&quot;invalidInputData&quot;&gt; \
&lt;xs:complexType&gt;....&lt;/xs:complexType&gt; &lt;/xs:element&gt;</div><div>      \
&lt;xs:element name=&quot;authorization&quot;&gt; \
&lt;xs:complexType&gt;....&lt;/xs:complexType&gt; &lt;/xs:element&gt;</div> \
<div>....</div><div>     &lt;wsdl:message \
name=&quot;invalidInputDataFault&quot;&gt;&lt;wsdl:part name=&quot;fault&quot; \
element=&quot;tns:invalidInputData&quot;/&gt;&lt;/wsdl:message&gt;</div><div>     \
&lt;wsdl:message name=&quot;authorizationFault&quot;&gt;&lt;wsdl:part \
name=&quot;fault&quot; \
element=&quot;tns:authorization&quot;/&gt;&lt;/wsdl:message&gt;</div> <div>     \
&lt;wsdl:message name=&quot;cachingFault&quot;&gt;&lt;wsdl:part \
name=&quot;fault&quot; \
element=&quot;tns:caching&quot;/&gt;&lt;/wsdl:message&gt;</div><div>....</div><div>&lt;/wsdl:definitions&gt;</div><div><br></div>
 <div>EngineService.xsd (output from \
jibx2wsdl)</div><div>------------------------------------------</div><div>&lt;xs:schema \
xmlns:xs=&quot;...&quot; xmlns:tns=&quot;<a \
href="http://myproject.com/engine/EngineService">http://myproject.com/engine/EngineService</a>&quot; \
xmlns:ns1=&quot;<a href="http://myproject.com/beans">http://myproject.com/beans</a>&quot; \
</div> <div><br></div><div>elementFormDefault=&quot;qualified&quot; \
targetNamespace=&quot;<a \
href="http://myproject.com/engine/EngineService">http://myproject.com/engine/EngineService</a>&quot;&gt;</div><div>....</div><div> \
&lt;xs:element name=&quot;illegalLocale&quot;&gt; \
&lt;xs:complexType&gt;....&lt;/xs:complexType&gt; &lt;/xs:element&gt;</div> \
<div>&lt;/xs:schema&gt;</div><div><br></div><div>engine_EngineServiceBinding.xml \
(output from jibx2wsdl)</div><div>-------------------------------------------------------</div><div>&lt;binding \
xmlns:tns=&quot;<a href="http://myproject.com/engine/EngineService">http://myproject.com/engine/EngineService</a>&quot; \
force-classes=&quot;true&quot;&gt;</div> <div>  &lt;namespace uri=&quot;<a \
href="http://myproject.com/engine/EngineService">http://myproject.com/engine/EngineService</a>&quot; \
default=&quot;elements&quot; prefix=&quot;tns&quot;/&gt;</div><div>  &lt;mapping \
class=&quot;com.myproject.exception.IllegalLocaleExceptionData&quot; \
name=&quot;illegalLocale&quot;&gt;</div> <div>   ....</div><div>  \
&lt;/mapping&gt;</div><div>&lt;/binding&gt;</div><div><br></div><div><br></div><div>Next \
the Axis2 WSDL2Java command is run from ant (to produce the Axis2-Jibx wrapper \
classes i.e. </div><div><br> </div><div>AdminServiceMessageReceiverInOut.java and \
EngineServiceMessageReceiverInOut.java):</div><div>     &lt;java \
classname=&quot;org.apache.axis2.wsdl.WSDL2Java&quot; fork=&quot;true&quot; \
classpathref=&quot;classpath&quot;&gt;</div> <div>       &lt;arg line=&quot;-o \
${axis.output.dir}/${<a \
href="http://service.name">service.name</a>}&quot;/&gt;</div><div>       &lt;arg \
line=&quot;-uw -ss -sd&quot;/&gt;</div><div>       &lt;arg line=&quot;-d \
jibx&quot;/&gt;</div> <div>       &lt;arg line=&quot;-Ebindingfile \
${output.dir}/wsdl/generated/binding.xml&quot;/&gt;</div><div>       &lt;arg \
line=&quot;-sn ${<a href="http://service.name">service.name</a>}&quot;/&gt;</div><div> \
&lt;arg line=&quot;-uri ${output.dir}/wsdl/generated/${<a \
href="http://service.name">service.name</a>}.wsdl&quot;/&gt;</div> <div>       \
&lt;arg line=&quot;-p ${service.impl.package}&quot;/&gt;</div><div>     \
&lt;/java&gt;</div><div><br></div><div>The above command is run twice once for \
AdminService.wsdl and then of EngineService.wsdl. It works fine for AdminService \
</div> <div><br></div><div>but for EngineService it generates the error:</div><div>   \
</div><div>No mapping defined for element {<a \
href="http://myproject.com/engine/EngineService}authorization">http://myproject.com/engine/EngineService}authorization</a></div><div> \
[java] <span class="Apple-tab-span" style="white-space:pre">	</span>at \
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)</div>
 <div>     [java] <span class="Apple-tab-span" style="white-space:pre">	</span>at \
org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)</div><div>     [java] <span \
class="Apple-tab-span" style="white-space:pre">	</span>at \
org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)</div> <div>     [java] Caused \
by: java.lang.RuntimeException: No mapping defined for element {<a \
href="http://myproject.com/engine/EngineService}authorization">http://myproject.com/engine/EngineService}authorization</a></div><div>
  [java] <span class="Apple-tab-span" style="white-space:pre">	</span>at \
org.apache.axis2.jibx.CodeGenerationUtility.mapQName(CodeGenerationUtility.java:1044)</div><div> \
[java] <span class="Apple-tab-span" style="white-space:pre">	</span>at \
org.apache.axis2.jibx.CodeGenerationUtility.mapMessage(CodeGenerationUtility.java:1030)</div>
 <div>     [java] <span class="Apple-tab-span" style="white-space:pre">	</span>at \
org.apache.axis2.jibx.CodeGenerationUtility.engage(CodeGenerationUtility.java:431)</div><div> \
[java] <span class="Apple-tab-span" style="white-space:pre">	</span>at \
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div> <div>     [java] \
<span class="Apple-tab-span" style="white-space:pre">	</span>at \
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</div><div> \
[java] <span class="Apple-tab-span" style="white-space:pre">	</span>at \
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</div>
 <div>     [java] <span class="Apple-tab-span" style="white-space:pre">	</span>at \
java.lang.reflect.Method.invoke(Method.java:585)</div><div>     [java] <span \
class="Apple-tab-span" style="white-space:pre">	</span>at \
org.apache.axis2.wsdl.codegen.extension.JiBXExtension.engage(JiBXExtension.java:77)</div>
 <div>     [java] <span class="Apple-tab-span" style="white-space:pre">	</span>at \
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)</div><div> \
[java] <span class="Apple-tab-span" style="white-space:pre">	</span>... 2 more </div> \
<div><br></div><div><br></div><div><br></div><div> \
</div><div><br></div><div><br></div><div><br></div>



------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 

_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic