🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.webservices.soap
Article #76

Passing object via SOAP

#76
From: 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
Technical Details
Message-ID: <461faddc$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11096a,6d8c5b9fc8c4cfa2,start
X-Google-Attributes: gid11096a,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Roy K." <kyrillos.roy@ic.gc.ca>
From: "Roy K." <kyrillos.roy@ic.gc.ca>
Newsgroups: borland.public.cppbuilder.webservices.soap
Subject: Passing object via SOAP
Date: Fri, 13 Apr 2007 12:20:43 -0400
Lines: 104
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896
NNTP-Posting-Host: 192.197.178.3
Message-ID: <461faddc$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1176481244 192.197.178.3 (13 Apr 2007 09:20:44 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail