cancel
Showing results for 
Search instead for 
Did you mean: 

WebService to RFC Interface

Former Member
0 Kudos

Hi All,

I'm working on a WebService to SAP(RFC) scenario using an SAP PI interface. We are using SAP PI 7.1 version.

The customer data will be pushed from the 3rd party system to WebService created & published by SAP PI and will flow to SAP ECC and in turn SAP ECC will create a Customer in SAP & will return the same back to the 3rd party system.

How shall I proceed with XI interface developements since I'm working on this scenario for the 1st time? Also what BAPI I should use for Customer Creation in SAP?

Is it possible through Webservice exposed by SAP PI? I have worked on HTTP to RFC scenario. Is there any differences in both the scenarios?

       

Thanks & Regards,

Amit Patil

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>How shall I proceed with XI interface developements since I'm working on this scenario for the 1st time? Also what BAPI I should use for Customer Creation in SAP?

On the receiver side you can try both RFC or Server Proxy. On the sender side SOAP adapter is the better choice. HTTP adapter plain is considered for  the simplest form of webservice which does not need soap header and complex structure.  search sdn for SOAP Sender and PROXY or RFC receiver for this.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Amit.

Also what BAPI I should use for Customer Creation in SAP?

You can use BAPI_CUSTOMER_CREATE to create a new customer.

Is it possible through Webservice exposed by SAP PI? I have worked on HTTP to RFC scenario. Is there any differences in both the scenarios?

Yes,it is possible and the clear explanation by Grzegorz and you can search in scn also you will get lot of information on that.

Regards

Kalyan

former_member184681
Active Contributor
0 Kudos

Dear Kaylan, Amit,

Actually, BAPI_CUSTOMER_CREATE comes from 3.0A version of SAP. I would definitely recommend the newest version instead: BAPI_CUSTOMER_CREATEFROMDATA1.

Hope this helps,
Greg

Former Member
0 Kudos

Hi Greg

I agree with you...

Regards

Kalyan

Former Member
0 Kudos

Hi All,

I tried with a basic scenario of SOAP sender to RFC receiver and created an .wsdl file with below link. Basic scenario of passing two integers and one string(having symbol like plus/minus/multiply/divide) and getting back the integer result.

http://sever_hostname:server_port/XISOAPAdapter/MessageServlet?channel=:BS_CRM:CC_TEST_SEND&vers...

Is this link looking like the valid one? Since I'm working on this scenario first time.

Then I tried to open that link in the browser with ?wsdl extension, but it shows an window having below contents.

"server host name:server port no" requires an username and passward. The server says:XISOAPApps.

Also when I tried to consume this through a software, it throws below error.

Please guide me on this. What's going wrong here?

Thanks & Regards,

Amit Patil

former_member184681
Active Contributor
0 Kudos

Hi Amit,

The URL you are using looks correct. The problem is simple - you did not provide user credentials to authenticate your calls from external application to PI. You need to type a PI's username and password in the sender application, to authenticate the calls with this user.

Hope this helps,
Greg

Former Member
0 Kudos

Hi Greg,

I haven't specified any authentication in sender SOAP addapter channel here.

We are using PI 7.1. Is there any such provision of authentication?

Any thing else which is important to be specified in design or configuration which I might be missing?

Thanks,

Amit Patil

former_member184681
Active Contributor
0 Kudos

It's hard to say about the rest of your configuration, since you get this error at the very beginning. Still, authentication in SOAP sender is required by PI and there is no chance to avoid this. OK, there are some, but I would not recommend any of those... Have a look at my blog here if you need further details on authentication options for SOAP sender: http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/03/07/a-closer-look-at-soap-sender-auth...

All in all, provide the credentials in the sender system and just test again to get to know if you are missing anything else

Hope this helps,
Greg

rajasekhar_reddy14
Active Contributor
0 Kudos

How do you testing the interface? are you using SOAP UI or WS Navigtaor?

You have to provide credentials then only your req would hit PI system.

