cancel
Showing results for 
Search instead for 
Did you mean: 

[java]retreiving xml from SAP netweaver service

Former Member
0 Kudos

hello guys,

we have developped service on the netweaver platforme , and while we were trying to call the services (xml)

through xmlhttp request , it didn't work , cuz the xmlhttp request object isn't cross-domaine.

so i am trying to go through proxy servlet wich will delegate the request to the external sap url, get the xml

then return it back to the client .

URLConnection urlcon = real.openConnection();

urlcon.setConnectTimeout(1000000);

InputStream ins =urlcon.getInputStream();

in = new BufferedReader(

new InputStreamReader(ins));

String inputLine;

while ((inputLine = in.readLine()) != null)

out.println(inputLine);

} catch(java.net.MalformedURLException ex){ System.out.println(ex.getMessage()); }

catch(IOException ex){System.out.println(ex.getMessage());}

}

it works with every website except the sapportal service url .

i don't if sap portal have some specific practises , or shall we just treat it as an ordinary xml page .

best regards

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

here is the error the server returns "401 unauthorized"

i started wondering .. what's so special about an sap portal and a normal page ?

cuz every other website work , except the one , it work right away in the web browser , but not in java code

eventhough the proxy is the same .

i('m very new to sap portal developement , very confused in the time being ... whether i should use the sap portal connector middleware , or just a normal urlconnection.

plz help