Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XMLHTTP calling a method
Message
 
À
08/05/2008 13:25:11
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01315904
Message ID:
01315929
Vues:
19
>There is a method on the server called submitRealtimeRequest. Using XMLHTTP, is this the correct way to call that method? This returns .NULL. for me, but I'm not sure if it's because the method is never called, or if it is the response from the method.
>
>
>lcXML = lxmlObj.Open("submitRealtimeRequest", TextRequestMessage)
>
No, it's not the correct way (I'm assuming this is a SOAP call). The actual usage of XMLHTTP is usually:
DECLARE Sleep IN WIN32API ;
         INTEGER nMillisecs

lcURL = "http://www.127.0.0.1/SomePage.asmx/MethodName" && Fill in with your info
loXML = CREATEOBJECT("MSXML2.XMLHTTP")
loXML.open("POST", lcURL)
lcSOAP = "SOAP message here"
loXML.send(lcSOAP)

DO WHILE loXML.readyState < 4
   Sleep(100)
   * Add code for timeout here...
ENDDO

IF loXML.readyState = 4
   * Parse response
   lcResponse = loXML.responseText
ENDIF
Building the soap message is actually a major pain. It seems every platform implements this slightly differently and it usually takes alot of messing around with the format to get it right.

This link may help (or not, depending on whether you're calling a .NET server):

http://support.microsoft.com/kb/893659

I don't have any cookbook style code to help here (I've done this a few different times and hated it every time I needed to get this to work).
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform