cancel
Showing results for 
Search instead for 
Did you mean: 

Using a java proxy with XI to execute a Script located in external server

Former Member
0 Kudos

HI

I have recived help from here about this. But i don´t know how to work with java proxy. Is someone there who can help me in it.

Many thanks in advance.

Noelia

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Many thanks for all your answers, But my problem is the following: were I have to develop a java proxy , in the xi or in the external sistem. sorry for ask to much, but I can understand how the java proxy works.

Many thanks

Noelia

Former Member
0 Kudos

Noelia ,

The Java proxy as pointed in other post , resides on the XI server java stack itself. Not talking in XI terms, this would mean that the java code executes in the same runtime java environment where your XI is running. If you write a client java proxy i.e. which will send data into XI pipeline, your external system can act as a client to the java proxy.In your case , i belive its gonna be a server java proxy i.e. XI will send a request to the java proxy and it will in turn execute a script on an external server.

If you can share some more information about the interface your external system exposes, say telnet or tcpip socket based , may be people here would be able to help you more.

Former Member
0 Kudos

Hi all,

thanks for your help.

The interface is file to file, but first I need to execute file .bat to extract some info from an sql server database and create the file. They have ask me to do everything from XI. In other post someone told me that I can use Java proxy to execute the .bat script but maybe there is another way to do it.

The system where I have to execute the .bat file and read the file, is an windows 2003 with a SQL server 2003.

Sorry this case is too complicated for me.

Many thanks!

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

One option instead of using JAVA proxy is <b>to use a standrad JAVA API to execute the Script in the message mapping using a simple User Defined Function.</b>

Let me know if you need info on this approach.

Regards,

Bhavesh

Former Member
0 Kudos

Hi,

this new option seems to be easier. But I´m sure about this for this case, because, I haven´t got the file until the script has been executed. Then how can i execute it from the message mapping. I mean first execute the script .bat, that generates a csv file and is this csv file the one that xi has to move to another system.

thanks for the help,

Regards

Noelia

bhavesh_kantilal
Active Contributor
0 Kudos

<i>Then how can i execute it from the message mapping</i>

Create a DUMMY FILE TO FILE interface. File adapter will pick up some Dummy File present in the TEST mode every polling interval, and during mapping call the Script to move the actual files.

By using the polling interval, you can determine the duration in which the script is to be executed.

Regards,

Bhavesh

Former Member
0 Kudos

Hi,

I think I nearly understand now your solution. I have to create two scenarios one Dummy file to file, just to call the execution of the .bat file. And another file to file scenario to pick up the files that the .bat has generates and move them into the other system. Did I understood it properly?

MANY MANY thanks

regards

Noelia

bhavesh_kantilal
Active Contributor
0 Kudos

<i>Did I understood it properly?</i>

Yes you did

you can use the following code to call the script,

Process pExecShellScript = Runtime.getRuntime().exec("location where script exists");

Regards,

Bhavesh

Former Member
0 Kudos

GREAT many Thanks for your help. i´m going to develop it and See if its works.

Thanks for your help!!!!!!

regards

Noelia

Former Member
0 Kudos

Hi Bhavaesh,

I need some more info about the solution that you told me the other day. THis is about the code that I have to use to execute the script,

<i>Process pExecShellScript = Runtime.getRuntime().exec("location where script exists");</i>

Where i have to "say" in the code in wich server the .bat file is located.

Many thanks in avance

Regards Noelia

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

In our case, the shell script was located in the XI server itself and so we just gave the local path of the server.

If you have any Java expert around , find out how the EXEC method can be used to specify the location of the external script. they should be able to help you.

Post this in the Java Programming forum also, you might get a few pointers.

Regards,

Bhavesh

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Noelia,

You can have 2 types of Java proxies viz. client(putting data into xi pipeline) & server (xi pipeline sends request to these proxies.)

From system point of view, the requirements vary in case of these two. for server proxies you can have a webas java business system and associated technical system in sld.in case of client proxies, refer SAP note #809420.

The basic difference between ABAP proxies and Java proxies is ABAP proxies reside on the perticular application system(CRM or R/3) but java proxies reside on SAP Web AS J2EE stack of your XI server.

Just search SDN pointers on Java proxy developement and you will get good pointers. There is one How-to guide on service marketplace by the name "HowToWorkWithJavaProxies.pdf".

Regarding your dev environment, you can always make use of NWDS, you need to be very much familier with EJB concepts and deployment. Check help.sap.com for more details.

Java Proxies and SAP XI - The Inside Story, Part 1

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a068cf2f-0401-0010-2aa9-f5a...

Java Proxies and SAP XI - The Inside Story, Part II

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7e...

SAP XI 1.0 Configuring your PC or Laptop as a Java Receiving System

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f5b19b90-0201-0010-9bb0-81c...

Also go through these links:

/people/prasad.ulagappan2/blog/2005/06/27/asynchronous-inbound-java-proxy

/people/rashmi.ramalingam2/blog/2005/06/25/an-illustration-of-java-server-proxy

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a068cf2f-0401-0010-2aa9-f5a...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f272165e-0401-0010-b4a1-e7e...

http://help.sap.com/saphelp_nw2004s/helpdata/en/97/7d5e3c754e476ee10000000a11405a/frameset.htm

Here you can download code samples for inbound and outbound Java Proxies which you can use together with the Flight Booking Scenario.

http://de.geocities.com/stefan_grube/JavaProxyExample.zip

I hope it helps........

Regards,

Abhy

Former Member
0 Kudos
bhavesh_kantilal
Active Contributor
0 Kudos

service.sap.com/nw04 --> SAP XI --> How to Guides --> How to use Java Proxies.

Best document for this..!!

Regards,

Bhavesh

Shabarish_Nair
Active Contributor
0 Kudos

dO REF. these blogs and links;

http://help.sap.com/saphelp_nw04/helpdata/en/e1/091640a991c742e10000000a1550b0/content.htm

/people/prasad.ulagappan2/blog/2005/06/27/asynchronous-inbound-java-proxy

/people/rashmi.ramalingam2/blog/2005/06/25/an-illustration-of-java-server-proxy