Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Soap Toolkit 2
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Divers
Thread ID:
00476542
Message ID:
00477203
Vues:
23
This is some code I used for testing which was originally provided by Randy Brown...

+++ Rick ---
#DEFINE SOAP_ENV	"http://schemas.xmlsoap.org/soap/envelope/"
#DEFINE CALC_NS		"uri:Calc"

CLEAR ALL
CLEAR
cValue1 = "8"
cValue2 = "2"

? Execute("Add")
? Execute("Subtract")
? Execute("Multiply")
? Execute("Divide")

FUNCTION Execute(lcAction)
oConn = CREATEOBJECTEX("SoapSdk.WinInet.HttpLib","","")
oSer = CREATEOBJECTEX("MSSOAP.SoapSerializer","","")
oRead = CREATEOBJECTEX("MSSOAP.SoapReader","","")
oConn.Property("EndPointURL") = "http://localhost/MSSoapSamples/CalcVB.asp"
oConn.Connect(null)
oConn.Property("SoapAction") = "uri:"+lcAction
oConn.BeginMessage(null)
oSer.Stream = oConn.InputStream
oSer.startEnvelope()
oSer.startBody()
oSer.startElement(lcAction,CALC_NS,"","m")
oSer.startElement("A")
oSer.writeString(cValue1)
oSer.endElement()
oSer.startElement("B")
oSer.writeString(cValue2)
oSer.endElement()
oSer.endElement()
oSer.endBody()
oSer.endEnvelope()
oConn.EndMessage()
oRead.Load(oConn.OutputStream)
*z = oRead.DOM
*y = z.documentElement

RETURN GetMethodResult(oRead)

Function GetMethodResult(Reader)

    Doc2 = Reader.DOM
    Elm = Doc2.documentElement

    Elm = GetChildElm(Elm, "Body", SOAP_ENV)
    If ISNULL(Elm)
      	? "Error 513"
		RETURN
    EndIf
    
    Elm = GetChildElm(Elm, "Fault", SOAP_ENV)
    If ISNULL(Elm)
        RETURN ""
    Else
        Elm = GetChildElm(Elm, "faultstring", "")
        IF ISNULL(Elm)
        	? "Error 513"
			RETURN
        EndIf
        RETURN Elm.Text
    EndIf
EndFunc

Function GetChildElm(ParentElm, ChildBaseName, ChildNamespaceURI)
  ChildElm = ParentElm.firstChild
  DO WHILE !ISNULL(ChildElm)
      IF ChildElm.nodeTypeString = "element"
          IF ChildBaseName = "" OR ChildElm.baseName = ChildBaseName
              IF ChildNamespaceURI = "" OR ChildElm.namespaceURI =
ChildNamespaceURI
                  RETURN ChildElm
              ENDIF
          ENDIF
      ENDIF
      ChildElm = ChildElm.nextSibling
  ENDDO
  RETURN .null.
EndFunc
>Hi Rick,
>
>VFP seems to be producing all class and method names in lower case.
>
>I think the problem that I am facing is due to the fact that VFP6 COM dll expose the input an output parameters of method as VARIANT datatype. With the Soap ToolKit 2 Beta 1, VARIANT datatype is not supported.
>
>Can you provide me with some samples on those low level calls ? Thanks.
>
>
>Regards,
>Kueh.
>
>>>Has anyone got soap toolkit 2 to work with VFP6? Thanks.
>>
>>Yes, you have to use the low level objects. The proxy object doesn't work at this point due to case sensitivity issues with VFP's typelibraries...
>>
>>This will supposedly be fixed in the next version of the toolkit.
>>
>>This means you have to write a fair amount of code now to make those COM calls.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform