Declaring interface MSSOAPinit 
Author Message
 Declaring interface MSSOAPinit

Hi,

After the reactions on my earlier posting about SOAP I started to build an
interface for the SOAPclient. Now, the instance will be created and the
put_ConnectorProperty works fine, but when I call the MSSOAPInit method, I
receive the error "one or more arguments are invalid" (E_INVALIDARG)

BSTR    Equate(LONG)

------- interface -------
MSSoapInit               procedure(BSTR par_WSDLFile, BSTR par_ServiceName,
BSTR par_Port, BSTR par_WSMLFile),HRESULT,raw

------- Class -------
MSSoapInit               procedure(BSTR par_WSDLFile, BSTR par_ServiceName,
BSTR par_Port, BSTR par_WSMLFile),HRESULT,virtual

Is this the right declaration or not?



Sat, 24 Dec 2005 18:45:52 GMT  
 Declaring interface MSSOAPinit
usually I only pass the wsml file and pass zero for the other parameters.
here is a very simple sample app that sends and receives a soap message with
a dime attachement.  It uses my own classes which are not available to you
but the invokesetup is just a call to getidofnames. the addparameter puts
the parameter to be passed into an array required by invoke.  The call to
invoke or InvokeNoResultCall actually calls invoke and either retrieves a
result or doesnt respectively.

  program
  map
  end

include('stdcom3.inc')

stdcom3 stdcom3cltype
lpSoapclient long
lpFileattach long
lpReceivedAttachment long
wsdl1 string('http://mssoapinterop.org/stkV3/dime/dime-rpc.wsdl')
  code
  stdcom3.initcom(1) !initialize com

 !create the soap client object
  if stdcom3.GetIDispatchFromProgid('MSSOAP.SoapClient30', lpSoapClient)
then
    message(stdcom3.errorstr)
  end

  if Stdcom3.invokesetup(lpSoapClient,'MSSOAPINIT',4,'METHOD') or |
   stdcom3.addparamString(,wsdl1) or |
   stdcom3.addparamString(,'') or |
   stdcom3.addparamString(,'') or |
   stdcom3.addparamString(,'') or |
   Stdcom3.InvokeNoResultCall() then
   Message('Initializing the soap client failed')
   do procret
  end

  !Message('init worked')

  !create the fileattachement object for a single attachement
  if stdcom3.GetIDispatchfromProgid('MSSOAP.FILEATTACHMENT30',lpFileAttach)
then
    Message(stdcom3.errorstr)
  end

  !create the attachement by passing the filename to the attachement object
  if StdCom3.InvokeSetup(lpFileAttach,'FILENAME',1,'PUT') or |
    StdCom3.AddParamString(,'D:\Testin.txt') or |
    StdCom3.InvokeNoResultCall() then
   Message('cant set file attachement')
 end

  !call the echoAttachement method to send the attachment and it returns an
  ! attachement as well in the lpReceivedAttachment result
  if stdcom3.invokesetup(lpSoapClient, 'EchoAttachment',1,'METHOD') or |
    Stdcom3.addparamlong(,VT_Dispatch,lpFileAttach) or |
    Stdcom3.invokeCall() or |
    stdcom3.GetResultLong(VT_Dispatch,lpReceivedAttachment) then
   Message('error calling soap message')
  end
!lpReceivedAttachement is the returned attachement

  !save the received attachment to disk
  if stdcom3.invokesetup(lpReceivedAttachment,'SaveToFile',2,'METHOD') or |
    StdCom3.AddParamString(,'D:\textout.txt') or |
    StdCom3.AddParamLong(,VT_Bool,-1) or |
    StdCom3.InvokeNoResultCall() then
   Message('Error saving received attachment')
  end
  if exists('D:\textout.txt') then
    message('out file exists')
  end

 message('done no error')
  do procret

procret routine
  stdcom3.release(lpReceivedAttachment)
  stdcom3.release(lpFileAttach)
  Stdcom3.Release(lpSoapClient)
  stdcom3.killcom()
  return



Quote:
> Hi,

> After the reactions on my earlier posting about SOAP I started to build an
> interface for the SOAPclient. Now, the instance will be created and the
> put_ConnectorProperty works fine, but when I call the MSSOAPInit method, I
> receive the error "one or more arguments are invalid" (E_INVALIDARG)

> BSTR    Equate(LONG)

> ------- interface -------
> MSSoapInit               procedure(BSTR par_WSDLFile, BSTR
par_ServiceName,
> BSTR par_Port, BSTR par_WSMLFile),HRESULT,raw

> ------- Class -------
> MSSoapInit               procedure(BSTR par_WSDLFile, BSTR
par_ServiceName,
> BSTR par_Port, BSTR par_WSMLFile),HRESULT,virtual

> Is this the right declaration or not?



Sun, 25 Dec 2005 09:29:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. the problem of declaring a function in the interface

2. Declaring COM-interfaces in Python?

3. Interface Signatures -- an alternative to Interfaces?

4. Interfaces réparties...[Distributed interfaces]

5. implicit interface vs. explicit interface

6. X interface in Quintus prolog or C(C++) interface in Quintus prolog

7. C++ declared parody of Smalltalk ;-)

8. Newbie: FILENAME not declared?

9. Declares fails with WindowPtr?

10. Help with "Declare"

11. Automatically declaring a global object

12. Declares to Cocoa?

 

 
Powered by phpBB® Forum Software