【发布时间】:2016-08-09 03:28:18
【问题描述】:
如何将 MustUnderstand 设置为 none 或 false。我正在使用 Spring Boot 和 Web 服务模板来创建客户端。
POM.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-ws</artifactId>
</dependency>
配置
@Configuration
public class BrokerConnectionServiceConfiguration {
@Autowired
private LuiUrlBuilder luiUrlBuilder;
@Bean
public Jaxb2Marshaller marshaller() {
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
marshaller.setPackagesToScan("com.example");
return marshaller;
}
@Bean
public BrokerConnectionServiceClient brokerConnectionServiceClient(Jaxb2Marshaller marshaller) {
BrokerConnectionServiceClient client = new BrokerConnectionServiceClient();
client.setDefaultUri(luiUrlBuilder.getConnectionServiceUri());
client.setMarshaller(marshaller);
client.setUnmarshaller(marshaller);
return client;
}
BrokerConnectionServiceClient.java
public class BrokerConnectionServiceClient extends WebServiceGatewaySupport {
private static final Logger log = LoggerFactory.getLogger(BrokerConnectionServiceClient.class);
@Autowired
private LuiUrlBuilder luiUrlBuilder;
public void getBrokerConnectionServiceData(ConnectionRequestType connectionRequestType) {
log.debug("inside getBrokerConnectionServiceData");
try {
getWebServiceTemplate()
.marshalSendAndReceive(
new JAXBElement<>(new QName(Constants.BROKER_CONNECTION_SERVICE_NAMESPACE_URI, Constants.BROKER_CONNECTION_SERVICE_LOCAL_PART), ConnectionRequestType.class, connectionRequestType),
new ActionCallback(new URI(luiUrlBuilder.getConnectionServiceCallBackLocation()), new Addressing200408()));
} catch (URISyntaxException e) {
log.trace("URISyntaxException occurred", e);
}
}
}
请告诉我如何将“Must understand”设置为 none 或 false 并将 WS-A 版本 设置为“200508”而不是“200408”?
提前致谢
【问题讨论】:
标签: java soap spring-boot soap-client spring-ws