#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,