Escolar Documentos
Profissional Documentos
Cultura Documentos
It is impossible to implement all of the necessary functions associated with a complex business problem in the same
component or even technology. A modern enterprise infrastructure system must be in the position to integrate
functions in one effective process. Until now, the combination of different applications have been developed using
point-to-point solutions which grow complex and impossible to maintain over time.
Web Services simplify the heterogeneous nature of most mature enterprise system landscapes. They enable you to
combine functions in a single process, even if they are implemented in widely differing software components. Web
services are standalone, executable entities that can be published, searched for, and called, across a network.
To consume a web service via the ABAP engine, you need to do the following:
Enter the name of the Client Proxy (ZCG_CO_WEATHER_WS) and click the CREATE button.
Enter the WSDL in the URL field and press the Continue button
For simplicity select Local Object and enter a value in the Prefix field. Press the Continue button.
Enter the Proxy class and Logical Port name. Make sure that Default Port is selected. Click the Createbutton
Now we need to add the reference from the actual WSDL code into each operation.
Open up the WSDL in a browser and look for the following:
<wsdl:operation name=MakeUpper>
Below that line there will be another line that has a SOAPACTION defined in it:
<soap:operation soapAction=http://www.deeptraining.com/MakeUpper style=document/>
Copy the URL defined in that line into the SOAP Action line.
Since the web service simply converts a string to all upper case, you can now click on the EXECUTEbutton.
Note: You can also now change the default value being sent to the web service
If the test is successful you will see your returned string in all Upper Case
Call the Web Service within an ABAP Function
FUNCTION Z_CG_TOUPPER_TEST.
*
**Local Interface:
* IMPORTING
*
* EXPORTING
*
*
DATA: WSProxy TYPE REF TO ZCG_CO_WS_STRINGS_SOAP .
TRY.
CREATE OBJECT WSProxy .
CATCH CX_AI_SYSTEM_FAULT .
ENDTRY.
data: ls_response type ZCG_MAKE_UPPER_SOAP_OUT .
data: ls_request type ZCG_MAKE_UPPER_SOAP_IN .
ls_request-DATA = INPUT_Parameter .
TRY.
CALL METHOD WSProxy->MAKE_UPPER
EXPORTING
INPUT = ls_request
IMPORTING
OUTPUT = ls_response .
CATCH CX_AI_SYSTEM_FAULT .
CATCH CX_AI_APPLICATION_FAULT .
ENDTRY.
COMMIT WORK.
OUTPUT_Parameter = ls_response-MAKE_UPPER_RESULT .
ENDFUNCTION.