oracle.stellent.ridc.protocol.http.HttpProtocolException:HTTP状态:HTTP/1.1 401需要授权
问题描述:
我在对服务器执行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,然后它会显示此异常。 –