'. !reation !reation o# (ali (ali %)AP messages messages an an evaluation evaluation o# recei receive ve responses responses is taken taken care care by the proxy. %o eveloper can concentrate on the Business Application without bothering about the technical aspects* that is how the %)AP messages are exchange. CREATE PROXY CLASS : %tep ": +o start the %ervice Wi,ar again* #rom %-/ right click an choose !reate01-nterprise !reate01-nterprise %ervice.
%tep $ : +his time in the Object Type step o# the %ervice Wi,ar* choose Service Consumer . As we are at consumer site.
'. !reation !reation o# (ali (ali %)AP messages messages an an evaluation evaluation o# recei receive ve responses responses is taken taken care care by the proxy. %o eveloper can concentrate on the Business Application without bothering about the technical aspects* that is how the %)AP messages are exchange. CREATE PROXY CLASS : %tep ": +o start the %ervice Wi,ar again* #rom %-/ right click an choose !reate01-nterprise !reate01-nterprise %ervice.
%tep $ : +his time in the Object Type step o# the %ervice Wi,ar* choose Service Consumer . As we are at consumer site.
%tep ': 2or the source o# the %ervice !onsumer* you can choose between the -nterprise -nterprise %ervice 3epository* a 43L to a W%5L or the local #ile location o# a W%5L* a 455I* an the %ervice
3egistry. Please choose URL/HTTP Destination.
%tep 6: -nter the 43L o# W%5L #ile which we ha create in earlier exercise.
%tep 7: 2ill in the necessary etails in the wi,ar.
%tep 8: )n the #inal step* you can press !omplete to start the Proxy ob9ect generation.
%tep : ;ou will be promote #or your logon 4ser name an Passwor.
+he generate proxy class is now isplaye. !lick on save an activate.
SET UP LO!CAL PORT obsolete? or %oamanager as show below. $%& 'o we nee' a Lo(ica) *ort: A consumer proxy never stores any etails regaring the 43l server which are speci#ic one system. +hese etails nee to be con#igure through logical ports an enpoints. 2or example:When you transport a proxy class #rom a evelopment system to prouction. +he proxy class oesn’t hol any in#ormation about in which server the webservice nees to be calle. Logical port takes care o# this. %tep :"
+his time when you search in the Web Service Administration* choose to %earch by Consumer Pro+& . 5on’t #orget to press the Apply Selection button a#ter highlighting your proxy. 2rom the !on#igurations tab* choose !reate Logical Port.
%tep :$ 2rom the Popup screen that is generate* you w ill have to #ill in several parameters. 2irst you will nee to name your logical port an set it as the 5e#ault. =ext we nee to use $SDL ,ase' Con-i(uration. +his way the application will rea all the necessary security settings #or calling this service irectly #rom the W%5L e#inition. 2inally you will again nee to supply the W%5L 43L #or the services you are call >hope#ully you still le#t that browser w inow open?. ;ou also
must supply your system 4ser name an Passwor to access the W%5L.
%tep :6 I# success#ul* you will be returne to the Configuration for Logical Port screen. 2rom here you can #urther e#ine the settings #or this logical port. 2or now we nee to embe user creentials #or calling this -nterprise %ervice. %o once again input your 4ser name an Passwor an then %ave
the Logical Port.
TEST!# ;ou can now return to the ABAP workbench in the package P3)I-% an the e#inition o# your
%ervice !onsumer an test it.
)n the +est %ervice !onsumer options ialog * choose %C3+ Method ame. 2inally execute the test.
%witch to the DL -itor an replace the number value with "8. ;ou can go ahea an execute the re&uest call.
+he response shoul show the DL version o# the s&uareroot
=ow what* I# you want to consume web service using ABAP.
Dra( an' Dro* t%e *ro+& class !)EW%E%C3+ an you get the template #or consuming. +his looks like as shown below.
Doi#y the template #or invoking the web service with the below coe. 3-P)3+ ,pwEwebservice. 5A+A : proxy +;P- 3-2 +) ,coE,wsEs&rt . 5A+A : output +;P- ,,s&rtEresponse . 5A+A : input +;P- ,,s&rt . input0number F G"$"$H. +3; . !3-A+- )B-!+ proxy
-P)3+I=< logicalEportEname F GP//H. !A+!J cxEaiEsystemE#ault . -=5+3; . +3; . !ALL D-+J)5 proxy01,s&rt -P)3+I=< input F input IDP)3+I=< output F output. !A+!J cxEaiEsystemE#ault . !A+!J ,cxE,s&rtEexception . !A+!J cxEaiEapplicationE#ault . -=5+3; . W3I+- : G%&uare root is’ * output0result.
=ow its reay #or execution. Jere we go.
)bviously its not the best kin o# report to buil* but I hope the basics #unamentals #or consuming a web service woul be clear by now.
RELATED POST
Related posts • • • • • • •
• • •
Advertise With +s ,, %unction &odule -IT in SAP ABAP with Tutorial What is SAP 'A/A 0 &1 Architecture for Webdynpro for ABAP SAP ABAP interview 2uestions and answers ABAP ertification 3 (ur 4ourney SAP && ertification And Interview 5uestions3 SAP && Interview 5uestions* Answers* And -xplanations ongratulations,,, Winners of coding challenge April 6788 SAP A!1 -xcel Inplace with with macro recording &ailing Spool )etails of Bac9ground $ob
coded by nessus
Like this post Share it! •
•
•
•
•
•
•
•
•
Related Posts
"ser Comments
8.
Dipankar Biswas /ovember 6:* 6787
This is a great sample solution. )o you have one where you can publish a %unction module as a web service* so that outside application can consume sap services 0
Than9s* )ipan9ar ;-P!<
o
Ajay /ovember 6:* 6787
'i )ipan9ar* a>web>service>in>87>minutes= heers A$ay ;-P!<
6.
Rodrigo Fuentes 4anuary 87* 6788
'ello A$ay your article is very usefull to wor9 with and i want to than9s for share this 9ind of information. ;ecently i create my own function module and i publishes through a -SB ?B-A A2ualogic@ Then this WS is available from one of the deploy servers of the -SB. The problem is when i try to use the +;! where the service is deployed SAP always show a 7 error* because cannot recha the 'TTP destination wich use a virtual host )o you 9no how to solve this0
Than9 you very much, ;-P!<
o
admin 4anuary 8* 6788
'i* Its clear that the webservice +;! is not accessible . 'ave you verified all your settings on SI%0 Is that you are facing this problem in a particular browser only0 Than9s A$ay ;-P!<
C.
Sreejith SP %ebruary 6* 6788
'i* The logical port created are not part of the transport re2uest0 I have created a logical port in my dev system and hoped that it would also go to 2uality and production systems along with the consumer proxy classes. )o we need to create the logical port manually in all of these systems0 Than9s Sree$ith ;-P!<
o
Ajay %ebruary 6* 6788
'i Sree$ith*
.
Jose &arch C7* 6788
'ello A$ay* /ice tutorial. 4ust a 2uestion* whatEs the main diference between consuming a web service using this ABAP proxy tutorial* for creating on PI=I system the SAP to S(AP scenario. Than9s, ;-P!<
o
admin April 8* 6788
'i 4ose*
F.
Frank April F* 6788
'i A$ay* when using the wiGard to generate a web service I find C options to create a consumer service. The second one is +;!='TTP>)estination. When choosing this one* the field for the +;! is restricted to 6FH characters. Is there any chance to use longer +;!s ?via alias or so@0 Than9s in advance* %ran9 ;-P!<
H.
Hajira April 66* 6788
'i A$ay* Tutorial was very helpful *but i dont have soa manager in sap as it is not the latest version *can u please suggest me some other way to consume a webservice.
;-P!<
o
admin April 6* 6788
'i Arun*
:.
hajeera &ay 8H* 6788
'ello A$ay* To consume a dot net web service do we hav to create same 9ind of webservice in sap. ;egards* 'a$eera ;-P!<
o
admin &ay 8H* 6788
J.
lp 4uly :* 6788
'i A$ay* Is there any way that we can push the records fetched by web service to PSA instead of creating a ABAP program0 So that it can be loaded into datatarget0 Than9s. ;-P!<
o
Ajay 4uly :* 6788
'i lp*
heers A$ay ;-P!<
lp 4uly J* 6788
'i A$ay* Than9 you. We are trying to extract data from &S Sharepoint into SAP BI using sharepoint web services. an I chec9 if you have done that before0 ould you please shed some light on this0 Than9 you. lp ;-P!<
Ajay 4uly 88* 6788
I am afraid* I have very little idea on &S sharepoint. I would suggest you to post this to S)/ forum for better reach. Than9s A$ay ;-P!<
K.
MaryM 4uly 8C* 6788
'i A$ay* great blog, (ne 2uestion L what do I have to configure to be able to send and receive encrypted messages. Both authentication and body0 Than9s, &ary&
;-P!<
87.
Becky e!ings August 6* 6788
Than9s A$ay* your blog is very helpful. (ne hitch though* I do not get the username=password screen when I create the client prox y* so the proxy is not saved with the authentication. &y calling program will be run in the bac9ground* and does not have the needed authentication. When I run it in the foreground* it wor9s fine* but prompts me for my username M password. )o you have any idea why the user=password option does not appear when I create my proxy0 Than9s* ;-P!<
88.
Sudharshan August F* 6788
'i A$ay* Than9 you for the great article and a time saver. I have a problem while creating proxy using wsdl. There are some errors after I clic9 complete but no details on the error. I have managed to successfully create the proxy classes in -clipse for a 4ava application using the same lin9 as below which is also the one I use for ABAP. http3==devH.axeda.com=webservices=services=AlarmService0wsdl I even tried to download the same and load as a local file. Is there any reason why this file is not acceptable in SAP but in -clipse. Is there a setting in SAP to ignore the validation as in -clipse0 If it is not too much trouble could you please try to create proxy for this and see what could be wrong. Is there a way to validate the file and a way to find and fix the error if there is any. Please help me point towards the right direction. Than9 you for your time. With Nind ;egards* Sudharshan ;-P!<
86.
"d Fogarty September J* 6788
Than9s* this is very helpful. 'ow does one get data from a O)eep Structure0 ;-P!<
8C.
#ris $eeraerts September 6C* 6788
'i A$ay*
Than9s for sharing this information. I have the same problem as Bec9y !evings. It wor9s fine except that userI) and Password popup appears when executing the webservice. I was not able to give user and pasword in the proxy. I did the logical port creation with !P(/%I ?transaction S(A &anager does not exist@. I added a security profile for user and password to the logical port but still the popup appears. Any suggestions 0 ;egards* Nris. ;-P!<
8.
Asim (ctober 8* 6788
rJ wor9 A$ay* I have a particular problem im trying to get a wor9 around for with regard to webservices. Applications built using webservices wor9 fine but only within the networ9 where the sap server resides. if i try to access the same webservices from outside the networ9* the webservices are not accessible. how should we configure these webservices0 or do u have any idea on any $ava middleware that should be used for this scenario ;-P!<
8F.
oren %ldham 4anuary 86* 6786
This example is ;-AT, T'A/NS for posting. I am having troubles. When I use a web service that I created with vb.net I get Q/o 1endor SpecifiedE when attempting to create the proxy in S-J7. I then attempted to use a Opublic web service* calculator found here http3==service>repository.com=service=overview=J::76::F: The wsdl is http3==soaptest.parasoft.com=calculator.wsdl
that is what I entered into S-J7 and the client proxy was created* I created the logical port in S(A&A/A-; and bac9 to S-J7 to test it. When I execute it and choose any of the methods the I get the option to change the parms and when I clic9 -xecute. It give me a dialog that specifie Q/o 1endor SpecifiedE What am I doing wrong0 Please help. This is the first step for me* next step is to call the %ed-x rate webservice. ;-P!<
o
Ajay 4anuary 6* 6786
'i !oren* Why are you getting error /o 1endor Specified when consuming public webservice for calculator0 Something wrong,, heers A$ay ;-P!<
8H.
Sunil %ebruary 8C* 6786
'i A$ay* This is very nice tutorial for beginners li9e me* I have one doubt an we use any W-BSIT- which ta9es some input and give output* as web service* or website site should have some attributes in order to consume it for web service0
%or example. website Ohttp3==www.metric>conversions.org=length=meters>to>feet.htm ta9es input as meters and convert it to feet. an we pass the value from SAP and get the result bac9 to SAP* if yes '(W0 ;-P!<
8:.
#a!itha %ebruary 6* 6786
'i is it possible to debug an abap program or function module when it is called via -SB0 Than9s.. ;-P!<
o
Raj %ebruary 6* 6786
'i Navitha* Please chec9>out the article 3 http3==sapignite.com=how>to>debug>sap>rfc>bac9ground>$ob>update>fm>etc= To chec9 the log O+se the transaction code 3 SI% to get the exact &! file which was sent via -xternal system. + can use this &! file and debug it using SeJ7 transaction code. Than9s M ;egards* R;a$ SAP Inite. ;-P!<