小编Jon*_*son的帖子

如何在jboss上以编程方式设置jax-ws客户端请求超时?

我正在尝试为使用jaxws-maven-plugin生成的jax-ws-webservice-client设置请求(和连接)超时.在tomcat或jetty下运行我的应用程序时,超时工作正常,但是当在jboss下部署​​时它不会"占用".

private void setRequestAndConnectionTimeout(Object wsPort) {
  String REQUEST_TIMEOUT = BindingProviderProperties.REQUEST_TIMEOUT; // "com.sun.xml.ws.request.timeout";
  ((BindingProvider) wsPort).getRequestContext().put(REQUEST_TIMEOUT, timeoutInMillisecs);
  ((BindingProvider) wsPort).getRequestContext().put(JAXWSProperties.CONNECT_TIMEOUT, timeoutInMillisecs);
}
Run Code Online (Sandbox Code Playgroud)

为JBoss执行此操作的正确方法是什么?

java jboss web-services jax-ws

8
推荐指数
1
解决办法
2万
查看次数

如何在不使用默认Authenticator的情况下使用JAXWS访问受密码保护的WSDL?

下面的wsdlLocation是受密码保护的,但是偏执使我为应用程序设置默认的Authenticator感到不舒服.如何在不使用默认身份验证器的情况下设置身份验证?

protected Orders getOrdersPort(String wsdlLocation, String namespaceURI) {
    Authenticator.setDefault(new Authenticator() {
        @Override
        protected PasswordAuthentication getPasswordAuthentication() {
            return new PasswordAuthentication("username", "password".toCharArray());
        }
    });
    OrdersService service = new OrdersService(createUrlThrowRuntimeException(wsdlLocation), new QName(namespaceURI,
            "OrdersService"));
    Orders ordersPort = service.getOrdersSoap12();
    setConnectionTimeout(ordersPort);
    return ordersPort;
}
Run Code Online (Sandbox Code Playgroud)

java web-services jax-ws

5
推荐指数
1
解决办法
3605
查看次数

标签 统计

java ×2

jax-ws ×2

web-services ×2

jboss ×1