on 09-22-2005 3:38 PM
I have been able to use the HTML test tool shared on SDN for my scenarios to date, but I have been <u>also</u> trying to write an http post program in java. For some reason the post never makes it to XI. Does anyone have a sample they will share or notice any problems with this code?
Thanks.
import java.net.*;
import java.io.*;
public class Reply {
private static String myUrl = "http://sr3a80px:8000/sap/xi/adapter_plain?service=PAN_HOTKEY&namespace=http://graybar.com/sandbox/hotkeyoutbound&interface=PANRequestAbstractInterfaceAsync&party=Panduit";
public static void main(String[] args) {
try {
URL u = new URL(myUrl);
URLConnection uCon = u.openConnection();
HttpURLConnection connection = (HttpURLConnection) uCon;
connection.setDoOutput(true);
connection.setRequestMethod("POST");
OutputStream out = connection.getOutputStream();
OutputStreamWriter wout = new OutputStreamWriter(out, "UTF-8");
wout.write("<?xml version=\"1.0\"?>\r\n");
wout.write("<ns0:hotkeyOut_PAN_MessageType
xmlns:ns0=\"http://abc.com/hotkeyoutbound\">\r\n");
wout.write("<RequestAvailability>\r\n");
wout.write("<Date>20050919</Date>\r\n");
...(rest of my xml)...
wout.flush();
out.close();
}
catch (IOException e) {
System.err.println(e);
e.printStackTrace();
}
} // end of main
} // end of class
cleaning up old ticket...never got this working, but tested another way
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.