1 Reply Latest reply on Sep 26, 2011 1:57 AM by ottilie_haase

    Webservice not ready - no response

    ottilie_haase

      Hi!

       

      I hope I am in the right place to ask my question.

      I have a mobile Flex project in which I have to work with WSDL. I followed some tutorials and think that I should have everything needed to communicate with the server (the code there is implemented by a colleague of mine).

      My client side looks like this:

       

      protected function callWebService():void

      {   
           var ws:services.myservices.MyService = new MyService();
           var responder:AsyncResponder = new AsyncResponder( handleResult, handleFault );
           var token:AsyncToken = ws.MyMethod("test");
           token.addResponder(responder);
      }
                 
      private function handleResult(result:Object) : void
      {

           // not called
      }

      private function handleFault(event:Object) : void
      {

           // not called
      }

       

      I thought with the AsyncResponder added to my token one of the methods handleResult and handleFault should be called but it isn't. I don't get an exception, but there isn't a result either. Just nothing happens.

      So I debugged a little more and came to the class mx.rpc.soap.Operation.as with the method "send". I stepped through this method and everything seemed fine until I got to the end of the method where there is this piece of code:

       

      var pc:OperationPendingCall = new OperationPendingCall(argsToPass, combinedHeaders, token);   

       

      if (webService.ready)      // here ready is always false
      {
           invokePendingCall(pc);
      }
      else // if (!webService.wsdlFault)
      {
           log.debug("Queueing SOAP operation {0}", name);
           if (!pendingInvocations)
           {
                pendingInvocations = [];
           }
           pendingInvocations.push(pc);

      }

       

      Because webService.ready is always false, my SOAP call is never made I think. What can I do? Where's the problem? I couldn't find any hint...

       

      Thank you for reading and helping (hopefully)!

       

      Edit: I forgot to add that when I test my method with Flash Builder (with the GUI) I get the following error: "InvocationTargetException:Beim Erstellen der  SOAP-Anforderungsmeldung ist ein Fehler  aufgetreten. Ursache:java.lang.ArrayIndexOutOfBoundsException: 2"

      But unfortunately this is not helping me.

        • 1. Re: Webservice not ready - no response
          ottilie_haase Level 1

          I did find more things out.

          With this webservice I had no problem getting the answer I expected:

          http://www.kirupafx.com/WebService/TopMovies.asmx?WSDL

          So I tested a bit more with that and with our own webservice and finally could test the methods via the GUI when I filled out every parameter. Before, I left some of them empty (which should work on the serverside but didn't on Flash Builder side - by the way: is there a way to tell Flash Builder that it should accept empty strings?). But the XML which I got as answer didn't give a result and when I called the webservice via code the "handleResult" or "handleFault" method was still not called (but with the TopMovie webservice it was).

          My collegue and I were then testing with wireshark and found out that the two webservices use different protocols.

          TopMovie uses document-literal while he used rpc encoded. So with rpc encoded there is some security issue (http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_3.html) which is why the webservice is never really called. He has to add a crossdomain.xml on the serverside or something like that. But he is not that sure about that because with wireshark we never saw a call for that. But I'm confident that we will find out.