Documente Academic
Documente Profesional
Documente Cultură
Home / Community
Vikas Singh
more by this author
Follow RSS
I have been doing some work of late with Java proxies on SAP PO .I tried to use product
documentation to understand their working. Product documentation is always the best source of
information but things are much clearer for me after I’ve already developed something using a
concrete example.
I hope that this post will be useful for anyone trying out SAP PI Java proxies. Here both the sender
as well as receiver are Java proxies and it has been implemented on a 7.31 SAP PO system.
Scenario: We’ll use the flight demo model scenario with two Java proxies – interfaces
FlightSeatAvailabilityQuery_Out_new for outbound service call and
FlightSeatAvailabilityQuery_In_new for inbound service implementation.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 2 of 17
Sender Proxy ( Consumer ) – Being sender, this proxy doesn’t provide any service but is used to
make the outbound service call.
Servlet ( for testing ) – As the proxy calls are to be in an JEE environment, we’ll create a simple
Servlet for testing.
At a high level, the below diagram shows what we’ll end up creating. We’ll need to create a
configuration scenario as well but that shouldn’t cause too much grief.
We need to create the below projects in NWDS. The names in italics are our project names.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 3 of 17
a) Dynamic Web Project ( JavaProxyWeb ). This will hold consumer proxy (sender objects) and
servlet used for testing.
b) EJB Project ( JavaProxy ) : This will hold service implementation on the receiver side.
Let’s generate code on the sending side ( consumer proxy ) . We don’t want to chose a Javabean
as there is no actual service implementation. We’re just generating client to call our proxy and
hence chose “Generate Client”.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 4 of 17
In the next screen , check the values of Server/ WebService runtime and verify your Dynamic Web
Project and EAR project are chosen.
And we don’t have to WSDL as we’re not really using the end-points for any service all . We’ll be
creating a configuration scenario in PI Designer to generate the configuration.
After that, let the wizard go through default values and just press finish.
For our inbound service implementation, let’s take the corresponding service interface. This time
we want to generate a bean and hence chose “Generate JavaBean Skeleton”.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 5 of 17
And as we’re not really going to use any client, we can move the slider for client to minimum and
just generate the shell for the Web Service.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 6 of 17
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 7 of 17
As we need a servlet for testing, let’s create one in our web project.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 8 of 17
Add the WebService annotation with the service name and create an instance of the Service.
This is the outbound service call. We need to create an instance of port and as we’re using XI as
the message protocol, we need to use methods from XIManagementInterface.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 9 of 17
We have set the business system programmatically. It’s also possible to not set it here and
instead set Party and Sender Service in configuration for Java proxies ( this appears once the
project is deployed ) in Port Configuration.
For the inbound service implementation, we’ll need to add @XIEnabled annotation and it’ll need
@TransportBindingRT as well. Add @XIEnabled and IDE will help with @TransportBindingRT as
they’re required together.
Project Deployment
Our EAR has our EJB as well as dynamic web project.Deploy the EAR .
Once the project is successfully deployed, we should be able to find our consumer proxy . This
was actually confusing for me. I tried to deploy the generated client without the actual service call
in servlet and it never worked for me. Only when I created the servlet making the outbound call I
could see the outbound proxy. It’s best to finish outbound proxy and inbound service
implementation along with consumer application ( servlet in this case ) and then try to deploy them
in one shot.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 10 of 17
Below is the screenshot of the port configuration . We can set the party/ business system here if
it’s not set programmatically.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 11 of 17
Our development is done. Now, we need to create an integration flow with the required sender /
receiver interface values.
Sender communication channel uses XI message protocol for a SOAP adapter and HTTP as the
transport protocol.
Similarly, create a receiver communication channel of type SOAP, using HTTP as transport
protocol and XI as message protocol.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 12 of 17
Do a test with the URL going to be used on the receiving side to verify it’s running.
Now, configure the receiver communication channel. Change the authentication mode to “Use
logon data to no-SAP system’ and provide
authentication credentials.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 13 of 17
Activate the iFLow and we’re ready to test the set up.
Testing
Fire the servlet and it should come up with the below screen
Put your flight and connection details. We aren’t really using the date and hence it’s not in screen.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 14 of 17
Voila ! Our proxy worked and it has come back with the response.
This matches with our service implementation – we’re just returning 20 free and 200 max business
class seats .
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 15 of 17
The audit log confirms that JPR has successfully delivered the message along with the response
message.
Alert Moderator
7 Comments
You must be Logged on to comment or reply to a post.
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 16 of 17
Hi Vikas,
This is a great post. I think it will be very useful. Thanks for sharing your knowledge.
Ryan
Great job!
Hi Vikas,
Your topic seems interesting Can you please update the crashed images pleaseM
Regards,
Avinash
Vikas Singh Post authorNovember 24, 2014 at 5:01 am
Hi Vikas,
Now the images are visible previously they were not visible. thanks for the response.
Regards,
Avinash
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018
Implementing Sender Receiver Java proxy scenario in SAP PO/PI | SAP Blogs Page 17 of 17
Privacy
Terms of Use
Legal Disclosure
Copyright
Trademark
Sitemap
Newsletter
https://blogs.sap.com/2014/01/28/implementing-java-proxy-scenario-on-sap-po/ 9/5/2018