2 Replies Latest reply on Sep 9, 2009 7:44 AM by PrinceKheldar

    WebService Unrecognized binding style error

    RBKB Level 1
      I am trying to access a webservice method throught action Script. I just need to call a method " RequestSomeMethod"and send 2 parameters. But am getting following error :

      RPC Fault faultString="Unrecognized binding style 'null'. Only 'document' and 'rpc' styles are supported." faultCode="EncodingError" faultDetail="null"

      I am not expecting anything back from the webservice. I just need to call the method so that it takes some action.

      Can please somebody help me with this and tell me why am I getting this error and how to get rid of it?

      Attacjed is the code I am using:

      <?xml version="1.0"?>

      <mx:Button xmlns:mx=" http://www.adobe.com/2006/mxml" click="useWebService()" width="80%" >
      <mx:Script>

      <![CDATA[
      import mx.rpc.soap.LoadEvent;

      import mx.controls.Alert;
      import mx.rpc.http.HTTPService;
      import mx.rpc.soap.WebService;
      import mx.rpc.events.ResultEvent;
      import mx.rpc.events.FaultEvent;

      private var ws:WebService;
      private var para1:Number;
      private var para2:int;

      override public function set data(value:Object):void
      {
      para1=1;
      setStyle("color", "red");
      enabled=false;
      label ="Do not click";
      para2=0

      }



      public function useWebService():void {
      ws = new WebService();

      ws.addEventListener("fault", faultHandler);
      ws.addEventListener(LoadEvent.LOAD,wsLoaded);
      ws.addEventListener(ResultEvent.RESULT, result_listener);
      ws.wsdl= "someurl?wsdl";
      ws.loadWSDL();

      }

      private function wsLoaded(loadEvent:Event):void{
      ws.RequestSomeMethod(para1, para2);
      }

      public function echoResultHandler(event:ResultEvent):void {
      Alert.show("WSDL returned");
      }



      public function faultHandler(event:FaultEvent):void {
      trace(event.fault);
      }

      public function result_listener(event:ResultEvent):void {
      }

      ]]>
      </mx:Script>

      </mx:Button>