🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #1518

Help please!!

#1518
From: Puri Vidal
Date: Wed, 01 Dec 2004 09:47
72 lines
3182 bytes
I do not know if this is the right place to ask this, buy I need your
help...

I am trying to develop a web service client application using C++ Builder 6.
I have the wsdl file so I try to import it using the WSDL importer, getting
the following:

namespace NS_MyService {
// Warning: Literal parameters of MyService() cannot be unwound
__interface INTERFACE_UUID("{.....}") MyServicePort : public IInvokable
{
public:
  virtual void            MyService(const ComplexType1 request,
ComplexType2& response) = 0;
};
typedef DelphiInterface<MyServicePort> _di_MyServicePort;
_di_MyServicePort GetMyServicePort(bool useWSDL=false, AnsiString addr="");
 };     // NS_MyService

Fist of all, why is the importer not able to import the complex types? To
resolve this I have defined all complex types using classes derived from
TRemotable as follows:

class ComplexType1 : public TRemotable {
private:
   AnsiString fField1;
   AnsiString fField2;
public:
__published:
   __property AnsiString Field1 = { read=fField1, write=fField1 };
   __property AnsiString Field2 = { read=fField2, write=fMessageId };
};

In the RegTypes() function I register both types
static void RegTypes()
{
   RemTypeRegistry()->RegisterXSClass( __classid(ComplexType1),
      WideString( "NS_MyService" ), WideString( "ComplexType1" ) );
   RemTypeRegistry()->RegisterXSClass( __classid(ComplexType2),
      WideString( "NS_MyService" ), WideString( "ComplexType2" ) );
...
}

And when I finally use the web service, for example, in a button click
event:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
   _di_MyServicePort my_service;
   HTTPRIO1->QueryInterface( my_service);
   if ( my_service)
   {
      ComplexType1 *request = new ComplexType1();
      request->Field1 = "Data1";
      request->Field2 = "Data2";
      ComplexType2 *response = new ComplexType2();
      my_service->MyService( *request, *response );            // Here is
where I get the
      .....
      delete request;
      delete response;
   }
}

I get the following compiler error: E2459 VCL style classes must be
constructed using operator new

What am I doing wrong????

Thank you in advance for your help!!!

Puri Vidal
Technical Details
Message-ID: <41ad932c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.wiretrip.org!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,f6096c15c18b8195,start
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Puri Vidal" <pvidal@kilowattsa.es>
Newsgroups: borland.public.cppbuilder.internet.web
Subject: Help please!!
Date: Wed, 1 Dec 2004 10:47:39 +0100
Lines: 74
Organization: Kilowatt S.A.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 80.224.0.116
Message-ID: <41ad932c$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1101894444 80.224.0.116 (1 Dec 2004 01:47:24 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.wiretrip.org!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail