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 http://issues.apache.org/jira/browse/AXISCPP-111 for more details. (This issue also has details on how to disable href/multiref in Axis Java) Thanks, Samisa... -----Original Message----- From: Falk Sippach [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 01, 2005 10:42 PM To: Apache AXIS C User List Subject: AW: Returning an array from Java Webservice Hi, 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 getInt(): <soapenv:Envelope> <soapenv:Body> <getIntResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <getIntReturn href="#id0"/> </getIntResponse> <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int">12345</multiRef> </soapenv:Body> </soapenv:Envelope> 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: <soapenv:Envelope> <soapenv:Body> <getStringResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <getStringReturn xsi:type="xsd:string">Hallo Ralf</getStringReturn> </getStringResponse> </soapenv:Body> </soapenv:Envelope> 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. Falk. -----Urspr�ngliche Nachricht----- Von: Dushshantha Chandradasa [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 1. Juni 2005 11:07 An: [email protected] 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". Regards, Dushshantha -----Original Message----- From: Falk Sippach [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 31, 2005 7:22 PM To: Apache AXIS C User List Subject: Returning an array from Java Webservice Hello, 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 length. Please give me some hints, maybe a documentation about arrays between Java Axis und C++ Axis. Thanks, Falk.
