org.springframework.ws.transport.WebServiceConnection.receive()方法的使用及代码示例

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

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

WebServiceConnection.receive介绍

[英]Receives a message using the given WebServiceMessageFactory. This method blocks until it receives, or returns null when no message is received.
[中]使用给定的WebServiceMessageFactory接收消息。此方法会一直阻塞,直到收到消息为止,或者在没有收到消息时返回null。

代码示例

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

public static WebServiceMessageSender createMockMessageSender(final String mockResponseMessage) throws Exception {
  WebServiceMessageSender messageSender = Mockito.mock(WebServiceMessageSender.class);
  WebServiceConnection wsConnection = Mockito.mock(WebServiceConnection.class);
  Mockito.when(messageSender.createConnection(Mockito.any(URI.class))).thenReturn(wsConnection);
  Mockito.when(messageSender.supports(Mockito.any(URI.class))).thenReturn(true);
  Mockito.doAnswer(invocation -> {
    Object[] args = invocation.getArguments();
    WebServiceMessageFactory factory = (WebServiceMessageFactory) args[0];
    return factory.createWebServiceMessage(new ByteArrayInputStream(mockResponseMessage.getBytes()));
  }).when(wsConnection).receive(Mockito.any(WebServiceMessageFactory.class));
  return messageSender;
}

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

}).when(wsConnection).receive(Mockito.any(WebServiceMessageFactory.class));

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

WebServiceMessage request = connection.receive(getMessageFactory());
MessageContext messageContext = new DefaultMessageContext(request, getMessageFactory());
receiver.receive(messageContext);

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

WebServiceMessage request = connection.receive(getMessageFactory());
MessageContext messageContext = new DefaultMessageContext(request, getMessageFactory());
receiver.receive(messageContext);

代码示例来源:origin: apache/servicemix-bundles

WebServiceMessage request = connection.receive(getMessageFactory());
MessageContext messageContext = new DefaultMessageContext(request, getMessageFactory());
receiver.receive(messageContext);

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

WebServiceMessage request = connection.receive(getMessageFactory());
MessageContext messageContext = new DefaultMessageContext(request, getMessageFactory());
receiver.receive(messageContext);

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

return (T)handleError(connection, messageContext.getRequest());
WebServiceMessage response = connection.receive(getMessageFactory());
messageContext.setResponse(response);

代码示例来源:origin: apache/servicemix-bundles

return (T) handleError(connection, messageContext.getRequest());
WebServiceMessage response = connection.receive(getMessageFactory());
messageContext.setResponse(response);

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

return (T) handleError(connection, messageContext.getRequest());
WebServiceMessage response = connection.receive(getMessageFactory());
messageContext.setResponse(response);

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

return (T) handleError(connection, messageContext.getRequest());
WebServiceMessage response = connection.receive(getMessageFactory());
messageContext.setResponse(response);

相关文章