Quantcast
Channel: SCN : Document List - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 571

Outside-In Web service Providers Development, Deployment and Testing in SAP PI

$
0
0

Requirement:

 

Developing and deploying a provider web service on SAP PI JAVA AS. This web service should be capable of taking an input xml from integration server, perform some action and return an output xml to integration server.

MainDiag.jpg

 

This Web service will be implemented using EJB (Enterprise java beans) and published on an http URL on SAP PI JAVA AS.

SAP PI will connect to this web service via SOAP Adapter.

 

 

Providing Web Services:

You can provide Web services using any of the two approaches:

·         Inside-out

You start from an implementation which is already available and expose it as a Web service. You create a Web service from a session Enterprise Java Bean or from a pure Java class.

This approach is also called bottom-up.

·         Outside-in

You start from a WSDL document of a service. In this case, the framework generates the skeleton of the implementation bean and you have to provide your own implementation of the business methods. You can create outside in Web services in session Enterprise Java Beans.

This approach is also called top-down.

 

Here we will explore Outside-in web service. That means we will use WSDL document of our inbound service interface to generate web service skeleton.

 

 

Development Steps:

 

 

1.     1. Open NWDS (NetWeaver Developer Studio).

      Create an EJB project

1.jpg

    Add project to an EAR.

2.jpg

Open ESR.

Select Inbound service interface for which you need to generate web service.

Go to WSDL tab. Export WSDL and save it on your machine.

 

Open NWDS.

Select EJB project which you have created in above steps-> Right click->New->Others->Web services-> Web service->OK

Browse your WSDL in service definition.

 

OR

 

2.      2. Connect your NWDS to PI 7.3 server.

       Go to Windows->Preferences->SAP AS JAVA->Add->Provide Host name and Instance number->OK.

3.jpg

3.       3. Open Enterprise Service Browser in NWDS.

       Go to Windows->Show View-> Others->Web Services-> Enterprise Service Browser->OK

4.jpg

4.       4. Connect to ESR.

        Click Connect to ESR button->Provide PI server credentials.

5.jpg

5.       5. Generate Java Bean Skeleton for inbound service interface.

        Navigate to your inbound service interface->Right click->Generate Java Bean Skeleton.

6.jpg

 

6.      6. Select Web Service Type “Top down java web service” and Level of service generation “Develop”->Click Next.

7.jpg

 

7.      7. Select Update WSDL.

8.jpg

8.      8. Select Resolve Collisions Automatically->Click next for more customization or Click finish.

9.jpg

9.      9. You can customize service, port type, port and binding name here-> Click next for more customization or Click finish.

10.jpg

10.    10. You can customize package here->Click Finish.

11.jpg

11.     11. Now your EJB Project structure will be something like below.

12.jpg

12.     12. Open implementation bean class.

               Define TransportBindingRT annotation and Write the processing logic of your web service.

13.jpg

    Note:

    TransportBindingRT annotation defines HTTP URL of your web service. The same URL will be used as a Target URL in Receiver SOAP communication  channel in PI.

    For example:

   @TransportBindingRT(AltHost="pidserver.net",AltPort=51100,AltPath="RetriggerBean")

   Your Web service’s HTTP URL will be, http://pidserver.net:51100/RetriggerBean

   Your Web service WSDL URL will be, http://pidserver.net:51100/RetriggerBean?wsdl

 

 

Deployment Steps:

 

1.      Select your EJB Project ->Right Click->RunOnServer->select the server name to be deployed->Click finish.

 

14.jpg

 

 

 

Testing Steps:

 

   Go to Startpage of SAP NetWeaver Application.

15.jpg

    Go to Web Service Navigator.

    Provide your WSDL URL.

 

    http://pidserver.net:51100/RetriggerBean?wsdl

 

16.jpg

  Follow the steps and provide appropriate input to test your web service.

 

 

 

Thanks & regards,

Ambuj Mishra


Viewing all articles
Browse latest Browse all 571

Trending Articles