cancel
Showing results for 
Search instead for 
Did you mean: 

how to check http 200 ok

former_member229036
Participant
0 Kudos

Hi all;

what is PI http url for checking connection(http 200 O.K)  ?

when i  execute client program, i got the response message as blow;

Status: 405 - Message: Method Not Allowed

private static final String uri = "http://xxx.pi.com:50800/XISOAPAdapter/MessageServlet?ximessage=true";

final HttpPut httpput = new HttpPut(uri) ;                

             

              System.out.println(httpput);

             

   final HttpResponse response = httpclient.execute(httpput);

   System.out.println("Status: "+response.getStatusLine().getStatusCode() + " - Message: "

                             + response.getStatusLine().getReasonPhrase());

Thank You.

Accepted Solutions (0)

Answers (1)

Answers (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi David,

HTTP PUT is a method for REST. SOAP Adapter only supports POST, that is why you are getting a method not allowed exception. Also


private static final String uri = "http://xxx.pi.com:50800/XISOAPAdapter/MessageServlet?ximessage=true";

Is reserved for ECC systems sending an ABAP proxy message to PI using AAE. The correct URL should be

http(s)://host:port/XISOAPAdapter/MessageServlet?channel=p:s:c where p = party, s = service (business component/business system), c = comm channel respectively.

Here's a code snippet of what I use to POST to the XI using SOAP Adapter


private static final String urlPath = "http://host:50000/XISOAPAdapter/MessageServlet?channel=:service:channel";

URL url = new URL(urlPath);

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

conn.setDoOutput(true);

conn.setDoInput(true);

conn.setRequestMethod("POST");

conn.setRequestProperty("Content-Type", "text/xml; charset=utf-8");

conn.setRequestProperty("Content-Length", Integer.toString(httpBody.length())); //an HTTP Body is needed

DataOutputStream dos = new DataOutputStream(conn.getOutputStream());

dos.writeBytes(httpBody);

dos.flush();

dos.close();

Regards,

Mark