2015-09-26 147 views
0

我正在創建一個簡單的SOAP客戶端,但我的公司有政策不直接發送SOAP請求到公共服務器,因此我們公司有一個代理服務器,它運行在一些IP和端口現在我必須發送我的SOAP請求到這個代理服務器,並且服務器會轉發它。我是SOAP的新手。如何在java中通過代理服務器發送肥皂請求

我的問題是:我如何連接到該代理服務器,並可以發送SOAP請求?我正在使用CXF lib。爲SOAP

謝謝我推進。

+0

我使用CXF lib中SOAP – swapnil

+0

貌似重複[我怎樣設置代理由JVM使用(http://stackoverflow.com/questions/120797/how-do-i-set-the-proxy-by-by-by-the-jvm) – Sanj

回答

0

試試這個

HTTPClientPolicy policy = new HTTPClientPolicy(); 
    policy.setProxyServer(System.getProperty("http.proxyHost")); 
    policy.setProxyServerPort(Integer.valueOf(System.getProperty("http.proxyPort")).intValue()); 

    httpConduit.setClient(policy); 
+0

Thanks for your reply.Its給Connection拒絕錯誤。當我通過java client發送SOAP請求時。但是當我正在通過SOAP發送SOAP請求,並使其成功。 – swapnil

相關問題