axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Perry2 <>
Subject WSDL2Ws does not not always use WSDL element names in generated stubs
Date Tue, 15 Mar 2005 12:25:17 GMT
Apologies for send a note, but Jira is down at the moment.

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">
     <element name="simpleArrays" nillable="true"
     <element name="string" nillable="true" type="xsd:string"/>
     <element name="int" type="xsd:int"/>

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

    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

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv=""
      <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).]]>
      <detail xmlns=""/>

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


Andrew Perry
IBM Web Services Client for C/C++
Mail Point 127
IBM UK Laboratories. Hursley Park, Winchester, Hants. SO21 2JN
Tel. Internal 249828  External + 44 (0)1962 819828
Fax. + 44(0)1962 818080
View raw message