Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I convert the result object XML to CURSOR

Status
Not open for further replies.

TOGORO

Programmer
Jun 29, 2004
4
MX
Hi, I have the result from a WEB Service but I don't know how to reference it to convert it to cursor.

loWS = CREATEOBJECT("MSSOAP.SoapClient30")

loWS.MSSoapInit("
loResult = loWS.Busca_Incapacidad_Expediente(Expe1)

then loResult.???????


THE WEB SERVICE IS DEFINED :

<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions xmlns:http=" xmlns:soap=" xmlns:s=" xmlns:soapenc=" xmlns:tns=" xmlns:tm=" xmlns:mime=" targetNamespace=" xmlns:wsdl="- <wsdl:types>
- <s:schema elementFormDefault="qualified" targetNamespace=" <s:import namespace=" />
- <s:element name="Busca_Incapacidad_Expediente">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sExpediente" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="Busca_Incapacidad_ExpedienteResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="Busca_Incapacidad_ExpedienteResult">
- <s:complexType>
- <s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="Busca_Incapacidad_RT_Expediente">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sExpediente" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="Busca_Incapacidad_RT_ExpedienteResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="Busca_Incapacidad_RT_ExpedienteResult">
- <s:complexType>
- <s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="Busca_Incapacidad_Expediente_Fecha">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sExpediente" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="sFechaInicio" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="sFechaFinal" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="Busca_Incapacidad_Expediente_FechaResponse">
- <s:complexType>
- <s:sequence>
- <s:element minOccurs="0" maxOccurs="1" name="Busca_Incapacidad_Expediente_FechaResult">
- <s:complexType>
- <s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
- <wsdl:message name="Busca_Incapacidad_ExpedienteSoapIn">
<wsdl:part name="parameters" element="tns:Busca_Incapacidad_Expediente" />
</wsdl:message>
- <wsdl:message name="Busca_Incapacidad_ExpedienteSoapOut">
<wsdl:part name="parameters" element="tns:Busca_Incapacidad_ExpedienteResponse" />
</wsdl:message>
- <wsdl:message name="Busca_Incapacidad_RT_ExpedienteSoapIn">
<wsdl:part name="parameters" element="tns:Busca_Incapacidad_RT_Expediente" />
</wsdl:message>
- <wsdl:message name="Busca_Incapacidad_RT_ExpedienteSoapOut">
<wsdl:part name="parameters" element="tns:Busca_Incapacidad_RT_ExpedienteResponse" />
</wsdl:message>
- <wsdl:message name="Busca_Incapacidad_Expediente_FechaSoapIn">
<wsdl:part name="parameters" element="tns:Busca_Incapacidad_Expediente_Fecha" />
</wsdl:message>
- <wsdl:message name="Busca_Incapacidad_Expediente_FechaSoapOut">
<wsdl:part name="parameters" element="tns:Busca_Incapacidad_Expediente_FechaResponse" />
</wsdl:message>
- <wsdl:portType name="SERVSoap">
- <wsdl:eek:peration name="Busca_Incapacidad_Expediente">
<documentation xmlns=" las Incapacidades del Empleado, por Expediente</documentation>
<wsdl:input message="tns:Busca_Incapacidad_ExpedienteSoapIn" />
<wsdl:eek:utput message="tns:Busca_Incapacidad_ExpedienteSoapOut" />
</wsdl:eek:peration>
- <wsdl:eek:peration name="Busca_Incapacidad_RT_Expediente">
<documentation xmlns=" las Incapacidades RT del Empleado, por Expediente</documentation>
<wsdl:input message="tns:Busca_Incapacidad_RT_ExpedienteSoapIn" />
<wsdl:eek:utput message="tns:Busca_Incapacidad_RT_ExpedienteSoapOut" />
</wsdl:eek:peration>
- <wsdl:eek:peration name="Busca_Incapacidad_Expediente_Fecha">
<documentation xmlns=" las Incapacidades del Empleado, por Expediente y Fechas</documentation>
<wsdl:input message="tns:Busca_Incapacidad_Expediente_FechaSoapIn" />
<wsdl:eek:utput message="tns:Busca_Incapacidad_Expediente_FechaSoapOut" />
</wsdl:eek:peration>
</wsdl:portType>
- <wsdl:binding name="SERVSoap" type="tns:SERVSoap">
<soap:binding transport=" style="document" />
- <wsdl:eek:peration name="Busca_Incapacidad_Expediente">
<soap:eek:peration soapAction=" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:eek:utput>
<soap:body use="literal" />
</wsdl:eek:utput>
</wsdl:eek:peration>
- <wsdl:eek:peration name="Busca_Incapacidad_RT_Expediente">
<soap:eek:peration soapAction=" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:eek:utput>
<soap:body use="literal" />
</wsdl:eek:utput>
</wsdl:eek:peration>
- <wsdl:eek:peration name="Busca_Incapacidad_Expediente_Fecha">
<soap:eek:peration soapAction=" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:eek:utput>
<soap:body use="literal" />
</wsdl:eek:utput>
</wsdl:eek:peration>
</wsdl:binding>
- <wsdl:service name="SERV">
<documentation xmlns=" />
- <wsdl:port name="SERVSoap" binding="tns:SERVSoap">
<soap:address location=" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
 
loWS = CREATEOBJECT("MSSOAP.SoapClient30")
(enable MS Soap)
loWS.MSSoapInit(" (initiate the hook into the object, your Visual FoxPro DLL)
loResult = loWS.Busca_Incapacidad_Expediente(Expe1)
(make a call to one of the procedures or functions in your project's DLL where the procedure or function is named "Busca_Incapacidad_Expediente" and the parameter sent to it is the contents of the variable "Expe1". loRusult will hold the returned value.)

The WSDL file contains all the references necessary for the incoming request to be sent to the correct function within the DLL.

Does that answer your question?

Please be aware that XML wants you to use DLLs not EXEs. (Don't worry too much, a DLL can call an EXE if you need to run a report form or something else that *may* require user interaction or notification. DLLs do not allow screen/display access.)
 
You want to put loResult into a cursor? What data type is it? It could be a string, number, array, or a number of other data types. Depending on the data type, yes the result can be placed in a cursor/table. Here is how you determing the data type:

? TYPE("loResult")

? VARTYPE(loResult)
 
Thanks a lot, maybe I wasn´t so explicit, I have resolved my problem with the next instructions in Vfp 9.0

loResult = ObjXML.Busca_Incapacidad_Expediente(Expe1)

" my problem was WHAT NEXT to convert it to CURSOR "

DataXML = loResult.item(0).parentNode.xml

LOCAL oXA as xmladapter
oXA = CREATEOBJECT("XMLAdapter")
oXA.loadxml(DataXML,.F.,.T.)

IF (USED("ResulXML"))
USE IN ResulXML
ENDIF

oXA.tables[1].tocursor(.F.,"ResulXML")
BROWSE

VOILA, RESOLVED

I found it in


THANKS A LOT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top