axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henrik Nordberg (JIRA)" <axis-c-...@ws.apache.org>
Subject [jira] Created: (AXISCPP-720) Returning Array of complex type is broken
Date Thu, 30 Jun 2005 17:13:58 GMT
Returning Array of complex type is broken
-----------------------------------------

         Key: AXISCPP-720
         URL: http://issues.apache.org/jira/browse/AXISCPP-720
     Project: Axis-C++
        Type: Bug
  Components: Serialization, WSDL processing - Doc  
    Versions: current (nightly)    
 Environment: Windows & Linux
    Reporter: Henrik Nordberg


There is a problem with the way arrays of complex types are being serialized before they are
returned to the client from the web service. The problem went away when returned an object
that contained the array (different classes where then generated for the array, see below).
I think the problem is the way the stubs are generated for the case when a complex array is
retured directly and not as part of a class.

First I had the following interface on which I ran Java2WSDL and then WSDL2WS:

public interface DatabaseInfoProvider {
    WsDatabaseObject[] getDatabaseObjects(String sUser, String sPassword,  String connect,
String objectTypes[], String searchString);
}

where

public class WsDatabaseObject {
	public String sObjectType; // TABLE, VIEW, SP, SYNONYM
	public String sObjectName;
	public WsDatabaseColumn[] Columns;
}

where

public class WsDatabaseColumn {
	public String name;
	public Boolean isPrimaryKey;
}

Here is the important part:
The generated code for the array looks like:

typedef struct WsDatabaseObject_ArrayTag
{
	WsDatabaseObject** m_Array;  // <-- BUG MAY BE HERE
	int m_Size;
} WsDatabaseObject_Array;

Then I change the interface to:

public interface DatabaseInfoProvider {
	WsDatabaseInfo getDatabaseObjects(String sUser, String sPassword, String connect, String
objectTypes[], String searchString);
}

where

public class WsDatabaseInfo {
	public WsDatabaseObject[] dbInfo;
}

Note that the only difference is that I now return a class containing the array, instead of
returning the array itself as was the case above.

The code for the array now looks like:

typedef struct WsDatabaseObject_ArrayTag
{
	WsDatabaseObject* m_Array;     // NOTE: just one * used
	int m_Size;
} WsDatabaseObject_Array;

The same thing is true for the nested array ( public WsDatabaseColumn[] Columns; ). I.e.,
in the code generated by from the first version of the interface defined in Java, WsDatabaseColumn_ArrayTag
has WsDatabaseColumn** m_Array;, but in the second version it has WsDatabaseColumn* m_Array;.

The first version crashes when serializing the result to be sent back to the client. The engine
code seems to assume that the arrays are defined as T* m_Array and not T** m_Array.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message