Here I will be showing how to create a Web Service Consumer in SAP. We are going to consume a Web Service which I have created earlier. You can use this link to access it.
Step 01:
Create a Consumer Proxy.
Go to transaction SE80 and then open the package you are working on. You may also select the Local Objects if you are not going to use a package. I'm going to save this as a Local Object for this tutorial. Navigate to Enterprise Services->Service Consumer, right click and select "Create".
The "Create Service Consumer" wizard should pop up. Here you have to provide a source for the Web Service definition (WSDL source). For this example we're going to select the option external WSDL and click Continue.
Next the wizard asks for the source location. We're going to select the option URL and provide the WSDL URL of the previous Web Service provider which I have created here. The WSDL URL should be the URL that you get when you view the WSDL in the browser using "Open WSDL document for selected binding or service".
Next, select the package you are going to save the object to. For this example I'm going to save it as a local object and click Continue.
Next is a final wizard screen and here you just have to click Continue.
Once you click Continue, You will be asked for login information. This will depend on the system you are accessing the WSDL from. Since we're using the previously created Web Service from SAP it will ask for the login details to SAP Application Server.
After you have provided all the necessary information the inactive service consumer is displayed to the right of the screen. For this example you don't have to do anything here, just save and activate the service consumer proxy.
Step 02:
SOA manager configuration.
run the transaction SOAMANAGER. Select the "Web Service Configuration" link. Select "Consumer Proxy" from the "Search By" drop down and enter the Service Consumer Proxy name you created and press "Apply Selection".
Select the "Configurations" tab and click "Create". This will open a window to enter the logical port name and some other configurations. Enter a name for the Logical Port and a description. Select the option WSDL configuration because we're providing a URL for the WSDL. Also provide the Username and password for the WSDL URL and click "Apply Settings".
Another screen should pop up showing some details of the WSDL you are accessing.Press "Apply Settings".
Then you will have to provide some more information for the configuration of the logical port such as Username and Password. This may vary according to the security settings you provided when you were creating the service consumer. Press "Save".
Step 03:
Write a program to call the consumer proxy to consume the web service.
Write a program similar to the following which can be used to consume the web service.
Informative post..
ReplyDeleteWebsite Developers in Mumbai