sendSourceAndReceiveToResult

sendSourceAndReceiveToResult

Closed. This question needs details or clarity。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
                        
                        5年前关闭。
                                                                                            
                
        
如何将Using Spring Web Services on the Client中的sendSourceAndReceiveToResult()与自定义序列化程序一起使用?

最佳答案

这个问题是不正确的。任何SOAP请求都是通过HTTP传输的POST

如果我们看一下WebServiceTemplate#sendSourceAndReceiveToResult源代码,我们将看到:

 Boolean retVal = doSendAndReceive(uri, transformer, requestPayload, requestCallback,
                new SourceExtractor<Boolean>() {

                    public Boolean extractData(Source source) throws IOException, TransformerException {
                        if (source != null) {
                            transformer.transform(source, responseResult);
                        }
                        return Boolean.TRUE;
                    }
                });


注意doSendAndReceive内部方法调用。任何高级WebServiceTemplate# API都执行相同的操作。在背景上,org.springframework.ws.transport.http.HttpUrlConnectionMessageSender用作默认的SOAP传输,其中connection.setRequestMethod(HttpTransportConstants.METHOD_POST);用于构建HttpUrlConnection

就这样。

10-06 12:49