cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dyn and XI

Former Member
0 Kudos

Hi,

My query is related with Web Dyn and XI integration

so i am posting this topic in both forums.

I am looking to send request from web dyn to XI

please guide me.

thanx

Ruby

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Just thought this blog might help u

https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/1334 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]

Regards,

Sowjanya.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Wat do u want to do with XI. Just connect.. or retrieve some data .. or execute something..please be more specific...

try this blog !

/people/sap.user72/blog/2005/09/15/connecting-to-xi-server-from-web-dynpro

Regards

Bharathwaj

Former Member
0 Kudos

hello

if u want to access a web service in an XI server u need to know the location of the wsdl file in the XI server and create a proxy server in webdynpro.

or to just pass values u may write this code.

String urlString = "http://<servername:portno>/sap/xi/adapter_plain?namespace=urn%3Axitraning%3Arms&interface=http_syncMI&service=httptodatabase&party=&agency=&scheme=&QOS=BE&sap-user=xiappluser&sap-password=satyam&sap-client=100&sap-language=EN";

String str= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+ "<ns1:httpMT xmlns:ns1=\"urn:xitraning:rms\">\n"+ "<userid>"userid"</userid>\n"+

"<password>"pwd"</password>\n"+"</ns1:httpMT>";

The above String urlString ::

"http://<XIservername>:<portno>/<sap>/<xi>/<adapter used>?<namespace=name of the namespace>&<interface=name of message interface>&<service=name of the Messageservice>&<party>&<agency>&<scheme>&<QOS=BE>&<sap-user=name of the your XI server>&<sap-password=password of xi server>&<sap-client=your sap-client no>&<sap-language=EN>";

The string str ::

is the XML format in which the data is being passed to XI server. userid (User Name ) and pwd(Password) are the string variables where the username and password are stored.

Use the below statements to establish the connection ::

URL url = new URL(urlString);

HttpURLConnection connection = (HttpURLConnection)url.openConnection();

connection.setDoInput(true);

connection.setDoOutput(true);

connection.setUseCaches(true);

connection.setRequestMethod("POST");

connection.connect(); //(http connection is made)

try

{

OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream());

out.write(str);

out.flush();

out.close();

}

catch(Exception e)

{

e.printStackTrace();

}

so once the connection is established "str" string is written on to the OutputStream.

Thus the XI server will automatically take the data required and will give the result if any.

Use the below code to retreive the required values passed by XI server (should write this code)

BufferedReader in = new BufferedReader(newInputStreamReader(connection.getInputStream()));

// {response stored in the buffer}

String input = "";

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

{

result += input;

}

u have to create interface in the XI server.

please let me know ur exact requirement.

regards,

Piyush.