I know how to submit data to a remote url using http post though a public flow service. Now I need to submit data over to a remote url via http form post instead of http post. How can I do it in the flow service or Java service? Thanks a lot for your advice.
I don’t need to use multipart/form-data since I have only one hidden variable to pass. I was able to use a html form and post the value of this variable over to an asp page and display the data received through this http form post. But when I use the http.client to do a post to this asp page, the posted data (string) was not returned at all. Please let me know if there is anything you see missing.
Thanks,
You are not guaranteed to get the same data back as you post in the form; the returned data depends on the ASP page.
What type of data are you expecting to receive in response to the form post? You’ll most likely want to use the load and query services to post the data and extract the results from the response.
I am sending a value (a string) stored in a hidden form variable and post this form data over to the asp page. I am trying to accomplish the http form submission via http client service in wm.
Actually, the asp page receives the string data in the request object and writes this data to a text file. So I know for sure the services in wm works like a http form post. I am sure the asp page works since I tested it with a html form.
I am not sure what I am missing here to make this to work via http:client…pls advise.
In the link I posted, there is a discussion of how IIS doesn’t like the way that webMethods generates requests. The discussion there was about multipart requests, but it may apply to normal HTTP posts as well. I suggest that you capture the actual HTTP request being sent by your HTML form and the one being sent by webMethods, and compare them to see why your ASP page isn’t receiving the correct data. A good tool for capturing requests is HTTPTracer, which can be found at http://lazydogutilities.com.
You need to set the url to point to the ASP page and the method to post. The POST data can be set in several different ways depending on how many variables you have. The easiest (one variable) way is to construct a string that consists of the form variable name, ‘=’, and the data and map that into the data/string field for the service.
For example if the form variable is orderID, you’ll want to map into the data/string field:
orderID=T4513A98
multiple variables can be mapped in either by changing the string to something like: