postUrl problem - XML beginner

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


  1. map a_update_client.test_saasu(string Client_Code)
  2. {
  3.     c  =  Clients_Form  [Card_ID == input.Client_Code];


  4.     myFields = "&lt;givenName>" + "John" + "&lt;/givenName>" + "<br />";
  5.     myFields = myFields + "&lt;familyName>" + "Smith" + "&lt;/familyName>" + "<br />";
  6.     myFields = myFields + "&lt;organisationName>" + c.Customer + "&lt;/organisationName>" + "<br />";
  7.     myFields = myFields + "&lt;email>" + c.Client_Email + "&lt;/email>" + "<br />";
  8.     myFields = myFields + "&lt;tags>" + c.Office + "&lt;/tags>" + "<br />";

  9.     FinalDest1 = "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?><br />";
  10.     FinalDest1 = FinalDest1 + "&lt;tasks><br />";
  11.     FinalDest1 = FinalDest1 + "&lt;insertContact><br />";
  12.     FinalDest1 = FinalDest1 + "&lt;contact uid=\"0\"><br />";

  13.     FinalDest = FinalDest1 + myFields;
  14.     FinalDest = FinalDest + "&lt;/contact><br />";
  15.     FinalDest = FinalDest + "&lt;/insertContact><br />";
  16.     FinalDest = FinalDest + "&lt;/tasks><br />";

  17.     url = "https://secure.saasu.com/webservices/rest/r1/Tasks?wsaccesskey={mykey}&FileUid={myFileUID}";

  18.     FinalDest = FinalDest.toString();
  19.     ServerResp = postUrl(url, FinalDest,false);

  20.     info FinalDest;

  21.     return ServerResp;
  22. }

ANY assistance would be appreciated.

Anna