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 P Floyd <pf...@excite.com> on 2007/02/22 16:54:32 UTC

[AXIS2]WSDL2JAVA & ExtensionMapper Questions

 We have been using axis 1.x and are in the process of moving to axis2.  Some of our clients access these services via .NET.  The following are some of the issues I have encountered and need some help to move along. Our wsdl directories are structured as follows, wsdl/base.xsdwsdl/account/AccountService.wsdlwsdl/account/AccountService.xsd
wsdl/security/SecurityService.wsdlwsdl/security/SecurityService.xsd Both SecurityService.xsd &amp; AccountService.xsd import base.xsd.  The wsdl files include their respective schema files.  This was fine with axis1.x.  When I use the wsdl2java tool with axis2, it generates mutiple class files for the same type i.e., SecurityLookupResult.javaSecurityLookupResult2.java Next, I have the following defined in the schema file base.xsd, 
&lt;xs:complexType name="ErrorInfo"&gt;&lt;xs:sequence&gt;&lt;xs:element name="field" type="xs:string" /&gt;&lt;xs:element name="code" type="xs:string" /&gt;&lt;xs:element name="msg" type="xs:string" /&gt;&lt;xs:element name="severity" type="xs:string" /&gt;&lt;/xs:sequence&gt;&lt;/xs:complexType&gt;
&lt;xs:element name="Error" type="ErrorInfo" /&gt;
&lt;xs:element name="ErrorList"&gt;&lt;xs:complexType&gt;&lt;xs:sequence&gt;&lt;xs:element ref="Error" maxOccurs="unbounded"minOccurs="0" /&gt;&lt;/xs:sequence&gt;&lt;/xs:complexType&gt;&lt;/xs:element&gt;
In securityservices.xsd,
&lt;xs:element name="SecurityException"&gt;&lt;xs:complexType&gt;&lt;xs:choice&gt;&lt;xs:sequence&gt;&lt;xs:element name="errorInfo"type="baseServ:ErrorInfo" /&gt;&lt;xs:element name="symbol" type="xs:string" /&gt;&lt;/xs:sequence&gt;&lt;/xs:choice&gt;&lt;/xs:complexType&gt;&lt;/xs:element&gt;
And in my wsdl file,
&lt;message name="Error"&gt;&lt;part name="fault" element="secServ:SecurityException" /&gt;&lt;/message&gt;
Port:
&lt;operation name="lookupSecurity"&gt;&lt;input message="secServ:lookupSecurityRequest"name="lookupSecurityRequest" /&gt;&lt;output message="secServ:lookupSecurityResponse"name="lookupSecurityResponse" /&gt;&lt;fault message="secServ:Error" name="SecurityException" /&gt;&lt;/operation&gt;
Binding:
&lt;operation name="lookupSecurity"&gt;&lt;soap:operation soapAction="lookupSecurity" /&gt;&lt;input name="lookupSecurityRequest"&gt;&lt;soap:bodyencodingStyle="http://schemas.xmlsoap.org/soap/encoding/"use="literal" /&gt;&lt;/input&gt;&lt;output name="lookupSecurityResponse"&gt;&lt;soap:bodyencodingStyle="http://schemas.xmlsoap.org/soap/encoding/"use="literal" /&gt;&lt;/output&gt;&lt;fault name="SecurityException"&gt;&lt;soap:faultencodingStyle="http://schemas.xmlsoap.org/soap/encoding/"name="SecurityException" use="literal" /&gt;&lt;/fault&gt;&lt;/operation&gt;
wsdl2java generates,ErrorException.java
which has 
private com.critrade.webservices.security.SecurityException faultMessage;
Base, security and account are different namespaces.  The requests and responses in account and security wsdls, extend elements in base.  If I include schema in my wsdl, the extension mapper gets generated in account and security package and the build fails (compile).  If I import, then ExtensionMapper gets generated in the base package but gets overwritten because I am importing base in two wsdls.
In securityservices.wsdl,
&lt;types&gt;  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"   xmlns:secServ="http://security.webservices.company.com"   elementFormDefault="qualified"&gt;   &lt;xs:import schemaLocation="SecurityServices.xsd" namespace="http://security.webservices.company.com"/&gt;  &lt;/xs:schema&gt;&lt;/types&gt;
In securityservices.xsd
 &lt;xs:import schemaLocation="baseServices.xsd"  namespace="http://baseservices.webservices.company.com" /&gt;
I can send my wsdl and schema files if needed.
Thanks,
Srini

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!