cancel
Showing results for 
Search instead for 
Did you mean: 

How to read XML data from URL

Former Member
0 Kudos

Hi All,

I have one requirement. I have one URL which gives me data in XML format. I need to read this file and store this data into my SAP tables.

Can anybody suggest how read this XML file using URL?

Thanks in advance,

P.Shridhar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi sridhar ,

U can do a sync call to reciever Http adapter communication channel, and read the XML data from the URL.

Ex : proxy to http scenario , u can send any dummy data to the http reciever adapter but u will get the xml data as response .

configuration parameters:

targethost : is the website name , service number (port) = "80"

and path is rest of the url .

also make sure that you are able to acccess the url from the XI system , otherwise do the necessary configuration in the firewall to open port 80.

Regards,

srikanth Lanka.

Answers (1)

Answers (1)

Former Member
0 Kudos

Just to confirm, do you intend to use XI in this integration? You havent mentioned anything about that in the question so...

Former Member
0 Kudos

Hi Amol,

Thanks for earliest reply.

Let me explain whole scenario. I am using XI to store XML data into SAP table which I get from a URL. Now, my requirement is to trigger my BPM everyday at 4:00PM and it should read that XML file from specified URL and store it in SAP table. I have already created RFC to store data but how do I get that XML data from URL(internet).

BR,

P.Shridhar.

Former Member
0 Kudos

Use a Server java proxy generated from your inbound message interface which would make a URLConnection to the specified URL after it gets triggered by BPM. A code snippet to achieve the same could be

URL url  = null;
URLConnection conn = null;
BufferedReader in = null;
url = new URL("http://someurl.someserver.com");
conn = url.openConnection();
in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line = null;
StringBuffer xml = new StringBuffer();
while ((line = in.readLine()) != null){
        xml.append(line);
}

-- amol

Former Member
0 Kudos

Hi Amol,

The system through which i need to access to XML data is not WAS ...it is a website where i get some online data and we don't have any relation with that site it's a normal website of some bank .

Is it possible to use HTTP reciever communication channel to read that XML file .

On typing the URL on the Browser am getting the XML file displayed . So if i do a HTTP post to that URL then i should get the reply ( which is the XML file ) .

Can u suggest how should I do that .

Thanks ,

P. Shridhar

Former Member
0 Kudos

Some confusion here...

<i>The system through which i need to access to XML data is not WAS ...it is a website where i get some online data and we don't have any relation with that site it's a normal website of some bank .</i>

Does this mean you need a communication like this?

R/3 <>XI<>Website

If XI can talk directly to that website then you can use Reciever HTTP but from what you have written

<b>The system through which i need to access to XML data is not WAS</b> , I could make out that you want to connect to a system from XI which in turn retrieves this XML data for you, I hope I am correct.

Former Member
0 Kudos

Hi Amol,

You have got it right. But what I mean from WAS is that I cann't use Server Java Proxy in that website.

I also thought of using receiverHTTP adapter but I am confused with the adapter configuration, please throw some light on that for eg. url, service no etc.

Thanks,

P.Shridhar.

Former Member
0 Kudos

Server Java proxy would reside on the J2EE stack of XI server and not on any other host / environment. This is the main diff betn abap and java proxies as to where they reside. Pls dont get confused in that.

Help on HTTP adapter :

http://help.sap.com/saphelp_nw04/helpdata/en/44/79973cc73af456e10000000a114084/content.htm

url : is the URL to which you will send a post request

service no : is the port on which your http server responds.