cancel
Showing results for 
Search instead for 
Did you mean: 

Flex2 call SAP Web Service

Raymond_Ni
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello all Experts

I create a web service from sap function. I test the web service with wsadmin and the service runs well. I'd like to use Flex2 to consume the web service for test. But I met compile error in Flex2. In my Flex application, I use <mx:WebService> component. Follow is my flex code.

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"

creationComplete="sapwebservice.BAPI_BUPA_CENTRAL_GETDETAIL.send()">

<mx:WebService id="sapwebservice"

wsdl="http://myhost:8011/sap/bc/srt/rfc/sap/ZWS_BUPA_CENTRAL_GETDETAIL?sap-client=600&wsdl=1.1&mode=sap_wsdl&style=rpc"

useProxy="true">

<mx:operation name="BAPI_BUPA_CENTRAL_GETDETAIL">

<mx:request>

<Businesspartner>0000000111</Businesspartner>

<ValidDate>2006-08-09</ValidDate>

</mx:request>

</mx:operation>

</mx:WebService>

<mx:Panel x="20" y="20" width="480" height="400" layout="absolute"

title="{sapwebservice.BAPI_BUPA_CENTRAL_GETDETAIL.CENTRALDATAPERSON.FIRSTNAME}">

</mx:Panel>

</mx:Application>

When I try to compile the code, there is error called "wsdl" must end with the ';' delimiter. Does anybody know how to call sap web service in Flex?

Many Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi there,

funny, just today experienced the same problem.

It can be solved by html-encoding the '&' in the wsdl URL. That is, replace it by '&'

It's always good to think of javascript when working with flex2.

Have fun.

anton

Message was edited by: Anton Wenzelhuemer

Former Member
0 Kudos

ooops it was supposed to be

&amp;

Former Member
0 Kudos

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

creationComplete="sapwebservice.BupaCentralGetdetail.send();">

<mx:Script>

<![CDATA[

import mx.rpc.soap.WebService;

import mx.collections.ArrayCollection;

import mx.rpc.events.ResultEvent;

import mx.rpc.events.FaultEvent;

[Bindable]

public var AAddr : String = "http://epmtest.dongbuchem.com:8000/sap/bc/srt/rfc/sap/BUPA_WSD?sap-client=100&wsdl=1.1&style=rpc";

...

<mx:WebService id="sapwebservice" wsdl=""

result="sendHandler(event)" fault="faultHandler(event)">

Message was edited by: jinhyoung park