This is a tough one.  I forget how spoiled I have become in just a few short years of 
Java-only coding! :-)

I would investigate how the other C/C++ SOAP implementation do it and follow their 
lead.  I don't think we need to reinvent the wheel.

I would have 2 implementations set up (WASP and GLUE maybe) that you can cross check 
behavior in the C++ world so that Axis isn't different in cases like these.  
Particularly in the WSDL2C++ case.


--
Tom Jordahl
Macromedia Server Development

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 29, 2003 8:02 AM
To: [EMAIL PROTECTED]
Subject: writing C++ methods that passes and/or returns arrays

Hi all,

Passing arrays as parameters to a method
----------------------------------------
Doing this C++ differs from Java. Usually in C++ we pass the size of the 
array in another parameter so that inside the method it know the size of the 
array.

In Java this is not a problem because an Array itself is a class that has the 
size. So a method in java,
          int EchoIntArray(int []) corresponds to int EchoArray(int [], int) 
in C++. 

Suppose some one needs to write a web service for this method and the method 
signature that the WSDL describes corresponds to the method signature in Java 
exactly but not the C++ one. 

So how should a C++ developer implement his service corresponding to the 
WSDL ?

This way that we (Axis C++) asks the C++ web service developer should be 
decided in order to improve Wrapper Class Generator (WCG) to handle passing 
and returning arrays from methods.

I find that we can give 2 solutions,

1. Introduce Axis C++ own Array class. So the method signature becomes
         int EchoIntArray(AxisArray a)

2. Ask the C++ developer to specify the meaning of other parameters by using 
a predefined Axis C++ macro. Then the method signature becomes,
         int EchoIntArray(int [], ARRAYINSIZE int);
  
Which is the best option to choose. IMO I like second.

Also if you find any other solution please discuss.

Comments on this is very much appreciated.

Thanks,

Susantha.


--
Lanka Software Foundation (http://www.opensource.lk)
Promoting Open-Source Development in Sri Lanka

Reply via email to