2

我正在尝试使用此服务,但这给了我 html 响应请在我错的地方帮助我任何帮助真的很有帮助

HttpURLConnection connection;
    java.net.URL u;
    u = new java.net.URL("http://sdservices.iyogi.net/iyogi/webservicesnonrestv5/toolbarwebservices.asmx");

   URLConnection uc = u.openConnection();
   connection = (HttpURLConnection) uc;

   connection.setDoOutput(true);
   connection.setDoInput(true);
   connection.setRequestProperty("SOAPAction", "http://sdservices.iyogi.net/SD/ToolbarService.svc/GetProductSettings?SubscriptionCode=W101982488");
   connection.setRequestMethod("GET");
   connection.setRequestProperty("Content-type", "text/xml; charset=utf-8");

InputStream is = connection.getInputStream(); inputStreamToString(is);

给出 HTML 作为响应:(

4

0 回答 0