3 Replies Latest reply on Sep 21, 2007 4:02 PM by psycik

    XML Editing

      I am having a hell of a time trying to get this webservice to work how I want it to. If I put the request I want inside the <mx:request> tags it works fine just as it should. But I need to dynamically create the request in xml. So I wrote all the code for that and it works perfect...except now when I send the request to the wsdl flex no longer adds the correct namespace to my XML that im sending it just leaves the tags as they are...
      So instead of:
      <tns:product><tns:items><tns:item><tns:data></tns:data></tns:item></tns:items></tns:produc t>
      It sends:
      Without any of the namespace prefix's. And the webservice im sending to does not like that at all so it wont work..

      So I tried a few things and have been searching google for days to no avail.
      I was sending the request like this:
      And that obviously didnt work since it doesnt change the namespace prefix, so i tried binding the xml in the request like this:
      And that doesnt even send a thing! and xmlcounts is defiantly populated!

      So i tried adding a namespace to the XML and that only changes the root node and not any of the child nodes, so THAT doesnt work either.

      I am out of options on what to try, someone please help.
        • 1. Re: XML Editing
          psycik Level 1
          I could really use some help with this.
          • 2. XML Editing
            try this...

            above your code put:

            var myXML:XML = <product/>;
            var tns:Namespace = new Namespace(" http://www.someurl.com");

            var productItems:XML = <tns:items><tns:item><tns:data></tns:data></tns:item></tns:items>;
            myXML.appendChild( productItems );
            • 3. Re: XML Editing
              psycik Level 1
              Thanks alot man you set me on the right track.
              I got it to work by setting each nodes namespace then doing this to add the child nodes:
              var xmlcounts4:XML = <Item></Item>;

              xmlcounts4.tnsNS::Name = "Blue";

              And that would add the child node to item like this:

              Kind of stupid how the works but at least it works. Thanks again.