Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

System prerequisites to call a webservice from flex

Avatar

Level 1
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
1 Reply

Avatar

Level 2
is your second machine connected to internet? what happens if
you put the url
http://localhost:7531/SapMiddleTier/REST/ewcs/service/rfct
in a web browser on that machine?