Skip to Content

how to check http 200 ok

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on May 22, 2015 at 05:45 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.