5 Replies Latest reply on Sep 5, 2008 9:05 AM by RandyShaffer

    Web Service Response Truncated

    RandyShaffer
      In my AIR application built with Flex Builder 3, I'm successully calling a web service and returning a response. The response includes an object that contains fifty-four data fields of a mixture of String, Number, and Boolean types. No string fields are outrageously long. The entire resonse is 4.5k. As I look at this resonse object get populated in the debugger, I see valid data up to about half way thru the object. Then for each field thereafter, I see a bunch of NULL and NaN values for fields that should have data. There is nothing wrong with the service or my machine/OS configuration, for I am able to call the service through other means and capture the valid response.

      Are there any ideas about what could be going on here and how I might fix it? This is a critical piece of functionality in a demo of our product to potential customers. Any help would be greatly appreciated. Thanks.
        • 1. Re: Web Service Response Truncated
          bitwyse Level 1
          I use web services a lot and I sympathize with your issue. I struggle with similar issues and I found this great utility that will help you confirm if your webservice is returning the data correctly to Flex. I know you said it works in other applications but who knows if flex is calling it correctly etc. This utility is been the most amazing tool in helping me resolve web service issues.

          http://www.charlesproxy.com/

          Once you can confirm the data being returned is good you can try several things in flex. Try changing your result format to object or e4x etc. See how that plays out. Not sure where your tapping in to look at your debugger, you might want to catch it right at the result handler before converting to any collections. . .

          If nothing here helps maybe post some code to look at. . .
          • 2. Re: Web Service Response Truncated
            RandyShaffer Level 1
            Thanks bitwyse. I tested the webservice with the open source tool soapUI. I am quite certain the service response is valid. The real problem is that I want to use that result to invoke another web service. I tried fudging the call by creating a valid response object from scratch. Unfortunately, it looks like Flex cannot marshall the message correctly either way.

            So, going further down this fudging path for purposes of my demo, is there a way to post the raw xml to the service? As I say, I have a good SOAP response so I think that may work.
            • 3. Re: Web Service Response Truncated
              bitwyse Level 1
              Hey Randy,

              I'm sure you can look at the code behind the webservices and see how to post the raw xml to the service. I've never done that so I can't help you there. . .

              You should post some of your code here with the xml results. I've been using web services with flex extensively for the last year and have been quite successful with it. Maybe having another set of eyes look at the code will help.
              • 4. Web Service Response Truncated
                SujitG Level 2
                Hi,
                For posting raw XML, try URLRequest. Set the XML to the data property of the URLRequest and send you request. Please find more details at the URL below.

                http://livedocs.adobe.com/flex/3/langref/flash/net/URLRequest.html

                Hope this helps.
                • 5. Re: Web Service Response Truncated
                  RandyShaffer Level 1
                  Thank you all for your help. We have control over the server that exposes the web services, so what I am going to do is drop a servlet there that handles the operation. I can pass minimal data in URL parm fields to the servlet. This is a much cleaner fudge and it avoids the Flex marshalling bugs and the mess of handling raw XML.