🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.webservices.soap
2 messages
2 total messages Started by Roy K. Fri, 13 Apr 2007 16:20
Passing object via SOAP
#76
Author: Roy K.
Date: Fri, 13 Apr 2007 16:20
102 lines
4095 bytes
Hello to all,

I have made a web service in Java.  I used the WSDL importer to be able to
call my web service from a C++ application.  I have a problem calling a
specific function of my web service :

Prototype : float GetTerrain(GeoPoint*, short, string)

GeoPoint is an simple class containing 4 attributes (doubles : longitude,
latitude, elevation   int : land)

In my C++ application, I call GetTerrain like this :

THTTPRIO *X = new THTTPRIO(NULL);
 X->URL =
"http://142.53.172.143:8888/WebService_XX-WebService-context-root/SmartViewS
ervice_06SoapHttpPort";
 X->WSDLLocation =
"C:\\WorkFiles\\Develppement\\SmartView_06\\WebService\\public_html\\WEB-INF
\\wsdl\\SmartViewService_06.wsdl";


 _di_SmartViewService_06 InterfaceVariable = GetSmartViewService_06(true,
"");
 CoInitialize(NULL);
 cout << "After CoInitialize"; cout << endl;
 if (X->QueryInterface(InterfaceVariable) == S_OK)
 {
 GeoPoint* p = new GeoPoint();
  p->longitude = -123.624;
  p->latitude = 48.579;
  p->elevation = 2;
  p->land = 2;

  const Smallint dbtype = 4;
  const char* dbloc = "U:\\MAPS\\CDED\\";

  int a = InterfaceVariable->GetTerrain(p, dbtype, dbloc);
}

When I call GetTerrain from C++, the web service receives all the parameters
correctly and do all the processing as it should.  It return an error code
of "a=0", meaning that everyting went well (as observable in a logfile).
GetTerrain() should modifiy the attributes of the GeoPoint object that is
passed.

The problem is that the GeoPoint object (p) in my C++ application remains
unchanged after I call GetTerrain().  I after calling GetTerrain(),
p->elevation should equal 190 and p->land should be 1.  But these two
attributes remains unchanged (= 2).

This is my web service implementation class (Java):

package SV;

import javax.jws.WebMethod;
import javax.jws.WebService;

public class SVService {
    private GetTerrain GetTerrain;

    public SVService() {
        GetTerrain = new GetTerrain();
    }

    /**
    * This function takes a GeoPoint that's missing the "land" and
"elevation"
    * attributes and search the specified database in order to find the
    * requested "land" and "elevation".
    *
    * @param point     The given GeoPoint to be fulfilled
    * @param db_type   The type of database :  1= CRC 500mTopo files
    *                                          2= CDED files
    *                                          3= DTED files
    *                                          4= CDED on web server
    * @param db_location  The path of the database (ex.: "U:\\MAPS\\CDED\\")
    * @return error code   0 = Ok
    *                      1 = No elevation found at this point
    *                      2 = No land type found at this point
    */
    public float GetTerrain(GeoPoint point, short db_type, String
db_location)
    { return GetTerrain.getTerrain(point, db_type, db_location); }

}

This is my web service interface class (Java):

package SV;

public interface SmartViewService_06 extends java.rmi.Remote {
    public float GetTerrain(SV.GeoPoint point, short db_type,
java.lang.String db_location) throws
         java.rmi.RemoteException;
}

Any help will be most welcome!

Thanks,

Roy
Re: Passing object via SOAP
#77
Author: Jean-Marie Babet
Date: Mon, 16 Apr 2007 16:09
13 lines
1207 bytes
Hello Roy,

To simulate passing a reference you must declare the method as taking a
reference to the object. As in

   method(SOAPObject*& byRef);

Please let me know if you need more info. or the above does not work for
you.

Cheers,

Bruneau.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads