1 Reply Latest reply on Jun 28, 2010 5:58 PM by miguel8312

    Web Service Data Connections

    _H_P_

      I want to handle events of multiple web service methods. I am not sure how I can achieve this using Flex 4 Web Service Data Connection.

       

      I am able to achieve this without using the Web Service Data Connection by using operation:

       

      <fx:Declarations>
      <s:WebService id = "myWebService"
                            wsdl = "http://some/url?wsdl"
                            fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)">
                  <s:operation name = "foo1"
                               result= "foo1_resultHandler(event)"/>
                  <s:operation name = "foo2"
                               result= "foo2_resultHandler(event)"/>
      </s:WebService>
      </fx:Declarations>
      

       

      But when I use the Web Service Data Connection( Data-> Connect to Web Service), I am not able to access the operation tag to specify the operation name. How can I handle results from multiple web service methods, as above.

       

      </fx:Declarations>
      <mywebservice:MyWebService id = "myWebService" 
                                             fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)">
      </mywebservice:MyWebService>
      </fx:Declarations>
      

       

       

      -H

        • 1. Re: Web Service Data Connections
          miguel8312 Level 3

          Instead of using the generated code why not just built your own webservice then . what you are missing

           

           


          this should do it...

           

           private function foo1resultHandler(event:ResultEvent):void
          {
          
          }
          private function foo2resulthandler (event:REsultEvent):void
          {
          
          }
          
          <fx:Declarations>
          <s:WebService id = "myWebService"
                                wsdl = "http://some/url?wsdl"
                                fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)">
                      <s:operation name = "foo1"
                                   result= "foo1_resultHandler(event)"/>
                      <s:operation name = "foo2"
                                   result= "foo2_resultHandler(event)"/>
          </s:WebService>
          </fx:Declarations>