cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dohrmann, Christoph" <Christoph.Dohrm...@comma-soft.com>
Subject wsdl2js --> serialization not supported for ArrayOfString within Complex Type
Date Mon, 12 Jul 2010 11:16:27 GMT
Dear all,

I need to integrate with a .Net based SOAP Webservice 1.1 (amongst others) within a ASP.net/AJAX
Page.
For efficient coding and maintenance the use of wsdl2js seemed like a good idea.

I am currently using Version 2.2.9 of the CXF Package.
The myService.js file gets generated without problems but when I try to call the service (e.g.
GetPivot - see code below) the serialization of a ArrayOfString property fails.

The erroneous line in myService.js is:
xml = xml + this._EnvironmentQueries.serialize(cxfjsutils, 'jns1:EnvironmentQueries', null);

Error indicates that the this._EnvironmentQueries does not support the serialize Method (this._EnvironmentQueries[0]
= "<SOMEQUERY>")

Below you find the required SOAP request XML structure and the snippets from myService.js
which seem to indicate the following:
Seems like not serialization is supported/"added" to the variable of type ArrayOfString (as
in <otherclass>.prototyp.serialize = ....) for other complex types.

Why is this (not) happening and what is the underlying "issue" I could try and add to the
CXF issue tracker (without sounding too dumb)?

Could this be because the ArrayOfString is nested within other complex types?

Any issue on this already in the making?

Thank you for time an consideration - C Dohrmann


------------------- SOAP Example for request  and excerpts from the myservice.js file ----------------

/*
Soap Request required:
[snip]
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
                <s:Body>
                               <GetPivot xmlns="http://tempuri.org/">
                                               <request xmlns:d4p1="http://schemas.datacontract.org/[snip]"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                                                               <d4p1:Query xmlns:d5p1="http://schemas.datacontract.org/[snip]">
                                                                              <d5p1:MultiFilterQuery>
                                                                                         
    <d5p1:BaseQuery i:nil="true"/>
                                                                                         
    <d5p1:EnvironmentQueries xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
                                                                                         
                    <!-- ArrayOfString expexted - see code generated below -->
                                                                                         
                    <d7p1:string><SOMEQUERY></d7p1:string>
                                                                                         
    </d5p1:EnvironmentQueries>
                                                                              </d5p1:MultiFilterQuery>
                                                               </d4p1:Query>
                                               </request>
                               </GetPivot>
                </s:Body>
</s:Envelope>
[snip]


data.wsdl
the wsdl can be provided on request if necessary
*/

service.js (as generated from WSDL)
// [snip]

// Constructor for XML Schema item {http://schemas.datacontract.org/2004/07/Infonea.Services}MultiFilterQuery
//
function Q1_MultiFilterQuery () {
    this.typeMarker = 'Q1_MultiFilterQuery';
    this._BaseQuery = null;
    this._EnvironmentQueries = null;
}

// [snip]

// accessor is Q1_MultiFilterQuery.prototype.getEnvironmentQueries
// element get for EnvironmentQueries
// - element type is {http://schemas.microsoft.com/2003/10/Serialization/Arrays}ArrayOfstring
// - optional element
// - nillable
//
// element set for EnvironmentQueries
// setter function is is Q1_MultiFilterQuery.prototype.setEnvironmentQueries
//
function Q1_MultiFilterQuery_getEnvironmentQueries() { return this._EnvironmentQueries;}

Q1_MultiFilterQuery.prototype.getEnvironmentQueries = Q1_MultiFilterQuery_getEnvironmentQueries;

function Q1_MultiFilterQuery_setEnvironmentQueries(value) { this._EnvironmentQueries = value;}

Q1_MultiFilterQuery.prototype.setEnvironmentQueries = Q1_MultiFilterQuery_setEnvironmentQueries;

// [snip]

//
// Serialize {http://schemas.datacontract.org/2004/07/Infonea.Services}MultiFilterQuery
//
function Q1_MultiFilterQuery_serialize(cxfjsutils, elementName, extraNamespaces) {
    var xml = '';
    if (elementName != null) {
     xml = xml + '<';
     xml = xml + elementName;
     xml = xml + ' ';
     xml = xml + 'xmlns:jns0=\'http://schemas.datacontract.org/2004/07/Infonea.Services.AssociatedObjectSet\'
xmlns:jns1=\'http://schemas.datacontract.org/2004/07/Infonea.Services\' ';
     if (extraNamespaces) {
      xml = xml + ' ' + extraNamespaces;
     }
     xml = xml + '>';
    }
    // block for local variables
    {
     if (this._BaseQuery != null) {
      if (this._BaseQuery == null) {
       xml = xml + '<jns1:BaseQuery xsi:nil=\'true\'/>';
      } else {
       xml = xml + '<jns1:BaseQuery>';
       xml = xml + cxfjsutils.escapeXmlEntities(this._BaseQuery);
       xml = xml + '</jns1:BaseQuery>';
      }
     }
    }
    // block for local variables
    {
     if (this._EnvironmentQueries != null) {
      if (this._EnvironmentQueries == null) {
       xml = xml + '<jns1:EnvironmentQueries xsi:nil=\'true\'/>';
      } else {
       xml = xml + this._EnvironmentQueries.serialize(cxfjsutils, 'jns1:EnvironmentQueries',
null);
      }
     }
    }
    if (elementName != null) {
     xml = xml + '</';
     xml = xml + elementName;
     xml = xml + '>';
    }
    return xml;
}

Q1_MultiFilterQuery.prototype.serialize = Q1_MultiFilterQuery_serialize;

----------------------------------------------------------------------------------


Comma Soft AG - THE KNOWLEDGE PEOPLE
P├╝tzchens Chaussee 202-204a * 53229 Bonn * Germany
Tel.: +49 228 97 70 116 * Mob.: +49 160 365 1316 * Fax: +49 228 97 70 200
mailto:christoph.dohrmann@comma-soft.com  * http://www.comma-soft.com<http://www.comma-soft.com/>
 * Zentrale: +49 228 97 70 0
Vorstandsvorsitzender: Stephan Huthmacher
Aufsichtsratsvorsitzender: Dr. Wolfgang Klein
Amtsgericht Bonn HRB 8500


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message