cancel
Showing results for 
Search instead for 
Did you mean: 

How to call SAP web services from Adobe Flex 2

Former Member
0 Kudos

Hi,

I would like to be able to call SAP (bapi) web services from a flex application.

To do this, I created a simple web service

(see: /people/sridhar.k2/blog/2006/09/12/creating-and-exposing-bapi-as-web-service-and-using-it-in-web-dynpro).

Since the Netweaver server 2004s is in a different domain than my development pc I have installed Flex data services 2 express on my local pc.

Can anyone explain me how to reach the bapi web service on the SAP system?

The data service installation documentation mentions:

<b>SAP NetWeaver</b>

SAP NetWeaver requires that Flex Data Services 2 be deployed in an Enterprise Application Archive (EAR) file. To deploy Flex Data Services 2 on SAP NetWeaver, perform the following steps:

1 Create an EAR file that contains the flex.war file, along with the files required by SAP in the ear-root/META-INF folder.

2 Update the NeverCompressed property of the HTTP Provider Service, to include *.swf, application/x-shockwave-flash, application/xml and application/x-amf.

3 Deploy the EAR file.

Do I need to deploy this EAR from eclipse? and what is meant by 'along with the files required by SAP' in step 1?

Perhaps we could combine some information to add a Flex2 / SAP blog?

Regards,

Raymond Does

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Raymond,

1. To consume WebService in Flex you don't need FDS at all.

2. AFAIK, you need crossdomain.xml at WS host or System.allowDomain("ws-host") or System.allowInsecureDomain("ws-host") on Flex side. Check Flex documentation.

3. Better to discuss this topic in some other forum -- say WebAS General. It's not related to WD

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hello Valery,

Thanks for your quick response. I know it is not WD related but I was not sure where to put it. Last question: do I place the System.allowDomain("ws-host") or System.allowInsecureDomain("ws-host") settings in the Flex code? And if so, do I not need to place the crossdomain.xml at the WS? Or do I have to do both?

Regards,

Raymond

Former Member
0 Kudos

Raymond,

Call for System.allow* should be in Flex application -- if it should, just study Flex docs.

AFAIK, crossdomain.xml on server that hosts WS is necessary -- see http://www.adobe.com/devnet/flex/articles/helloworld.html

VS

Former Member
0 Kudos

Thanks Valery,

I will try this as soon as possible.

Regards,

Raymond