3 Replies Latest reply on May 9, 2009 6:32 AM by Gregory Lafrance

    how to send xml data with the xml tag

    mickey3 Level 1

      Hi

       

      You know how when you use the HttpService component you would send flex xml data something like this:

       

         <mx:HTTPService id="userRequest" url="http://localhost/myproj/request_post2.php" useProxy="false" method="POST">
              <mx:request xmlns="">
                  <username>{username.text}</username>
                  <emailaddress>{emailaddress.text}</emailaddress>
              </mx:request>
          </mx:HTTPService>

      The problem is i need to include <?xml version="1.0"?> together with the request body would you guys tell me how i can do that?

      As I always end up getting a syntax error when i try to include it in the <mx:request> body.

      My last attempt was this:

      var requestXml:XML = new XML('<?xml version="1.0"?><site link="http://localhost:8080/mcfserver/sites/4/config" name="JUnit Test Site" id="4"><config><job>test data</job></config></site>');
      saveSiteHttp.request = requestXml;

      which didn't work. And this too: saveSiteHttp.request = requestXml.toString();

      It always ended up in the backend without the <?xml...> xml tag. Do note i also tried encoding it &%63; and nothing works.

      So this is driving me crazy.

      Thanks.