creation of client proxy

14
8/12/2019 Creation of Client Proxy http://slidepdf.com/reader/full/creation-of-client-proxy 1/14 Creation of Client Proxy (Consumer Proxy) for a Web Service By Rahul Mehta, Tata Consultancy Services Concept: 1. Every Web service is generated with a Web Service Definition Language (WSDL). 2. We will use the WSDL to create a Client Proxy. Example: Suppose we have two systems System-1 & System-2. We have created a web service in System-1 & we want to consume that Web service in System-2. For this we have to create a Client Proxy in System-2 with the help of WSDL that is generated with the web service which is made in System-1. Settings: To call the web service of system1 in system2 the following settings must be done. 1. Go to T-code SICF and press execute. 2. Go to Client->Proxy Settings. 3. The following screen appears. 4. Go to HTTP Log and Provide the Host name and port of system-1. (System in which web service exists)

Upload: campeador2012

Post on 03-Jun-2018

228 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 1/14

Creation of Client Proxy (Consumer Proxy) for a Web Service

By Rahul Mehta, Tata Consultancy Services

Concept:

1.  Every Web service is generated with a Web Service Definition Language (WSDL).

2.  We will use the WSDL to create a Client Proxy.

Example: Suppose we have two systems System-1 & System-2. We have created a web service inSystem-1 & we want to consume that Web service in System-2. For this we have to create a ClientProxy in System-2 with the help of WSDL that is generated with the web service which is made inSystem-1.

Settings: To call the web service of system1 in system2 the following settings must be done.

1. Go to T-code SICF and press execute.

2. Go to Client->Proxy Settings.

3. The following screen appears.

4. Go to HTTP Log and Provide the Host name and port of system-1. (System in which web serviceexists)

Page 2: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 2/14

 

Steps for Creating a Client Proxy:

1. Go to T-code Se80.

2.  Go to Edit Object ->Enterprise Services->Client Proxy (Radio Button).

Page 3: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 3/14

 

Click on the create button.

3.  The following screen appears.

Page 4: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 4/14

 

Select the radio button URL/HTTP Destination and click on the continue button.

4. The following screen appears.

Page 5: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 5/14

 

In the URL provide the Web service definition language (WSDL) of the web service.

Page 6: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 6/14

 

Click on the continue button.

4.  The following screen appears.

Page 7: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 7/14

 

Provide the prefix and stored it in a package or in a local request.

Page 8: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 8/14

 

Click on the continue button.

5.  The following screen appears.

Page 9: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 9/14

 

Click on the complete button.

6.   After clicking on the complete button the following pop-up appears asking for filling the user id

and password.

This user id and password is of that system in which web service exists. (Permission to use the webservice of another system).

Provide the user name and the password and Click on the OK button.

Page 10: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 10/14

7.  The following screen appears and the proxy is created.

Save and activate the proxy. This Proxy is nothing but a class which exists in SE24.

The name of the proxy is always like this: Consumer Proxy Prefix + CO + Name of the WebService.

When we open the class in SE24 it looks like this.

Page 11: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 11/14

Page 12: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 12/14

 

9.   Apply Selection and go to configuration tab to create the Logical Port.

Provide the logical port name and its description.

URL for WSDL Access: WSDL of the web service

Provide the user name and the Password of the system in which web service exists and click onapply settings.

10.  The Following Screen Appears.

Page 13: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 13/14

 

Click on save button. The binding for the web service activated.

11.  Now Create an Executable program and write the following code to call the RFC FM.

a)  Create an object of the proxy class and provide the name of the Logical Port.

b)  Then call the RFC function module with the help of that object.

Page 14: Creation of Client Proxy

8/12/2019 Creation of Client Proxy

http://slidepdf.com/reader/full/creation-of-client-proxy 14/14

 DATA: lo_object TYPE REF TO ZPROXY_CO_ZWS_SUMCREATE OBJECT lo_objectEXPORTING logical_port_name = 'ZPORT_LDS'.

TRY.CALL METHOD lo_object->zws_fm

EXPORTING

input = ls_input

IMPORTINGoutput = ls_output .CATCH cx_ai_system_fault .CATCH cx_ai_application_fault .ENDTRY.

This client Proxy object calls the RFC FM (The RFC Function Module which is made in SYSTEM-1).The Output of the Method can be used for further processing.