axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samisa Abeysinghe" <>
Subject RE: Returning an array from Java Webservice
Date Thu, 02 Jun 2005 03:11:35 GMT
The problem is with the use of href/multiref in the SOAP response.

Axis C++ cannot deal with href/multiref.

An alternative is to disable href/multiref in Axis Java server side. Please see
for more details. (This issue also has details on how to disable href/multiref in Axis Java)


-----Original Message-----
From: Falk Sippach [] 
Sent: Wednesday, June 01, 2005 10:42 PM
To: Apache AXIS C User List
Subject: AW: Returning an array from Java Webservice


thanks for your short description. But I have a new problem.

We've generated a Java Webservice with six methods:
public TestBean getBean()
public TestBean[] getBeans()
public int getInt()
public int [] getInts()
public String getString()
public String[] getStrings()

We've written an interface first, used Java2WSDL and WSDL2Java then. We've implemented the
functions and the webservice works fine (tested with a C# client). But with an Axis C++ client
it's not really working. We use Axis C++ 1.5 final.

First we've started with the getBean-methods. The binary Axis version crashes with an unhandled
exception at invoking the method. We've compiled the Axis sources and used a debug AxisClient.dll
then. We found out that the problem is in SoapDeSerializer.cpp at ::getXSDType(). For example

    <getIntResponse soapenv:encodingStyle="">
      <getIntReturn href="#id0"/>
    <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle=""

At getIntReturn there is the second value of the attribute list null. Therefore ::getURI !=
URI_XSI and XSD_UNKNOWN will be returned which follows in a null pointer later.

In getString() it looks as follows:

    <getStringResponse soapenv:encodingStyle="">
      <getStringReturn xsi:type="xsd:string">Hallo Ralf</getStringReturn>

There getURI returns URI_XSI and the methods returns the value.

Besides strings and string arrays we can't get any other datatype. Are there some basics wrong?
I can't imagine that you've the same problems.

Thanks for your help.


-----Urspr√ľngliche Nachricht-----
Von: Dushshantha Chandradasa [] 
Gesendet: Mittwoch, 1. Juni 2005 11:07
Betreff: RE: Returning an array from Java Webservice

Hi Falk,

In Axis C++, arrays are handled in the following way. I'll explain this using a test sample
we have in Axis C++ cvs ( SimpleTypeArray ). 

Here in this example, the complex type "Type"(defined in Type.hpp) has a member called item
which is an array of integers. It is defined as a data type called xsd__int_Array which contains
a member called m_Array which is an array of pointers of integer and a member called m_Size
which is an integer that contains the size of the array.

In the client you can access the returning array element as follows (the complete client code
is attached as SimpleTypeArray.cpp)

output = ws->getInput(input);

    for ( i = 0; i < 100; i++ ) {
      cout << "item [" << i << "] = " << *(output->item.m_Array[i])
<< endl;

Here ws is the client stub of the web service and output is an instance of Type. 

You can get the Array size from the variable m_Size of "output".


-----Original Message-----
From: Falk Sippach []
Sent: Tuesday, May 31, 2005 7:22 PM
To: Apache AXIS C User List
Subject: Returning an array from Java Webservice


some weeks ago I've tested Axis C++ with a Java Axis webservice. It worked well as long as
I returned simple Java beans.

Now my Java webservice returns an array of beans. How does it work in my
C++ client. Does it work at all? I'm not a good C++ programmer, but I
think, in C++ you need to know how long your array is. In Java you can simply ask for the

Please give me some hints, maybe a documentation about arrays between Java Axis und C++ Axis.


View raw message