Highlighted

System prerequisites to call a webservice from flex

Asha_Athrey

05-05-2008

Hi,

I am trying to call a webservice from flex.... I am able to
run the same code on 1 machine and not on the other... What are the
system prerequisites to call a webservice from flex.....



My code goes like this:



private var myXML:XML;



private function createXML():void{

myXML = <root>

<RfcRequest name='BAPI_FLIGHT_GETLIST'>


&lt;AIRLINE&gt;{txtAirline.text}&lt;/AIRLINE&gt;,


&lt;MAX_ROWS&gt;{txtAirline0.text}&lt;/MAX_ROWS&gt;

</RfcRequest>

</root>





trace(myXML);

}



private function sendRequest():void{

createXML();

foundationService.contentType = "application/xml";

foundationService.request = myXML;

foundationService.send();

}

<mx:HTTPService id="foundationService" url="
http://localhost:7531/SapMiddleTier/REST/ewcs/service/rfct"
method="POST"/>

<mx:ControlBar>

<mx:Button label="Get Data" click="sendRequest()"/>



</mx:ControlBar>

</mx:Panel>

<mx:DataGrid width="100%" height="70%"
dataProvider="{foundationService.lastResult.root.BAPI_FLIGHT_GETLIST.FLIGHT_LIST.item}">

</mx:DataGrid>



This is the runtime error i am getting



[RPC Fault faultString="HTTP request error"
faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent
type="ioError" bubbles=false cancelable=false eventPhase=2
text="Error #2032: Stream Error. URL:
http://localhost:7531/SapMiddleTier/REST/ewcs/service/rfct"
errorID=2032]. URL:
http://localhost:7531/SapMiddleTier/REST/ewcs/service/rfct"

at mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\...

at
mx.rpc::Responder/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:49]

at
mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]

at
DirectHTTPMessageResponder/errorHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:343]

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at flash.net::URLLoader/redirectEvent()





Regards,

Asha

Replies