Я пытаюсь вызвать веб-службу, отправив xml-файл в качестве ввода, и я должен получать xml в качестве ответа, но всякий раз, когда я отправляю xml, я получаю ошибку проверки прокси-сервера, поэтому я думал, что я отправлял неправильный xml, но тот же xml отлично работает, когда я использую SOAP UI, поэтому я думаю, что есть некоторая проблема с моим кодом.Вызов веб-службы из java-программы
Вот код ниже
URL URL = NULL;
String strUrl="<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope\" xmlns:soap=\"SoapAuthenticator\" xmlns:ship=\"http://ws.consignorsupport.no/ShipAdvisor\"><soapenv:Header> <soap:ServiceAuthenticationHeader><soap:Username>TDC43671</soap:Username> <soap:Password>hTiNMft/KaMfDDD</soap:Password><soap:IsEncrypted>false</soap:IsEncrypted></soap:ServiceAuthenticationHeader></soapenv:Header><soapenv:Body><ship:SearchForDropPoints><ship:productConceptID>92</ship:productConceptID><ship:installationID>00000000018</ship:installationID><ship:country>DK</ship:country><ship:address></ship:address><ship:postCode>6000</ship:postCode><ship:city></ship:city><ship:limit>5</ship:limit></ship:SearchForDropPoints></soapenv:Body></soapenv:Envelope>";
String ss="http://www.consignorsupport.no/ShipAdvisor/Main.asmx";
url = new URL(ss);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setRequestProperty("Content-type", "text/xml");
conn.setRequestProperty("Accept", "text/xml, application/xml");
conn.setRequestMethod("POST");
conn.connect();
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(strUrl);
wr.flush();
wr.close();
int iHttpResponseCode = conn.getResponseCode();
String strErrorMessage = conn.getResponseMessage();
System.out.println("Getting Response status");
System.out.println(iHttpResponseCode);
System.out.println(strErrorMessage);
Может anybode помочь мне в том, где я иду не так.