on 05-15-2006 8:28 AM
I have a scenario like this:
XML file--->XI-->(HTTP Receiver adapter)Java application(jsp/servlet).
My JSP page should just display the xml file that i got.
How to do this, please give some step-by-step procedure: please help me!
Hoping a quick response
Tanks in advance!
Hi Datta,
Please look at these steps to configure the HTTP adapter..
http://help.sap.com/saphelp_nw2004s/helpdata/en/0d/5ab43b274a960de10000000a114084/frameset.htm
cheers,
Prashanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Thanks for a quick response!
I need to display the xml file that i receive from XI.
For that i am building a enterprise application(contains jsp/servlet/ejb). I am using BEA weblogic9.0 as my application server. Now i got stuck up here in generating weblogic specific xml file and i have to deploy this application on my application server.
How to generate the weblogic specific xml file. I am a newbie to weblogic application server.
Please help me!
Thanks in advance!
Hi Datta,
In your scenario you want to pick up the file using an j2ee application and send the data in the xml file to XI.
In that case you can write the code in Bean to read the xml file and store the data in the outputstream.
Then from your application you can directly send the information to XI pipeline URL using http protocol.
Secong option if you dont want to write code for sending xml to Xi pipeline you can configure a SOAP sender channel.create a webservice of SOAP sender channel and corresponding interface from ID(Tools> Create webservice). So your scenario will now be SOAP>XI-->http.
And if you want to kep it as FILE>XI>HTTP you will have to go through NFS or ftp where in you cant send it from your servlet.
Regards,
yomesh
HI Datta,
You want your java code to display the data in xml files on the screen. You can use jaxb api for this. You can download this from SUN site.Using jabx api you can convert your incoming xml into objects and then assign the value in it to your UI elements.
If you download the complete JAXB api you will have a tool called xjc.bat in it. using it you can create java files for your Message type in IR.Import that java files in your java project.
I'll attch a sample code where in I did the reverse thing, i.e I took the data from UI and converted it into xml using jaxb api and posted it to XI. You can get an idea from it for doing in reverse way.
This is code for creating a jaxb context and taking the data from UI element to Objects. You can follow the reverse way.
JAXBContext jc =
JAXBContext.newInstance("");
// create an ObjectFactory instance.
// if the JAXBContext had been created with mutiple pacakge //names,
// we would have to explicitly use the correct package name //when
// creating the ObjectFactory.
com.hiringpoc.xmlproxy.ObjectFactory obj =
new com.hiringpoc.xmlproxy.ObjectFactory();
// getting data from view context.
String dateOfHiring = "asdfasdfas";
String reason = "asdfasd";
String empGrp = "asdfasdfas";
String empSubGrp = "asdfasdfas";
String p_area = "asdfasdfas";
// Create an object of IT000 class and assign its fields the corresponding values
// using its own methods.
CVXSADTWebReq first = obj.createCVXSADTWebReq();
CVXSADTWebReq.IT0000Type it0000 =
obj.createCVXSADTWebReqIT0000Type();
it0000.setDATE(dateOfHiring);
it0000.setEmpGrp(empGrp);
it0000.setEmpSubGrp(empSubGrp);
it0000.setPersonnelArea(p_area);
it0000.setReasonForAction(reason);
// Code For sending the data from file to XI.
//
try
// {
// String inString = "";
// String input = "";
// BufferedReader in = new BufferedReader(new FileReader("c:
yomesh
person.xml"));
// // Read the required XML file
//
// while((input = in.readLine()) != null)
// {
// inString = inString + input;
// }
// in.close();
//
// URL xiURL = new URL"");
// //Post the Absolute URL of the XI HTTP Adaptor. The parameters in the above URL are XI specific and must be supplied by XI team for Posting the data in the server.
//
// HttpURLConnection conn =(HttpURLConnection)(xiURL.openConnection());
// conn.setRequestMethod("POST");
// conn.setRequestProperty("Content-Type","text/xml");
//
// conn.setDoOutput(true);
// conn.setDoInput(true);
// PrintWriter out = new PrintWriter(conn.getOutputStream());
// // Here's whether the parameter is set.
// out.println(inString);
// out.close();
//
// BufferedReader in2 = new BufferedReader(new InputStreamReader(conn.getInputStream()));
//
// String inputLine;
// while((inputLine = in2.readLine()) != null)
// inString = inString+inputLine;
// in2.close();
// }
// catch(Exception e)
// {
// System.out.println(e);
// }
Hello Data,
the easiest option seems to be to create a Web Service Provider in your web application, and call that web service via a SOAP Receiver adapter from XI.
Keep in mind that in your scenario, File - XI - your jsp application, the data is being pushed from XI to your application via an adapter, e.g. SOAP. The data, which is being send from XI, must be somehow stored in your application.
Rgds.,
Andreas
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.