Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use the Microsoft XML HTTP object?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
00987584
Message ID:
00993346
Vues:
27
Jayesh,

Sorry for taking so long to get back to you - I had to deal with more pressing production problems and got sidetracked from this minor project. I was able to resolve the problem - it was caused by the length of the long string being sent to the server. I concatenated a string into a long string whose length was just under the 255 character VFP string literal limit but which was too long for the server to accept. I used VFP's FileToStr() to create the string and then resent it. This time the server response was 'ok'. I think that the XML HTTP object's send() method takes the long string returned from FileToStr() and sends it to the server in small packets (Why it didn't do that for the long string that I created with concatenation is a mystery). Thanks again for your help.

Steve Yeung
Flushing, NY.

This seems to network/firewall issue. Does the URL work in the browser? Can you ping the machine/IP it is hosted on?

>Jayesh,
>
>Thanks for responding! As far as I know, the URL that i'm trying to reach is not secure (It's http not https) and does not require authentication.
>
>Steve Yeung
>Flushing, NY.
>
>
>Is your URL secure? Does it require any type of authentication?
>
>>Does anyone out there know how to successfully use the Microsoft XML HTTP object to send a request to a web service for processing? I'm trying to send a long string of data to a service that will parse the string and return the parsed results in the form of another long string. The code fails at the point when the object's open() method is called - The response from the server "An error occurred while relaying your request." is returned in a VFP messagebox. I've checked the MSDN online documentation ( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceappservices5/html/wce50grfxmlhttpmethods.asp ) for usage and implemented the following code:
>>
>>
>
m.cFileString = 'A,B,C,D, ... ,X,Y,Z'   && Note: This is not the actual
                                        && string that I'm trying to send.

m.cUrl = 'http://MyServer.com/Mypath/'  && Note: This is not the
                                        && actual URL to the web
                                        && service that I'm trying
                                        && to communicate with.

m.oXmlHttpRequest = createobject("Microsoft.XMLHTTP")

with oXmlHttpRequest
     .open('POST', m.cUrl, .f.)     && Code fails here?
     .setRequestHeader("Content_Type", "text/plain")
     .setRequestHeader("Content-Length", alltrim(str(len(m.cFileString))))
     .setRequestHeader("Cache-control", "private")
     .send(m.cFileString)
     =messagebox(.responseText)
     =messagebox(.statustext)
endwith
>>Any help towards resolving the problem is greatly appreciated. Thanks!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform