当前位置: 首页>>代码示例>>Java>>正文


Java WebServiceMessageSender类代码示例

本文整理汇总了Java中org.springframework.ws.transport.WebServiceMessageSender的典型用法代码示例。如果您正苦于以下问题:Java WebServiceMessageSender类的具体用法?Java WebServiceMessageSender怎么用?Java WebServiceMessageSender使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WebServiceMessageSender类属于org.springframework.ws.transport包,在下文中一共展示了WebServiceMessageSender类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initGateway

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
@Override
protected void initGateway() throws Exception {
	super.initGateway();
	WebServiceMessageSender [] senders = getWebServiceTemplate().getMessageSenders();
	for(WebServiceMessageSender sender: senders) {
		if(sender instanceof HttpComponentsMessageSender) {
			HttpComponentsMessageSender hSender = (HttpComponentsMessageSender) sender;
			ClientConnectionManager connectionManager = hSender.getHttpClient().getConnectionManager();
			SchemeRegistry schemeRegistry = connectionManager.getSchemeRegistry();
			SSLSocketFactory sf = new SSLSocketFactory(keyStore, safeToString(keyStorePassword), trustStore);
			Scheme https = new Scheme("https", 443, sf);
			schemeRegistry.register(https);
			log.info("initGateway connection manager with https scheme");
		}
	}
}
 
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:17,代码来源:ExchangeWebServicesClient.java

示例2: getOptionTypeMappings

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
@Override
protected Map<String, Class<?>> getOptionTypeMappings() {
    Map<String, Class<?>> mappings = super.getOptionTypeMappings();
    mappings.put("messageSender", WebServiceMessageSender.class);
    mappings.put("endpointResolver", EndpointUriResolver.class);
    mappings.put("messageFactory", SoapMessageFactory.class);
    mappings.put("webServiceTemplate", WebServiceTemplate.class);
    return mappings;
}
 
开发者ID:christophd,项目名称:citrus-admin,代码行数:10,代码来源:WebServiceClientConverter.java

示例3: webServiceMessageSender

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
@Bean
public WebServiceMessageSender webServiceMessageSender() {
  HttpComponentsMessageSender httpComponentsMessageSender = new HttpComponentsMessageSender();
  // timeout for creating a connection
  httpComponentsMessageSender.setConnectionTimeout(timeout);
  // when you have a connection, timeout the read blocks for
  httpComponentsMessageSender.setReadTimeout(timeout);

  return httpComponentsMessageSender;
}
 
开发者ID:code-not-found,项目名称:spring-ws,代码行数:11,代码来源:ClientConfig.java

示例4: opcXmlDaClient

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
@Bean
public OpcXmlDaClient opcXmlDaClient(Jaxb2Marshaller marshaller, WebServiceMessageSender messageSender) {
    String serverUrl = env.getProperty(OPC_XMLDA_SERVER_URL_PROPERTY, "http://opc.xmlda.server.url");
    LOG.info("OPC XML-DA server: {}", serverUrl);

    OpcXmlDaClient client = new OpcXmlDaClient();
    client.setDefaultUri(serverUrl);
    client.setDefaultLocale(Locale.US);
    client.setMarshaller(marshaller);
    client.setUnmarshaller(marshaller);
    client.setMessageSender(messageSender);
    return client;
}
 
开发者ID:tumakha,项目名称:opc-xmlda-sdk,代码行数:14,代码来源:OpcXmlDaConfiguration.java

