4 Replies Latest reply on Sep 24, 2010 1:17 PM by joaop.ribs

    Help: SOAP Response Fault when big string is returned

    joaop.ribs

      Hello all, I'm quite newbie on Flex and SOAP, so sorry if I'm making an obvious question

       

      I  have an application in Flex that consumes a webservice, and everything  runs smoothly until I try to return a big string, which I find to be  odd. In my tests, when the string is over 490 characters, I get the  following message:

       

      SOAP Response cannot be decoded. Raw response: faultCode="DecodingError" faultDetail="null"

       

      I  made a PHP client, just for testing, to consume the same webservice,  that calls the same operation. But in this other client, I get no errors  and the string is returned complete, with no problems.

       

      Sorry for my english, and any help will be very appreciated! Thanks!

       

      Here is my script:

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
          <fx:Script>
              <![CDATA[
                  import mx.collections.ArrayCollection;
                  import mx.rpc.events.ResultEvent;           
                  [Bindable]private var testValue:String;
                  protected function floappService_variableTestResultHandler(event:ResultEvent):void
                  {
                      this.testValue = event.result as String;
                  }
              ]]>
          </fx:Script>
          <fx:Declarations>
              <s:WebService id="ws"
                            wsdl="mywebservice?wsdl"
                  <s:operation name="variableTest"
                               result="floappService_variableTestResultHandler(event)"
                               fault="mx.controls.Alert.show(event.fault.faultString)"/>
              </s:WebService>
          </fx:Declarations>
          <mx:VBox width="100%" height="100%">
              <mx:Form width="100%" height="100%">
                  <mx:FormItem>
                      <mx:HBox>
                          <s:Button label="Variable Test" click="ws.variableTest()"/>
                          <mx:Text text="{testValue}"/>
                      </mx:HBox>
                  </mx:FormItem>
              </mx:Form>
          </mx:VBox>
      </s:Application>