Consuming WebServices Directly From ABAP - SAP Blogs
Consuming WebServices Directly From ABAP - SAP Blogs
Former Member
July 29, 2013 | 9 minute read
Follow 5 16 77,151
A time ago I was asked to create a Webservice consumption directly from ABAP
Like without any soa.
We listen too much about SAP PI as an integrator and every SAP connection is
RSS Feed done thru it (that’s the best way to do it, I think) but it is not the only way. Since
ERP 4.7 it is possible to consume/provide services directly from ABAP.
When our scenario is SAP -> WebService the first thing we need is a working
webservice.
Test service:
Here I’ll create a Service Consumer for consumption of a test webservice from
http://www.webservicex.net/length.asmx?WSDL it’s service that converts lenght
units.
lengthUnitSoap
lengthUnitHttpGet
lengthUnitHttpPost
For this post the only relevant port service is lengthUnitSoap that implements
Soap standards. The two others are for HTTP consumption directly (not our
focus here).
Before we can simply import our file to SAP, taking a better look into it we see
that some messages have more than one part tag:
This kind of message is incompatible with SAP, so if there are any messages with
more than exactly one part tag the system will return you an error before import
your file. Even if the message is not used in the service that you are
implementing.
Save the original WSDL file to your computer (as .xml or .wsdl) then edit it.
After deleting the messages without only one part and the respectively port-
types we can import the WSDL file into SAP.
Select Package, Prefix and Request to your Service consumer and click Continue:
IMPORTANT: The prefix must be started with Z or Y otherwise the SAP will ask for
object Keys.
Click Complete:
Sucssess!
We have our proxy but it still does not works. That’s because we have not
configured the endpoint of service.
Configuration:
Tip: you can find both External and Internal name in tab External View from your
proxy:
Select your service, click Apply Selection Button and go to Configurations tab:
Click Create Logical Port Button Fill the port name, Description, Configuration
Type and WSDL Base:
(the File with WSDL Document is your modifyed WSDL document that you saved
in your computer in the beginning of this post)
Back in our SAP ERP system we can test the service just by clicking in test tool
(F8).
Select your Logical Port (just created) and click on execute button:
Alert Moderator
Assigned Tags
ABAP Development
Related Questions
calling xi webservice in ABAP
By Former Member Jul 31, 2009
5 Comments
Former Member
January 18, 2016 at 11:04 am
Hi Felipe,
Hi Felipe,
Thank you..
Ocorre o mesmo erro quando tento gerar um proxy quem contém um campo do tipo xtring, pois
estou tentando enviar um smartforms para o CPI.
Shailendra Sharma
November 26, 2018 at 6:39 am
Add Comment
Find us on
Newsletter Support