org.springframework.ws.client.core.WebServiceTemplate.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中org.springframework.ws.client.core.WebServiceTemplate.<init>()方法的一些代码示例,展示了WebServiceTemplate.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebServiceTemplate.<init>()方法的具体详情如下:
包路径:org.springframework.ws.client.core.WebServiceTemplate
类名称:WebServiceTemplate
方法名:<init>

WebServiceTemplate.<init>介绍

[英]Creates a new WebServiceTemplate using default settings.
[中]

代码示例

Official Spring framework guide

代码示例来源:origin: spring-guides/gs-producing-web-service

@Test
  public void testSendAndReceive() {
    WebServiceTemplate ws = new WebServiceTemplate(marshaller);
    GetCountryRequest request = new GetCountryRequest();
    request.setName("Spain");

    assertThat(ws.marshalSendAndReceive("http://localhost:"
        + port + "/ws", request)).isNotNull();
  }
}

代码示例来源:origin: spring-projects/spring-integration

public AbstractWebServiceOutboundGateway(final String uri, WebServiceMessageFactory messageFactory) {
  Assert.hasText(uri, "URI must not be empty");
  this.webServiceTemplate = new WebServiceTemplate(messageFactory);
  this.destinationProvider = null;
  this.uri = uri;
}

代码示例来源:origin: spring-projects/spring-integration

public AbstractWebServiceOutboundGateway(DestinationProvider destinationProvider,
    WebServiceMessageFactory messageFactory) {
  Assert.notNull(destinationProvider, "DestinationProvider must not be null");
  this.webServiceTemplate = new WebServiceTemplate(messageFactory);
  this.destinationProvider = destinationProvider;
  // we always call WebServiceTemplate methods with an explicit URI argument,
  // but in case the WebServiceTemplate is accessed directly we'll set this:
  this.webServiceTemplate.setDestinationProvider(destinationProvider);
  this.uri = null;
}

代码示例来源: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

/**
 * Creates a new {@code WebServiceGatewaySupport} instance based on the given message factory.
 *
 * @param messageFactory the message factory to use
 */
protected WebServiceGatewaySupport(WebServiceMessageFactory messageFactory) {
  webServiceTemplate = new WebServiceTemplate(messageFactory);
}

代码示例来源:origin: org.springframework.ws/spring-ws-core

/**
 * Creates a new instance of the {@code WebServiceGatewaySupport} class, with a default
 * {@code WebServiceTemplate}.
 */
protected WebServiceGatewaySupport() {
  webServiceTemplate = new WebServiceTemplate();
}

代码示例来源:origin: com.consol.citrus/citrus-ws

/**
 * Creates default web service template with settings in this configuration.
 * @return
 */
protected WebServiceTemplate createWebServiceTemplate() {
  return new WebServiceTemplate();
}

代码示例来源:origin: spring-projects/spring-ws

/**
 * Creates a new {@code WebServiceGatewaySupport} instance based on the given message factory.
 *
 * @param messageFactory the message factory to use
 */
protected WebServiceGatewaySupport(WebServiceMessageFactory messageFactory) {
  webServiceTemplate = new WebServiceTemplate(messageFactory);
}

代码示例来源:origin: org.springframework.ws/org.springframework.ws

/**
 * Creates a new instance of the <code>WebServiceGatewaySupport</code> class, with a default
 * <code>WebServiceTemplate</code>.
 */
protected WebServiceGatewaySupport() {
  webServiceTemplate = new WebServiceTemplate();
}

代码示例来源:origin: org.springframework.ws/org.springframework.ws

/**
 * Creates a new <code>WebServiceGatewaySupport</code> instance based on the given message factory.
 *
 * @param messageFactory the message factory to use
 */
protected WebServiceGatewaySupport(WebServiceMessageFactory messageFactory) {
  webServiceTemplate = new WebServiceTemplate(messageFactory);
}

代码示例来源:origin: spring-projects/spring-ws

/**
 * Creates a new instance of the {@code WebServiceGatewaySupport} class, with a default
 * {@code WebServiceTemplate}.
 */
protected WebServiceGatewaySupport() {
  webServiceTemplate = new WebServiceTemplate();
}

代码示例来源:origin: stackoverflow.com

@Bean
public WebServiceTemplate webServiceTemplate() {
  WebServiceTemplate template = new WebServiceTemplate();
  template.setMessageSender(httpComponentsMessageSender());
  return template;
}

代码示例来源:origin: stackoverflow.com

RequestConfig config = RequestConfig
    .custom()
    .setProxy(new HttpHost("host"))
    .build();

CloseableHttpClient client = HttpClients
    .custom()
    .setDefaultRequestConfig(config)
    .build();

HttpComponentsMessageSender messageSender = new HttpComponentsMessageSender(client);

WebServiceTemplate wsTemplate = new WebServiceTemplate();
wsTemplate.setMessageSender(messageSender);
// Set other required properties ...

代码示例来源:origin: spring-projects/Spring-Integration-in-Action

public BookingServiceWithStrongCoupling() {
 this.bookingDao = new SimpleBookingDao();
 WebServiceTemplate template = new WebServiceTemplate();
 template.setDefaultUri(System.getProperty(
   "meal.preference.service.uri"));
 this.mealPreferenceWebServiceInvoker = template;
}

代码示例来源: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() 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;
}

相关文章

WebServiceTemplate类方法