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?

In the wsdl file that I am accessing, some of the tags it has are as
below. It does not have style property in soap binding tag, but is in
operation tag. Is that OK? or does flex expect it to be in soap
binding tag and hence give me this error?



Attached is the code I am using for Action Script:

<?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>



WSDL file:

- <wsdl:binding name="abc" type="tns:IJK">
<wsp:PolicyReference URI="#XYZ" />
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"; />
- <wsdl:operation name="RequestDetails">
<soap12:operation soapAction="http://tempuri/RequestDetails";
style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>



Reply via email to