简体   繁体   中英

How to Check using HttpResponse, the response body is a SOAP Messages or it is a XML Message or XSD Document or it is a WSDL Document

HttpResponse response = httpClient.execute(new HttpGet(URL));
HttpEntity entity = response.getEntity();
String responseString = new BasicResponseHandler().handleResponse(response);

After this how do we parse responseString to check it is a XML or SOAP Message or XSD Document or a WSDL Document.

Since every SOAP, XSD or WSDL document is also an XML document:

  1. Read the entire document into a buffer (or a local file).
  2. Parse using a plain XML parser.
  3. Examine the DOM (or the events) to decide if the document is SOAP, XSD, WSDL or ... something else.
  4. Reparse the buffered document using the relevant parser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM