本文整理了Java中org.springframework.ws.client.core.WebServiceTemplate.setUnmarshaller()
方法的一些代码示例,展示了WebServiceTemplate.setUnmarshaller()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebServiceTemplate.setUnmarshaller()
方法的具体详情如下:
包路径:org.springframework.ws.client.core.WebServiceTemplate
类名称:WebServiceTemplate
方法名:setUnmarshaller
[英]Sets the unmarshaller for this template.
[中]设置此模板的解组器。
代码示例来源:origin: spring-projects/spring-integration
/**
* Sets the provided Marshaller and Unmarshaller on this gateway's WebServiceTemplate.
* Neither may be null.
* @param marshaller The marshaller.
* @param unmarshallerArg The unmarshaller.
*/
private void configureMarshallers(Marshaller marshaller, @Nullable Unmarshaller unmarshallerArg) {
Unmarshaller unmarshaller = unmarshallerArg;
Assert.notNull(marshaller, "marshaller must not be null");
if (unmarshaller == null) {
Assert.isInstanceOf(Unmarshaller.class, marshaller,
"Marshaller [" + marshaller + "] does not implement the Unmarshaller interface. " +
"Please set an Unmarshaller explicitly by using one of the constructors that accepts " +
"both Marshaller and Unmarshaller arguments.");
unmarshaller = (Unmarshaller) marshaller;
}
Assert.notNull(unmarshaller, "unmarshaller must not be null");
getWebServiceTemplate().setMarshaller(marshaller);
getWebServiceTemplate().setUnmarshaller(unmarshaller);
}
代码示例来源:origin: mercyblitz/segmentfault-lessons
public static void main(String[] args) {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setClassesToBeBound(UserIdRequest.class, UserResponse.class, User.class);
webServiceTemplate.setMarshaller(jaxb2Marshaller);
webServiceTemplate.setUnmarshaller(jaxb2Marshaller);
//构造 SOAP 请求
UserIdRequest userIdRequest = new UserIdRequest();
userIdRequest.setUserId(1L);
userIdRequest.setTimestamp(Instant.now().toEpochMilli());
UserResponse userResponse = (UserResponse) webServiceTemplate.marshalSendAndReceive("http://localhost:8080/web-services/user", userIdRequest);
System.out.println(userResponse);
}
代码示例来源:origin: org.springframework.ws/spring-ws-core
/**
* Sets the {@code Unmarshaller} used by the gateway. Setting this property is only required if the marshalling
* functionality of {@code WebServiceTemplate} is to be used.
*
* @see WebServiceTemplate#marshalSendAndReceive
*/
public final void setUnmarshaller(Unmarshaller unmarshaller) {
webServiceTemplate.setUnmarshaller(unmarshaller);
}
代码示例来源:origin: org.springframework.ws/org.springframework.ws
/**
* Sets the <code>Unmarshaller</code> used by the gateway. Setting this property is only required if the marshalling
* functionality of <code>WebServiceTemplate</code> is to be used.
*
* @see WebServiceTemplate#marshalSendAndReceive
*/
public final void setUnmarshaller(Unmarshaller unmarshaller) {
webServiceTemplate.setUnmarshaller(unmarshaller);
}
代码示例来源:origin: spring-projects/spring-ws
/**
* Sets the {@code Unmarshaller} used by the gateway. Setting this property is only required if the marshalling
* functionality of {@code WebServiceTemplate} is to be used.
*
* @see WebServiceTemplate#marshalSendAndReceive
*/
public final void setUnmarshaller(Unmarshaller unmarshaller) {
webServiceTemplate.setUnmarshaller(unmarshaller);
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(defaultUri);
return webServiceTemplate;
}
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(defaultUri);
return webServiceTemplate;
}
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(defaultUri);
return webServiceTemplate;
}
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(orderAddress);
return webServiceTemplate;
}
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(
"http://localhost:8080/codenotfound/ws/helloworld");
return webServiceTemplate;
}
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(orderAddress);
return webServiceTemplate;
}
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(defaultUri);
return webServiceTemplate;
}
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() throws Exception {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(defaultUri);
// set a httpsUrlConnectionMessageSender to handle the HTTPS session
webServiceTemplate.setMessageSender(httpsUrlConnectionMessageSender());
return webServiceTemplate;
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() throws Exception {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(defaultUri);
// register the signatureSecurityInterceptor
ClientInterceptor[] interceptors = new ClientInterceptor[] {clientSecurityInterceptor()};
webServiceTemplate.setInterceptors(interceptors);
return webServiceTemplate;
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() throws Exception {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(defaultUri);
webServiceTemplate.setMessageSender(httpComponentsMessageSender());
return webServiceTemplate;
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() throws Exception {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(defaultUri);
// register the signatureSecurityInterceptor
ClientInterceptor[] interceptors = new ClientInterceptor[] {clientSecurityInterceptor()};
webServiceTemplate.setInterceptors(interceptors);
return webServiceTemplate;
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(defaultUri);
webServiceTemplate.setMessageSender(webServiceMessageSender());
return webServiceTemplate;
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(
"http://localhost:8080/codenotfound/ws/helloworld");
webServiceTemplate
.setMessageSender(httpUrlConnectionMessageSenderTimeout());
return webServiceTemplate;
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(defaultUri);
// set a HttpComponentsMessageSender which provides support for basic authentication
webServiceTemplate.setMessageSender(httpComponentsMessageSender());
return webServiceTemplate;
}
代码示例来源:origin: code-not-found/spring-ws
@Bean
public WebServiceTemplate webServiceTemplate() throws Exception {
WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
webServiceTemplate.setMarshaller(jaxb2Marshaller());
webServiceTemplate.setUnmarshaller(jaxb2Marshaller());
webServiceTemplate.setDefaultUri(defaultUri);
webServiceTemplate.setMessageSender(httpComponentsMessageSender());
return webServiceTemplate;
}
内容来源于网络,如有侵权,请联系作者删除!