postUrl problem - XML beginner
Hi all,
I'm a complete noob with XML, HTTP Post & the like. I have a Saasu account and I'm trying to send client details from my ZC database to Saasu.
I'm getting a response code 200 but it's not working, ie no record is created in the database. Here's the response code the saasu server is returning:
{responseCode=200, responseText=<?xml version="1.0" encoding="utf-8"?>
<tasksResponse />}
The Saasu team have had a go using the output string I provided them (FinalDest below) and they were successful - so it's something I'm doing, or not doing.
Below is the deluge code I'm using to do this (many thanks to Stephen Rhyne whose helpful posts on these forums have given me a great starting point). NOTE I am using the correct values for wsaccesskey & fileUID - i've just hidden them for the purposes of posting to a public forum
- map a_update_client.test_saasu(string Client_Code)
- {
- c = Clients_Form [Card_ID == input.Client_Code];
- myFields = "<givenName>" + "John" + "</givenName>" + "<br />";
- myFields = myFields + "<familyName>" + "Smith" + "</familyName>" + "<br />";
- myFields = myFields + "<organisationName>" + c.Customer + "</organisationName>" + "<br />";
- myFields = myFields + "<email>" + c.Client_Email + "</email>" + "<br />";
- myFields = myFields + "<tags>" + c.Office + "</tags>" + "<br />";
- FinalDest1 = "<?xml version=\"1.0\" encoding=\"utf-8\"?><br />";
- FinalDest1 = FinalDest1 + "<tasks><br />";
- FinalDest1 = FinalDest1 + "<insertContact><br />";
- FinalDest1 = FinalDest1 + "<contact uid=\"0\"><br />";
- FinalDest = FinalDest1 + myFields;
- FinalDest = FinalDest + "</contact><br />";
- FinalDest = FinalDest + "</insertContact><br />";
- FinalDest = FinalDest + "</tasks><br />";
- url = "https://secure.saasu.com/webservices/rest/r1/Tasks?wsaccesskey={mykey}&FileUid={myFileUID}";
- FinalDest = FinalDest.toString();
- ServerResp = postUrl(url, FinalDest,false);
- info FinalDest;
- return ServerResp;
- }
ANY assistance would be appreciated.
Anna