0
我在對服務器執行ping操作時遇到了一些問題使用Oracle UCM 10g的RIDC代碼,我得到HTTP/1.1 401授權必需的例外。oracle.stellent.ridc.protocol.http.HttpProtocolException:HTTP狀態:HTTP/1.1 401需要授權
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.stellent.ridc.IdcClient;
import oracle.stellent.ridc.IdcClientException;
import oracle.stellent.ridc.IdcClientManager;
import oracle.stellent.ridc.IdcContext;
import oracle.stellent.ridc.model.DataBinder;
import oracle.stellent.ridc.protocol.ServiceResponse;
public class PingGuest {
IdcClientManager manager = new IdcClientManager();
IdcClient idcClient;
public PingGuest() throws IdcClientException {
this.idcClient = manager.createClient("Server Address");
idcClient.getConfig().setProperty ("http.library", "apache4");
IdcContext userPasswordContext = new IdcContext("user", "pass");
DataBinder dataBinder = this.idcClient.createBinder();
dataBinder.putLocal ("IdcService", "PING_SERVER");
ServiceResponse response = idcClient.sendRequest (userPasswordContext, dataBinder);
}
public static void main(String args[]){
try {
new PingGuest();
} catch (IdcClientException ex) {
Logger.getLogger(PingGuest.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
這是錯誤。
oracle.stellent.ridc.protocol.http.HttpProtocolException: Http status: HTTP/1.1 401 Authorization Required
任何形式的幫助表示讚賞。
你需要使用HTTP連接嗎?如果沒有,您是否嘗試過使用套接字連接? –
感謝您的回覆,它允許我通過互聯網登錄,但我需要它通過Intranet登錄,因此我發送Auth Type Intranet,然後它會顯示此異常。 –