Board index » cppbuilder » MS SOAP Toolkit

MS SOAP Toolkit

Hi Fellows,

did anyone succesfully used the MS SOAP toolkit with BCB 6 ?

I only did it work partially , each them I try to Invoke a Web Service
method it fails.

thanks,

Dave

 

Re:MS SOAP Toolkit


Quote
On Fri, 3 May 2002 16:35:30 +0200, "dave" <ddegr...@kpmg.be> wrote:
>Hi Fellows,

>did anyone succesfully used the MS SOAP toolkit with BCB 6 ?

>I only did it work partially , each them I try to Invoke a Web Service
>method it fails.

>thanks,

>Dave

This is how I did it in BCB five. I hope it helps

I did get it to work. It prefferred WideString to CComBSTR

For your reference. How to access the shakespearean quote web service.
This is BCB 5

Header file.

//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------

#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>  
#include "MSSOAPLib_TLB.h"
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE-managed Components
  TEdit *edQuotation;
  TButton *btQuote;
  void __fastcall btQuoteClick(TObject *Sender);
private:        // User declarations

  TAutoDriver<ISOAPClient> pSOAPClient;

public:         // User declarations
  __fastcall TForm1(TComponent* Owner);
  __fastcall ~TForm1();

Quote
};

//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------

CPP File

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)

{
  CoInitialize(NULL);

  pSOAPClient.Bind(CLSID_SoapClient);

  if(pSOAPClient.IsBound())
  {
    pSOAPClient->set_ClientProperty( L"ServerHTTPRequest",
VARIANT_TRUE);

    WideString
wstrWSDL("http://www.nickhodges.com/bin/ShakespeareWS.exe/wsdl/IShakespeare");
    if(SUCCEEDED( pSOAPClient->mssoapinit( (wstrWSDL), NULL, NULL,
NULL)))
    {
      pSOAPClient->set_ConnectorProperty(L"UseProxy", VARIANT_TRUE);
      btQuote->Enabled = true;
    }
    else
    {
      edQuotation->Text = pSOAPClient->faultstring;
    }
  }

Quote
}

//---------------------------------------------------------------------------
__fastcall TForm1::~TForm1()
{
  CoUninitialize();
Quote
}

//---------------------------------------------------------------------------
void __fastcall TForm1::btQuoteClick(TObject *Sender)
{                                                      
  HRESULT HRes;
  TAutoArgs<0> _args;

  HRes = pSOAPClient.Invoke(dfMethod,
WideString("GetShakespeareInsult"), &_args, true );
  TVariant vInsult(_args.GetRetVariant());
  if(vInsult.vt == VT_BSTR)
  {
    edQuotation->Text = vInsult;
  }

Quote
}

Re:MS SOAP Toolkit


Hi All and specially Marh Holland,

Thanks for the input Mark.
(I saw your post through Deja but not in my newsreader ??? stange maybe some
'censoring' is happening !! )

Your code snippet worked fine under BCB 5 indeed, but still wasn't working
in BCB 6.
(see my post of 24/4 with subject Invoke() BCB 6 problem vs BCB 5)
So until now both approachs ( via TAutoDriver and TComInterface) worked well
under
BCB 5 both none under BCB 6 !!
Is this a new major bug in BCB 6 ?
Or is it because I am using the personnal edition of BCB 6 ?

Getting clueless about this ...

Dave

Quote
"dave" <ddegr...@kpmg.be> wrote in message news:3cd2a031$1_1@dnews...
> Hi Fellows,

> did anyone succesfully used the MS SOAP toolkit with BCB 6 ?

> I only did it work partially , each them I try to Invoke a Web Service
> method it fails.

> thanks,

> Dave

Re:MS SOAP Toolkit


Hi Dave,

What is the error that you are getting? Could you send me a test case
with steps to reproduce?

Thanks,
Chris

Quote
dave wrote:
> Hi Fellows,

> did anyone succesfully used the MS SOAP toolkit with BCB 6 ?

> I only did it work partially , each them I try to Invoke a Web Service
> method it fails.

> thanks,

> Dave

Re:MS SOAP Toolkit


Quote
On Mon, 6 May 2002 16:41:08 +0200, "dave" <ddegr...@kpmg.be> wrote:
>Hi All and specially Marh Holland,

>Thanks for the input Mark.
>(I saw your post through Deja but not in my newsreader ??? stange maybe some
>'censoring' is happening !! )

>Your code snippet worked fine under BCB 5 indeed, but still wasn't working
>in BCB 6.
>(see my post of 24/4 with subject Invoke() BCB 6 problem vs BCB 5)
>So until now both approachs ( via TAutoDriver and TComInterface) worked well
>under
>BCB 5 both none under BCB 6 !!
>Is this a new major bug in BCB 6 ?
>Or is it because I am using the personnal edition of BCB 6 ?

>Getting clueless about this ...

>Dave

So did you get SOAP to work with BCB5 and now it doesn't work with
BCB6 or is this your first attempt?

If it's the latter what OS are you using? I'm pretty sure msSOAP uses
the ServerHTTP object of the msxml components which don't work on Win
95/98. Just a thought.

Other Threads