3 Replies Latest reply on Sep 8, 2008 9:20 AM by Newsgroup_User

    WebService request whitespace trim

    soastation
      I have found that when invoking a WebService at runtime the space at the end of a string in a request gets trimmed. This there anyway this can be avoided?

      Here's some code snippets...

      <mx:WebService id="trimTestWS" wsdl="TrimTest?WSDL">
      <mx:operation name="trimtest" resultFormat="e4x" fault="faultHandler(event)" result="resultHandler(event)" />
      </mx:WebService>

      <mx:Script>
      <![CDATA[
      private function init():void {
      trimTestWS.trimtest.request.data = "ABC ";
      trimTestWS.trimtest.send();
      }

      I have found with the above that the XML sent from from flash player has <data>ABC</data> rather than the expected <data>ABC </data>. Is there someway I can preserve the space?

      Thanks in advance.
        • 1. Re: WebService request whitespace trim
          Level 7

          "soastation" <webforumsuser@macromedia.com> wrote in message
          news:ga3h3k$473$1@forums.macromedia.com...
          >I have found that when invoking a WebService at runtime the space at the
          >end of
          > a string in a request gets trimmed. This there anyway this can be avoided?
          >
          > Here's some code snippets...
          >
          > <mx:WebService id="trimTestWS" wsdl="TrimTest?WSDL">
          > <mx:operation name="trimtest" resultFormat="e4x"
          > fault="faultHandler(event)" result="resultHandler(event)" />
          > </mx:WebService>
          >
          > <mx:Script>
          > <![CDATA[
          > private function init():void {
          > trimTestWS.trimtest.request.data = "ABC ";
          > trimTestWS.trimtest.send();
          > }
          >
          > I have found with the above that the XML sent from from flash player has
          > <data>ABC</data> rather than the expected <data>ABC </data>. Is there
          > someway I
          > can preserve the space?

          Look at the prettyPrinting and ignoreWhiteSpace properties of the XML
          object.


          • 2. Re: WebService request whitespace trim
            VarioPegged Level 2
            Try
            ...
            <mx:operation name="trimtest" resultFormat="e4x" fault="faultHandler(event)" result="resultHandler(event)" ignoreWhitespace="false" />
            ...
            TS
            • 3. Re: WebService request whitespace trim
              Level 7

              "VarioPegged" <webforumsuser@macromedia.com> wrote in message
              news:ga3i24$563$1@forums.macromedia.com...
              > Try
              > ...
              > <mx:operation name="trimtest" resultFormat="e4x"
              > fault="faultHandler(event)" result="resultHandler(event)"
              > ignoreWhitespace="false" />

              He's getting the problem on the sending side, not the receiving side. I
              think he needs to set the format on the global XML object, not on the
              service.