HTTP Post to send xml-file

Post Reply
lombert
Member
Posts: 167
Joined: Fri Feb 04, 2011 2:31 pm
Location: Sweden

HTTP Post to send xml-file

Post by lombert »

I'm testing to get an status-report posted at an server and they (the other company) say that I should use HTTP Post and a xml-file to get it to work. But I think I not geting everything right. I have never used HTTP request before.

First the basic; I need to have one "file" that trigger the HTTP request, but it is not that file how is going to be send, or?

Image

When I choose the POST-type I get to select another file, is that the file how is sent?

The company say that the xml-file just needed this;

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?> <updateJob>
      <jobId>3675998</jobId>
      <jobStatus>0</jobStatus>
</updateJob>
And if I set it up like the picture, I got a response that it's ok from Switch, but nothing happening at the company system;

Request type: POST
Finished status: Ok
Status code: 200
Status description: OK
Last error:

The company is going to see if they got anything on there logs, but I wondering if I thinking wrong on my side at Switch?
Between jobs!
lombert
Member
Posts: 167
Joined: Fri Feb 04, 2011 2:31 pm
Location: Sweden

Re: HTTP Post to send xml-file

Post by lombert »

I'v got it to work with HTTP Get. HTTP Post give me an error all the time.

Code: Select all

<status message="missing xml tag">Error</status>
But now then I understand how it works is it easier to use HTTP Get for us.
Between jobs!
User avatar
andrea mahoney
Newbie
Posts: 19
Joined: Tue Jan 25, 2011 8:53 pm

Re: HTTP Post to send xml-file

Post by andrea mahoney »

Hi,

When we POST using something like curl or wget we post the xml as a quoted string to the url.

curl -d xmlstring='<?xml version="1.0" encoding="iso-8859-1" ?><updateJob><jobId>3675998</jobId><jobStatus>0</jobStatus></updateJob>' http://printer.com/External_status.asp"

Maybe instead of attaching the file you can list it using Switch Variables in the Parameters section. The Parameter would look like this with the xml in single quotes:

xmlstring='<?xml version="1.0" encoding="iso-8859-1" ?><updateJob><jobId>3675998</jobId><jobStatus>0</jobStatus></updateJob>'
Post Reply