axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Perry (JIRA)" <axis-c-...@ws.apache.org>
Subject [jira] Created: (AXISCPP-550) WSDL2Ws does not always use the element names from WSDL
Date Tue, 15 Mar 2005 14:50:35 GMT
WSDL2Ws does not always use the element names from WSDL
-------------------------------------------------------

         Key: AXISCPP-550
         URL: http://issues.apache.org/jira/browse/AXISCPP-550
     Project: Axis-C++
        Type: Bug
  Components: WSDL processing  
    Reporter: Andrew Perry


I have created a WSDL to test nested complex types with arrays of complex
types which also contain simple arrays as well as other data elements.

The WSDL definition of one of the complex types is

---------------------------------------------
   <complexType name="ComplexType1">
    <sequence>
     <element name="simpleArrays" nillable="true"
type="impl:SimpleArrays"/>
     <element name="string" nillable="true" type="xsd:string"/>
     <element name="int" type="xsd:int"/>
    </sequence>
   </complexType>
---------------------------------------------

The generated stubs for one of the nested complex types has named the
elements as follows:

public:
    SimpleArrays* simpleArrays;
    xsd__string _string;
    xsd__int _int;

In the WSDL the element names are reserved words in the 'C/C++' language so
the '_' is put in the element name. Unfortunately it was also using this
name in the Axis_Serialize_xxx method for serializing the elements,
pSZ->serializeAsElement("_string", Axis_URI_ComplexType1,
(void*)(param->str_string), XSD_STRING); rather than the name of the
element from the WSDL which is just "string" and "int" without the '_'.
This causes an Internal Server Error as the element names do not match the
name in the WSDL so the server doesn't know what to do.

---------- formatted for clarity ----------

HTTP/1.1 500 Internal Server Error
Server: WebSphere Application Server/5.1
Content-Type: text/xml; charset=utf-8
Content-Language: en-US
Transfer-Encoding: chunked

2ec
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <soapenv:Fault>
      <faultcode xmlns="">Server.generalException</faultcode>
      <faultstring xmlns="">
       <![CDATA[org.xml.sax.SAXException: WSWS3047E: Error: Cannot
deserialize element _string of bean
org.apache.test.nestedcomplex.ComplexType1. To see the message containing
the parsing error in the log, either enable web service engine tracing or
set MessageContext.setHighFidelity(true).]]>
      </faultstring>
      <detail xmlns=""/>
    </soapenv:Fault>
  </soapenv:Body>
</soapenv:Envelope>
0
---------------------------------------------

By manually editing the generated stubs to use the correct element name
from the WSDL the test works.


Attached WSDL. (See attached file: NestedComplex.wsdl)


Also changing the names in the WSDL will solve it, but that's not the
point.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message