Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member183816
Active Participant

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.

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

    Add project to an EAR.

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.       3. Open Enterprise Service Browser in NWDS.

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

4.       4. Connect to ESR.

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

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

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

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

7.      7. Select Update WSDL.

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

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

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

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

12.     12. Open implementation bean class.

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

    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.

Testing Steps:

   Go to Startpage of SAP NetWeaver Application.

    Go to Web Service Navigator.

    Provide your WSDL URL.

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

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

Thanks & regards,

Ambuj Mishra

Labels in this area