cancel
Showing results for 
Search instead for 
Did you mean: 

XI 2.0: Expose BAPI/RFC as Web Service How To

Former Member
0 Kudos

Hello,

I'm struggling to configure the above szenario using

XI 2.0.

Can someone please point me to some step-by-step instructions on how to expose a BAPI/RFC as a

Web Service via XI?

Thanks in advance!

Torsten

Accepted Solutions (1)

Accepted Solutions (1)

p_vanos
Active Participant
0 Kudos

Hi Torsten,

Please have a look at the Web application Server--> Web Services. You see at the startpage already some documents wich describe how to generate a webservice from a function module!

Also some E-learning studies:

please look at below link!

https://www.sdn.sap.com/sdn/developerareas/webservices.sdn?node=linkDnode6-1

Also check the articles on SDN about webservices.

Cheers,

Paul

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Torsten,

I recognize your question marks as a couple of months ago I also had the same situation here.

Going back to your question; First, I assume you want to expose your BAPI/RFC through XI 2.0 and not directly from the Web AS.

If that's the case then you need to do a lot of manual/custom work by yourself. For instance, you'll need to setup your own WSDL file or even worse... code your own Web service client in order to access the web service.

Steps to follow in a nutshell:

1) Create an Outbound Synchronous interface in your SWC.

2) Create Message types/data types for the web service request and response structures.

3) Interface mapping/message mapping from web service request to BAPI/RFC request. & from BAPI/RFC response to Web Service response.

3a)Configure business scenario etc...

4) Configure SOAP and RFC adapter. You will need both to establish this interaction.

5) Configure your web service client to send/receive SOAP envelopes to the web service running on XI.

6) Test it and you are done!

Good Luck!

Rob.

Former Member
0 Kudos

Hi Rob,

Thank you for your reply!

Did you define your own message types in (2) or did you reuse the imported BAPI request / response messages?

If so, is there a way to import external .xsd-Files in XI 2.0?

Which parameters do I have to set to succesfully export a WSDL from the integration directory using "Tools/Define Web Service..."? If I use the following, the create-button is grayed out:

- Receiver Name: ST1_500 (our SAP-System)

- Interface-Name: BAPI_CURRENCY_GETLIST

- SOAP-Sender-Name: my_business_system

- SOAP-Interface-Name: CurrencyGetList (my outbound interface from point (1))

If I use my outbound interface for the receiving interface name too, I'll get an ..NotFoundException during generation.

Where is my mistake?

Torsten

Former Member
0 Kudos

Hi Torsten,

The BAPI request/response messages are available in the repository when you import the BAPI as imported object in your Software Component. So there's no need to import any XSD in this case, at least not for the BAPI. You only need to define new types for you web service request/reponse messages.

Regarding how to generate/export the WSDL file; I remember I wasn't able to export it from the directory. It seems that in XI 2.0 there is a rule that says that for interfaces using the IDOC or RFC adapter no Web Service can be generated for them.

However, you can try to export it directly from the repository, where you can select the object you want to generate a WSDL file from and save it (Tools-> Export WSDL) on your system.

Due to incompatibilities in the generated WSDL, I personally opted for a own custom Java Web Service client solution that directly calls the URL where the web service is running and passes a SOAP envelope (containing the payload) to it via HTTP.

Hope this helps, good luck!

Rob.

PS: My SOAP request looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<!-- Inbound Message -->

<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>

<SOAP:Header/>

<SOAP:Body>

<ns1:GetOpenItemsRequest xmlns:ns1='http://yourcompany.com/xi/ws/proto/' SOAP:actor='http://schemas.xmlsoap.org/soap/encoding/' xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>

<CompanyCode xsi:type='xsd:string'>UK20</CompanyCode>

<Customer xsi:type='xsd:string'>0000000020</Customer>

<KeyDate xsi:type='xsd:string'>20050206</KeyDate>

</ns1:GetOpenItemsRequest>

</SOAP:Body>

</SOAP:Envelope>