If you are using any evnironemt like .net/java to call your PI system, in implementation code you have to pass PI credetials .

Regards,

Raj

Former Member
0 Kudos

Hi All,

Where do I need to specify these authentication details for SOAP sender channel?

Also I found below content on your specified blog.

"The sender SOAP adapter does not require a SOAP action, but you always have

to apply logon data when using the SOAP adapter. In the central adapter engine

you can use a service user such as xiappluser; in a non-central adapter

engine or a PCK you must use one of the user names assigned to security role

xi_adapter_soap_message for component XISOAPAdapter."

What TCode is there to see the details of User and Passoword (XIAPPLUSER & pass) in SAP PI?

Also I'm using "wizdal" software to test the generated .wsdl file from the local network wherein my SAP resides.

Thanks,

Amit Patil

former_member184681
Active Contributor
0 Kudos

Dear Amit,

>>> Where do I need to specify these authentication details for SOAP sender channel?

It is not in the sender channel, but in the sender system, where you type the user credentials.

>>> What TCode is there to see the details of User and Passoword (XIAPPLUSER & pass) in SAP PI?

You cannot see a password assigned to any user - it's a matter of system security. Instead, you should ask your Basis team to provide you with some technical username and password, dedicated for authenticating SOAP calls from your sender system.

>>> Also I'm using "wizdal" software to test the generated .wsdl file from the local network wherein my SAP resides.

It really depends on the test tool you are using. For instance, in SOAP UI test tool that I am using, you provide the logon credentials at the bottom of the application window, like that:

Just look around the app you use, and you should find the right place easily.

Hope this helps,
Greg

iaki_vila
Active Contributor
0 Kudos

Hi Ammit,

Besides the URL issue you should verify that the user who is going to test the scenario must be the next role SAP_XI_APPL_SERV_USER.

More information about the necesaries roles:

http://help.sap.com/saphelp_nwpi71/helpdata/de/d4/d12940cbf2195de10000000a1550b0/content.htm

http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/e47e886a742951e10000000a11466f/content.htm

Regards.

Former Member
0 Kudos

Hi All,

I'm through with my interface successfully. I tested the webservice by pushing the data through Altova XML spy s/w using some login details(user n pass).

Below is the webservice link which I found at the bottom of the wsdl generated.

http://server hostname:server port/XISOAPAdapter/MessageServlet?channel=:BS_CRM:CC_TEST_SEND&version=3.0&Sender.Service=BS_CRM&Interface=http%3A%2F%2Fbccl.com%2Fxi%2Ftbsl%5ESI_OUT_SYN_TEST

But the 3rd party says that they are able to see the webservice's code when it is opened in the browser with ?wsdl extension. I'm also unable to view the code (in .wsdl file) when the webservice is opened in browser. It shows below message.

Message Servlet is in Status OK

Status information:

