小编Piy*_*iya的帖子

什么是Tomcat组件?什么是Catalina和Coyote?

谁能描述一下

  • Tomcat中的组件是什么?它在Tomcat服务器中的作用是什么?

  • 什么是土狼?

  • 什么是Catalina?

java tomcat catalina

40
推荐指数
1
解决办法
3万
查看次数

使用Wss4jSecurityInterceptor和Java的SOAP WS-Addressing属性

嗨,我创建消费SOAP服务的代码,

对于Authentication Header,我使用Wss4jSecurityInterceptor来设置Header信息.

我收到如下的失败回应

 Exception in thread "main" org.springframework.ws.soap.client.SoapFaultClientException: Required element {http://www.w3.org/2005/08/addressing}Action is missing
Run Code Online (Sandbox Code Playgroud)

我的配置代码如下

@Configuration
public class SoapClientConfig {

    @Bean
    public Jaxb2Marshaller marshaller() {
        Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
        marshaller.setContextPath("com.xyz.client");
        marshaller.setCheckForXmlRootElement(false);
        return marshaller;
    }

    @Bean
    public MyClient myClient(Jaxb2Marshaller marshaller) throws Exception {
        MyClient client = new MyClient();
        client.setDefaultUri("https://localhost:8080/ws/service");
        client.setMarshaller(marshaller);
        client.setUnmarshaller(marshaller);

        ClientInterceptor[] interceptors = new ClientInterceptor[] {securityInterceptor()};

        client.setInterceptors(interceptors);
        return client;
    }

    @Bean
    public Wss4jSecurityInterceptor securityInterceptor() {
        Wss4jSecurityInterceptor wss4jSecurityInterceptor = new Wss4jSecurityInterceptor();
        wss4jSecurityInterceptor.setSecurementActions("UsernameToken");
        wss4jSecurityInterceptor.setSecurementMustUnderstand(true);
        wss4jSecurityInterceptor.setSecurementPasswordType("PasswordText");
        wss4jSecurityInterceptor.setSecurementUsername("XXXXXXXXXXX");
        wss4jSecurityInterceptor.setSecurementPassword("XXXXXXXX");
        return wss4jSecurityInterceptor;
    }
} …
Run Code Online (Sandbox Code Playgroud)

java soap web-services ws-addressing soap-client

10
推荐指数
1
解决办法
1014
查看次数