on 11-04-2013 8:02 AM
Dear experts,
I have to consume a webservice with SAP PI 7.3. The offered webservice uses SOAP protocol.
One of our customers offers a webservice that provides purchase orders and I have to map
those to iDoc ORDERS.ORDERS05.
I have gone through:
http://scn.sap.com/people/siva.maranani/blog/2005/03/01/testing-xi-exposed-web-services
http://scn.sap.com/people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
From what I understand I need an RFC that calls the webservice through PI.
"RFC -> SAP PI -> webservice".
- So to regularly check the webservice for new orders do I have to create a job in SAP ERP that triggers a report with my RFC?
- Are there other possibilities to call a webservice regularly using SAP and SAP PI?
- Do I need a Sender Adapter to send the webservice response to PI -> RFC?
- How do I map the webservice response to an iDoc ORDERS.ORDERS05?
Thank you very much for your input on this and best regards,
Peter
Hi Peter,
- So to regularly check the webservice for new orders do I have to create a job in SAP ERP that triggers a report with my RFC?
You can do it with a Job or directly. I think it's better to call to PI with a consumer ABAP proxy.
- Are there other possibilities to call a webservice regularly using SAP and SAP PI?
In your case i thin the best option is to use an ABAP proxy. There is more possibilities like to call with an idoc.
- How do I map the webservice response to an iDoc ORDERS.ORDERS05?
- Do I need a Sender Adapter to send the webservice response to PI -> RFC?
The scenario that you are pointig will be RFC (sender) - SOAP (receiver), but for the sender i remark that you can use an ABAP proxy.
- How do I map the webservice response to an iDoc ORDERS.ORDERS05?
If you are using an RFC or Proxy you need to do this job in ABAP code taking the metadata necessary in the RFC or Proxy interface and finally call the IDOC in the ABAP code.
There is another possiblity, the async-sync-asyinc scenario, like this wiki shows http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=69331, but with Proxy (or RFC) - SOAP. - IDOC, i dont know if it will works properly.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Iñaki Vila,
Thank you for your input. I will ask my colleague to help with the ABAP. I have never set up an ABAP proxy.
Also - which I had not mentioned before - once I received an order from the webservice I have to send a response back that I received it. Can I also handle that with the ABAP proxy?
Thank you again,
Peter
Hi Peter,
Yes, the abap proxy can be synchrounous, then you can retrieve a response with the data neccesary. Finally, in the abap code when you take the response, the abap programmer should call the IDOC.
If you want to check how work the client (consumer) abap proxy with PI, you can read the point 1 of this document http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0ac1a33-debf-2c10-45bf-fb19f6e15..., obviously you are not going to use the same receiver that the pointed in the document but the sender side could be helpful for you.
Regards.
Hello Peter,
Apologies for replying just now. Inaki is right, please let us know if you still have doubts.
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Peter,
Check if your scenario is similar to this:
The idea is to use the query string to check for new orders (e.g ?new=true) and they would just give the response.
If yes, then it can be done Soap Axis (asynch via polling mechanism) -> PI -> IDoc (async).
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Peter,
Ask them for the webservice API (not just wsdl), if it supports HTTP GET, then it might still be possible. Sample api here: (see HTTP GET)
http://www.webservicex.net/stockquote.asmx?op=GetQuote
Regards,
Mark
Hello Inaki Vila, Hello Mark,
The webservice expects a SOAP message from me with 2 variables (number of orders to retrieve at once and a constant). So my idea was in order to create that message I need an RFC that sends those 2 variables to a SOAP receiver on PI which adds the SOAP envelope and then it goes to the webservice.
So I need to send this SOAP request and also it should be sent every 10 minutes to get waiting orders back.
This is why I thought my RFC (or ABAP proxy) needs to be scheduled evey 10 minutes. Maybe there is an easier way, also a BPM was suggested here. But I have never done BPM, that is why I am hesitant about that.
Best regarsd,
PEter
Hello Peter,
If you'll be running a background job, then that means that the number of orders to retrieve would also be constant. Would you be able to share to us the webservice description for HTTP GET?
The reasons I see Michal's blog now working is:
1. HTTP GET is not supported by the webservice
2. The URL formed is too long (more than 200 characters)
You could also connect to the webservice directly using CL_HTTP_CLIENT
Hope this helps,
Mark
Hello Mark,
HTTP GET is not supported by the webservice. I have to go with SOAP.
I found your paper http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80104882-c7a8-2f10-c3a3-81f182917...
and was able to test the Calculator webservice successfully using an ABAP Proxy and SAP PI.
My next steps would be:
- implement a test szenario for retrieving the orders from the webservice of our customer.
- write a report that runs the ABAP Proxy and also calls IDOC_INPUT_ORDERS. Is that correct?
My other question is:
Once I retrieve order files from the webservice I have to send back a reply with the order numbers of retrieved files.
How would I do that?
Do I need another ABAP Proxy for sending back that reply (because it is a separate message structure)?
Then in my report I would call the ABAP Proxy retrieving orders and then call the one sending back the answer with the order numbers?
Thank you again for your help with this.
Best regards,
Peter
Hi Peter,
My next steps would be:
- implement a test szenario for retrieving the orders from the webservice of our customer.
- write a report that runs the ABAP Proxy and also calls IDOC_INPUT_ORDERS. Is that correct?
You are right, you can do an ABAP Proxy - SOAP scenario, you would continue after the call proxy code the IDOC call or you can store the data in a Z table and to do an extra report.
Do I need another ABAP Proxy for sending back that reply (because it is a separate message structure)?
Then in my report I would call the ABAP Proxy retrieving orders and then call the one sending back the answer with the order numbers?
It depends about your third-party. Does It offer to you a synchrounous webservice?, you could do all in one call, the request and response message structure can be different in one webservice. If they have an asynchronous webservice to get the input order, they will show you a second one for the response.
As you said, you can do all in one report, the request, idoc proccessing, and the response.
Hope this helps.
Regards.
Hi Peter
I think the best way to design this would be using a BPM sync-async bridge.
So your scenario will be like this
RFC or Proxy --->To---->BPM ( async call )
BPM<--------> Webservice (SOAP) ( sync call )
BPM ( webservice response ) ....>to IDOC ( async call )
Since your main intention is to call the webservice periodically from PI and then map the response back to IDOC you can do this in one step as well.
You can achive this in the below way
1. Use file adapter in the sender side and use a dummy file in any directory
2. schedule the channel based on the time
3. write an java mapping which will call the webservice uisng SOAP look up and return the response of webservice as xml
4.Design an message mapping and do the response xml to IDOC mapping. Use this map after java mapping.
Let me know if you have any doubts or conerns.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Indrajit Sarkar,
thank you for your input.
My idea was to use a SOAP receiver channel that sends the request coming from RFC/ABAP proxy to the webservice.
If I understand you right I should use the file adapter for scheduling. But I think I do not need a BPM if I do it that way. I would like to avoid the BPM.
Also - which I had not mentioned before - once I received an order from the webservice I have to send a response back that I received it. I would do that from the ABAP side or I think I could do it with a BPM?
Thank you again for your help,
Peter
Hello Indrajit Sarkar,
This question is already solved and I figured it out using ABAP Proxy.
But I would like to know about your solution. I found this document using no BPM:
AsyncSync & SyncAsync Bridge without BPM
Would you know any blog that describes it with BPM like you had suggested originally?
Thank you and best regards,
Peter
Hi
Please check the link below. This will give you the idea how the sync async bridge in BPM works
XI/PI: A Step-by-Step Guide to BPM &#8211; Asynch/Sync Bridge
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.