示例5: prepareMessageSenders

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
private void prepareMessageSenders(SpringWebserviceConfiguration configuration) {
    // Skip this whole thing if none of the relevant config options are set.
    if (!(configuration.getTimeout() > -1) && configuration.getSslContextParameters() == null) {
        return;
    }

    WebServiceTemplate webServiceTemplate = configuration.getWebServiceTemplate();

    WebServiceMessageSender[] messageSenders = webServiceTemplate.getMessageSenders();

    for (int i = 0; i < messageSenders.length; i++) {
        WebServiceMessageSender messageSender = messageSenders[i];
        if (messageSender instanceof HttpComponentsMessageSender) {
            if (configuration.getSslContextParameters() != null) {
                LOG.warn("Not applying SSLContextParameters based configuration to HttpComponentsMessageSender.  "
                        + "If you are using this MessageSender, which you are not by default, you will need "
                        + "to configure SSL using the Commons HTTP 3.x Protocol registry.");
            }

            if (configuration.getTimeout() > -1) {
                if (messageSender.getClass().equals(HttpComponentsMessageSender.class)) {
                    ((HttpComponentsMessageSender) messageSender).setReadTimeout(configuration.getTimeout());
                } else {
                    LOG.warn("Not applying timeout configuration to HttpComponentsMessageSender based implementation.  "
                            + "You are using what appears to be a custom MessageSender, which you are not doing by default. "
                            + "You will need configure timeout on your own.");
                }
            }
        } else if (messageSender.getClass().equals(HttpUrlConnectionMessageSender.class)) {
            // Only if exact match denoting likely use of default configuration.  We don't want to get
            // sub-classes that might have been otherwise injected.
            messageSenders[i] = new AbstractHttpWebServiceMessageSenderDecorator((HttpUrlConnectionMessageSender) messageSender, configuration, getEndpoint().getCamelContext());
        } else {
            // For example this will be the case during unit-testing with the net.javacrumbs.spring-ws-test API
            LOG.warn("Ignoring the timeout and SSLContextParameters options for {}.  You will need to configure "
                    + "these options directly on your custom configured WebServiceMessageSender", messageSender);
        }
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:40,代码来源:SpringWebserviceProducer.java

示例6: getMessageSenders

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
/**
 * Configure message sender for wsa:replyTo from a camel route definition.
 * The route definition has priority over this endpoint.
 */
@Override
protected WebServiceMessageSender[] getMessageSenders(Object endpoint) {
    SpringWebserviceEndpoint camelEndpoint = getSpringWebserviceEndpoint(endpoint);

    if (camelEndpoint.getConfiguration().getMessageSender() != null) {
        return new WebServiceMessageSender[] {camelEndpoint.getConfiguration().getMessageSender()};
    }

    return super.getMessageSenders(endpoint);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:15,代码来源:WSACamelEndpointMapping.java

示例7: createMock

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
/**
 * Create mock {@link WebServiceMessageSender}. If behavior not defined,
 * throws {@link IllegalStateException}.
 * 
 * @return
 */
public WebServiceMessageSender createMock() throws IllegalStateException {
	if (requestProcessors.isEmpty()) {
		throw new IllegalStateException("No request processor defined. Please call at least returnResponse() method.");
	}
	MockWebServiceMessageSender messageSender = new MockWebServiceMessageSender();
	messageSender.setRequestProcessors(requestProcessors);
	messageSender.setInterceptors(interceptors);
	return messageSender;
}
 
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:16,代码来源:WsMockControl.java

示例8: postProcessBeanFactory

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
	Collection<WebServiceTemplate> templates = beanFactory.getBeansOfType(WebServiceTemplate.class).values();
	if (templates.size()==0)
	{
		throw new BeanCreationException("No WebServiceTemplate found in the servlet context.");
	}
	
	Collection<AbstractMockWebServiceMessageSender> mockSenders = beanFactory.getBeansOfType(AbstractMockWebServiceMessageSender.class).values();
	WebServiceMessageSender[] mockSenderArray = mockSenders.toArray(new WebServiceMessageSender[mockSenders.size()]);
	for (WebServiceTemplate template: templates)
	{
		template.setMessageSenders(mockSenderArray);
	}
}
 
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:16,代码来源:MockMessageSenderInjector.java

示例9: testAuto

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
@Test
public void testAuto()
{
	ApplicationContext context = new ClassPathXmlApplicationContext("inject/inject-auto.xml");
	WebServiceTemplate wsTemplate = (WebServiceTemplate) context.getBean("ws-template");
	WebServiceMessageSender mockSender = (WebServiceMessageSender) context.getBean("mock-sender");
	assertSame(mockSender, wsTemplate.getMessageSenders()[0]);
}
 
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:9,代码来源:MockMessageSenderInjectorTest.java

示例10: testMultiple

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
@Test
public void testMultiple()
{
	ApplicationContext context = new ClassPathXmlApplicationContext("inject/inject-multiple-templates.xml");
	WebServiceTemplate wsTemplate1 = (WebServiceTemplate) context.getBean("ws-template-1");
	WebServiceTemplate wsTemplate2 = (WebServiceTemplate) context.getBean("ws-template-2");
	WebServiceMessageSender mockSender1 = (WebServiceMessageSender) context.getBean("mock-sender-1");
	WebServiceMessageSender mockSender2 = (WebServiceMessageSender) context.getBean("mock-sender-2");
	
	assertSame(mockSender1, wsTemplate1.getMessageSenders()[0]);
	assertSame(mockSender2, wsTemplate1.getMessageSenders()[1]);
	
	assertSame(mockSender1, wsTemplate2.getMessageSenders()[0]);
	assertSame(mockSender2, wsTemplate2.getMessageSenders()[1]);
}
 
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:16,代码来源:MockMessageSenderInjectorTest.java

示例11: getMessageSender

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
public WebServiceMessageSender getMessageSender() {
    return messageSender;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:SpringWebserviceConfiguration.java

示例12: setMessageSender

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
/**
 * Option to provide a custom WebServiceMessageSender. For example to perform authentication or use alternative transports
 */
public void setMessageSender(WebServiceMessageSender messageSender) {
    this.messageSender = messageSender;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:7,代码来源:SpringWebserviceConfiguration.java

示例13: apply

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
/**
 * Applies one-way or two-way SSL configuration to implementation of {@link WebServiceGatewaySupport}.
 * Adds also RemoveSoapHeadersInterceptor, because otherwise there will be Content-Length already present exceptions
 *
 * @param ws Webservice client implementation
 * @param keyStore KeyStore
 * @param keyStorePswd Password for KeyStore
 * @param trustStore TrustStore
 * @param trustStorePswd Password for TrustStore
 */
public void apply(WebServiceGatewaySupport ws, Resource keyStore,
                 String keyStorePswd, Resource trustStore, String trustStorePswd) {

    WebServiceMessageSender messageSender = getMessageSender(keyStore, keyStorePswd, trustStore, trustStorePswd);
    ws.setMessageSender(messageSender);
}
 
开发者ID:LIBCAS,项目名称:ARCLib,代码行数:17,代码来源:SSLHelper.java

示例14: createMessageSender

import org.springframework.ws.transport.WebServiceMessageSender; //导入依赖的package包/类
/**
 * Creates message sender that will be used for mocking "real" message senders.
 * @return
 */
protected WebServiceMessageSender createMessageSender() {
	return new WsMockControlMockWebServiceMessageSender();
}
 
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:8,代码来源:WsMockControlTestExecutionListener.java


注:本文中的org.springframework.ws.transport.WebServiceMessageSender类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。