Hi,
We can use a Web service firstly declaring a Client Proxy at SE80
following this Enterprise Services-->Client Proxies-->Create
Selecting the option URL/HTTP Destination and then Continue, now we need to fill the URL where the service WSDL are and press continue.
Remember that the URL must have the domain name.
Insert the Package,Prefix, Request and continue, Configure and continue.
If the SAP version is ECC 6.0 or + then we have to configure the port at Tx. SOAMANAGER that opens the Default Web Browser with a SOA Management WebDynpro, select the Tab Application and Scenario Communication and then click in Single Service Administration, we are going to search by Proxy with pattern z* & press GO.
A Grid is filled out with a list of entities found, now we select the proxy and press Apply Selection Button, in the Tab Configurations we have to add a Logical Port by pressing Create Logical Port, then we havce to fill the port name,description and again insert the wsdl url finiching by pressing Apply Settings.
At the port created Config's Tab's I supressed the Message ID Protocol at Messaging Tab.
Now we can consume that Web Service throug the Logical Port of our Client Proxy, How to do it?
1.- Define some var_pxyName at the program of TYPE REF TO the proxy Name.
2.-Declare Input & Output vars of type Param Input & Output: ls_request, ls_response.
3.- Implement or Set the var using CREATE OBJECT var_pxyName
4.-Call the WS Method trough proxy,
CALL METHOD varProxyName->MyMethod
EXPORTING
INPUT = LS_REQUEST
IMPORTING
OUTPUT = ls_response .
5.- Finally we have to check the ls_response with the WS Result.
Greetings
No hay comentarios:
Publicar un comentario