[Axis2] WSDL2C problem when wsdl type name contains "-" characters
------------------------------------------------------------------

                 Key: AXIS2C-542
                 URL: https://issues.apache.org/jira/browse/AXIS2C-542
             Project: Axis2-C
          Issue Type: Bug
    Affects Versions: Current (Nightly)
         Environment: Windows XP, Visual Studio 2003 C++
            Reporter: Dave Meier
            Priority: Blocker
             Fix For: Current (Nightly)


I am using the latest trunk code for Axis2 Java as of today. 

My wsdl has type names that contain "-" characters and this causes C code to be 
generated that also has these characters. The generated code will not compile. 
The "-" characters need to be changed to underscore "_" characters. The WSDL 
was generated with gSoap, which converts underscore characters in the header 
file to dash characters in the wsdl, so it is a common case to have these dash 
characters in the wsdl. 

Here's a test WSDL that shows the problem: 

<schema targetNamespace="urn:test" 
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"; 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
  xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#"; 
  
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
 
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"; 
  
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
 
  xmlns:tt="urn:test" 
  xmlns="http://www.w3.org/2001/XMLSchema"; 
  elementFormDefault="qualified" 
  attributeFormDefault="qualified"> 
  <import namespace="http://www.w3.org/2001/10/xml-exc-c14n#"/> 
  <import 
namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
 
  <import namespace="http://www.w3.org/2000/09/xmldsig#"/> 
  <import 
namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
 
  <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> 
  <simpleType name="Attachment-Access-Type"> 
   <restriction base="xsd:string"> 
    <enumeration value="ATTACHACCESS-DEFAULT"/> 
    <enumeration value="ATTACHACCESS-RESTRICTED"/> 
    <enumeration value="ATTACHACCESS-UNRESTRICTED"/> 
   </restriction> 
  </simpleType> 
  <!-- operation request element --> 
  <element name="SetAccess"> 
   <complexType> 
    <sequence> 
     <element name="accessType" type="tt:Attachment-Access-Type" minOccurs="1" 
maxOccurs="1" default="ATTACHACCESS-DEFAULT"/> 
    </sequence> 
   </complexType> 
  </element> 
  <!-- operation response element --> 
  <element name="SetAccessResponse"> 
   <complexType> 
    <sequence> 
    </sequence> 
   </complexType> 
  </element> 
 </schema> 

</types> 

<message name="SetAccess"> 
 <part name="parameters" element="tt:SetAccess"/> 
</message> 

<message name="SetAccessResponse"> 
 <part name="parameters" element="tt:SetAccessResponse"/> 
</message> 

<portType name="testPortType"> 
 <operation name="SetAccess"> 
  <documentation>SetAccess</documentation> 
  <input message="tns:SetAccess"/> 
  <output message="tns:SetAccessResponse"/> 
 </operation> 
</portType> 

<binding name="test" type="tns:testPortType"> 
 <SOAP:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/> 
 <operation name="SetAccess"> 
  <SOAP:operation soapAction=""/> 
  <input> 
     <SOAP:body parts="parameters" use="literal"/> 
  </input> 
  <output> 
     <SOAP:body parts="parameters" use="literal"/> 
  </output> 
 </operation> 
</binding> 

<service name="test"> 
 <documentation>gSOAP 2.7.6e generated service definition</documentation> 
 <port name="test" binding="tns:test"> 
  <SOAP:address location="http://localhost:80/gsoap/gsoap_ssl.dll?test"/> 
 </port> 
</service> 

</definitions> 

And here is some of the generated code (using -d adb) that shows the problem: 

        /** 
         * getter for Attachment-Access-Type. 
         */ 
        axis2_char_t* AXIS2_CALL 
        axis2_Attachment_Access_Type_get_Attachment-Access-Type( 
            axis2_Attachment_Access_Type_t* Attachment_Access_Type, 
            const axis2_env_t *env); 

        /** 
         * setter for Attachment-Access-Type 
         */ 
        axis2_status_t AXIS2_CALL 
        axis2_Attachment_Access_Type_set_Attachment-Access-Type( 
            axis2_Attachment_Access_Type_t* Attachment_Access_Type, 
            const axis2_env_t *env, 
            axis2_char_t* param_Attachment-Access-Type); 

The "axis2_Attachment_Access_Type_get_Attachment-Access-Type" for example has 
the dash characters. 


-- 
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]

Reply via email to