Servlet com.sap.aii.adapter.soap.web.MessageServlet (Version $Id: //tc/xpi.adapters/NW711_04_REL/src/_soap_application_web_module/webm/api/com/sap/aii/adapter/soap/web/MessageServlet.java#6 $) bound to /MessageServlet

Classname ModuleProcessor: null

Lookupname for localModuleProcessorLookupName: localejbs/ModuleProcessorBean

Lookupname for remoteModuleProcessorLookupName: null

ModuleProcessorClass not instantiated

ModuleProcessorLocal is Instance of $Proxy138

ModuleProcessorRemote not instantiated

So i shared .wsdl file with the 3rd party having complete code of that webservice. But they are asking for webservice link only.

Is there any difference in physical existence of the webservice published by SAP system and webservice published by non-SAP system?

Please guide.

Thanks,

Amit Patil

former_member184681
Active Contributor
0 Kudos

Hi,

This is a normal behavior you observed - WSDL URL and web service binding target URL are always different (at least "?WSDL" is the difference). Normally, parties are able to handle .wsdl file and WSDL URL equally well. But if your 3rd party only wants an URL, you can get it easily from PI and deliver to them. Proceed as follows: when you generated the .wsdl file, I believe you right-clicked the Sender Agreement and chosen "Display WSDL", then used the Save button to save the WSDL file. But in addition to it, there is also the WSDL URL there, that you can simply copy-paste to send it to the 3rd party. See here:

Hope this helps,
Greg

Former Member
0 Kudos

Hi All,

The 3rd party wants us to include fault message type(request & response message types are already incorporated) in the WebService published by SAP like below.

<wsdl:operation name="crmPaymentReceived">

<wsdl:input name="crmPaymentReceivedRequest" message="tns:crmPaymentReceivedRequest"></wsdl:input>

<wsdl:output name="crmPaymentReceivedResponse" message="tns:crmPaymentReceivedResponse"></wsdl:output>

<wsdl:fault name="SQLException" message="tns:SQLException"></wsdl:fault>

</wsdl:operation>

How to incorporate this in the SAP PI interface? Rest all is according to 3rd paty system. We

Thanks,

Amit Patil

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You need to create fault message as another response type for both outbound and inbound service interface and do the mapping for the fault message too. After implementation, regenerate WSDL and share it to the sender system. Fault message is designed to provide meaningful application errors to the sender system. If the RFC provides error during save the data, you can pass those errors to the sender sytem via this message.


To do fault message see the links below. 

http://scn.sap.com//people/jin.shin/blog/2007/05/21/handling-web-service-soap-fault-responses-in-sap...

http://scn.sap.com/people/shabarish.vijayakumar/blog/2006/11/02/fault-message-types--a-demo-part-1

http://help.sap.com/saphelp_nwpi711/helpdata/en/48/5946db5f693912e10000000a42189b/content.htm

Message was edited by: Baskar Gopalakrishnan

Former Member
0 Kudos

Hi All,

In my case, its an synchronous scenario and I would like to handle the fault message types also as per 3rd party system.How would I achieve this?

I'm taking care of all the error codes and its details through two export parameters(STATUS & MESSAGE) of RFC response.

How shall I map in fault message types with RFC's Exception parameters?

Also what are the exception parameters (to be handled in RFC) that are possible in this case?

Thanks,

Amit Patil

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>In my case, its an synchronous scenario and I would like to handle the fault message types also as per 3rd party system.How would I achieve this?

Answered above. Please refer the links.  Message can hold request, response and fault message. In your case if there is no application error, you will be using response message otherwise fault message. Did you go through my reply links?

How shall I map in fault message types with RFC's Exception parameters?

Are you using custom RFC structure? As you know RFC can support request,response and fault message. In this interface you do three mappings. Webservice req to RFC req, RFC resp to Webservice resp,  RFC Fault mesg resp to Webservice Fault mesg resp.  You basically create fault message on the sender interface and target interface. Do the third mapping. That's it. Refer the links attached.

>Also what are the exception parameters (to be handled in RFC) that are possible in this case?

Search SDN for RFC fault message handling for further details. This depends on the requirement.

Former Member
0 Kudos

Hi All,

I have 3 mappings req, resp & fault. Through fault mesg mapping I'm replying system failure or communication failure in which I have mapped RFC exception with standard fault mesg type like below.

The 3rd party system wants me to handle error mesg codes & error mesg types through fault mesg mapping. This I have already handled through resp mesg mapping. They want resp mesg mapping to take care of only successful resp cases.

How do I achieve this?

Also I have 3 various operations customer creation, order creation & product creation which I'm handling through 3 various interfaces(i.e. 3 diff webservices to be published to 3rd party). Is it possible that 3rd party can consume single webservice which contains 3 diff operations/methods to be invoked as per requiremnt?

Thanks,

Amit Patil

Former Member
0 Kudos

Hi All,

Any update on the above issue?

Thanks,

Amit Patil

Former Member
0 Kudos

Hi Amit,

I also have the same requirement. I am getting the error "no mapping program found" whenever the RFC retruns the rfc.exception. Because i have not mapped the exception. Interface is working fine if I proper response from rfc(rfc.response). Can you please let me know if you found a way for your problem?

Thanks,

Arivarasu S

Former Member
0 Kudos

Hi All,

If we are using older version of SAP XI 3.0 service pack-16 (Netweaver 4.0), then is it possible to create an scenario of webservice to RFC into it?

I already tried with it in SAP PI 7.2 version and got it done successfully for making it live.

Now I tried it in SAP XI 3.0 version, but I don't find the option of "display wsdl" when I right click on sender agreement.

Kindly guide me on this ASAP.

Thanks,

Amit Patil

Former Member
0 Kudos

Hi All,

Can anybody guide me in this case? I desperately need the guidance in this issue.

Thanks,

Amit Patil

former_member184681
Active Contributor
0 Kudos

Hi,

For generating the WSDL in XI 3.0, use the document below as a guideline:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/5f3ee9d7-0901-0010-1096-f5b548ac1...

Regards,

Greg

Former Member
0 Kudos

Hi Grzegorz,

Thanks for the reply.

I can generate the .wsdl file in SAP XI 3.0 by using the same method which you suggested in the link.

But when 3rd party asks to share the webservice link(which when opened in the browser, shows the entire schema/webservice signature), what shall i share with them?

In SAP PI 7.1, we can view/generate this webservice link, when we right click on the sender agreement, Correct me if I'm wrong.

So what webservice link I can share with 3rd party? and how in SAP XI 3.0?

Thanks,

Amit Patil

former_member184681
Active Contributor
0 Kudos

Most probably, since you have provided the 3rd party with an WSDL file, the "webservice link" they are asking for is the execution target URL for calling the web service. You can ask them to confirm it, too. In order to find it, search for the following tag contents in the WSDL file:

<soap:address location="URL IS HERE"/>

Regards,

Greg

Former Member
0 Kudos

Hi Grzegorz,

The 3rd party wants executable target URL which can show wsdl signature on execution.

In SAP PI 7.1, two URL's I have got.

1. The URL link in the WSDL file (against soap:address location).

2. The URL link generated from sender agreement(right click - 'display wsdl').

I have observed, both these URL's are different. Out of which 2nd URL is executable URL.

But in SAP XI 3.0, I could generate only URL link from Integration Directory->Tools->Define Webservice. But the WSDL file generated this way has the URL link in it (against soap:address location). But this is not an executable URL link. I want the executable URL link from SAP XI 3.0.

Please help me out.

Thanks,

Amit Patil

former_member184681
Active Contributor
0 Kudos

Have a look at this blog:

Regards,

Greg

former_member184681
Active Contributor
0 Kudos

Hi Amit,

>>> Is it possible through Webservice exposed by SAP PI?
Definitely yes. PI will become the web service server, and your sender system will act as a web service client, calling the web service and passing some data to it.

>>> Is there any differences in both the scenarios?
It isn't too much different here. Instead of sender HTTP communication channel you just create an SOAP one. Then one important thing is to generate a .wsdl file from the Sender Agreement (right-click -> display WSDL -> save as a file). Then you deliver this .wsdl file to the party responsible for the sender system, they implement it as a web service description and should be able to call it based on that.

Once you have a .wsdl file, you can also test the whole scenario yourself using for instance SOAP UI free tool - just import the .wsdl file as a new project and you will be able to call the web service with test data from there, to verify the results.

Hope this helps,
Greg

iaki_vila
Active Contributor
0 Kudos

If i understand your scenario, from a third party system they will go to call a SAP PI in order to create a customer in SAP ECC endpoint. You could do a SOAP-RFC scenario, and from the third party will call the SAP PI like a webservice. You could use BAPI_CUSTOMER_CREATE to create a new customer.

Regards.

rajasekhar_reddy14
Active Contributor
0 Kudos

check below blog.

http://scn.sap.com/people/rajasekhar.reddy14/blog/2011/09/28/how-to-integrate-net-microsoft-applicat...

Check with ABAP team they will idetify existing BAPI or will develop ZBAPI(if required) but best approch is chose ABAP Proxy.