简体   繁体   English

发送到仅SOAP 1.1端点时,SOAP 1.2消息无效

[英]A SOAP 1.2 message is not valid when sent to a SOAP 1.1 only endpoint

I am getting a error, when calling a spring-cxf-webservice from spring batch application.This error is happening only when its calling from batch.When calling from the normal soap UI its working fine.And once its calling from batch some of the records getting processed.Error is happening for a few records.Checked the SOAP version of batch and webservice and its same. 我从spring批处理应用程序调用spring-cxf-webservice时出现错误。这个错误只发生在它从batch调用时。当从普通的肥皂用户界面调用它工作正常。并且一旦它从批处理调用了一些记录得到处理。一些记录发生错误。检查批处理和webservice的SOAP版本及其相同。

org.apache.cxf.binding.soap.SoapFault: A SOAP 1.2 message is not valid when sent to a SOAP 1.1 only endpoint.
                at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:144)
                at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
                at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
                at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:799)
                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1627)
                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1494)
                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1402)
                at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
                at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:649)
                at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
                at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
                at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:533)
                at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
                at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
                at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
                at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:88)
                at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)

Batch Configuration 批量配置

<jaxws:client id="mainClient"
              serviceClass="com.batch.service.MainSoap"
              address="${url}" />

Any help or way to identify the root cause would be appreciated 任何帮助或方法来确定根本原因将不胜感激

Just add the Soap-Binding. 只需添加Soap-Binding即可。

<jaxws:endpoint id="mainClient" serviceClass="com.batch.service.MainSoap"
  address="${url}">

  <jaxws:binding>
    <soap:soapBinding version="1.2" mtomEnabled="true" />
  </jaxws:binding>
</jaxws:endpoint>

add this annotation on your service interface, I tried its working for me 在服务界面上添加此注释,我试着为我工作

@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)

The class DeliveryService is generated: 生成类DeliveryService:

 @WebService(targetNamespace = "http://...", name = "ServiceInterface")
 @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)

 public interface ServiceInterface {
 @WebResult(name = "response", targetNamespace = "http:///", partName = "response")

I just encounter the same problem using the CXF framework. 我刚刚使用CXF框架遇到了同样的问题。 It was due to a bad configuration of the endpoint: the wsdlLocation wasn't pointing at the wsdl-file... There is various way to define the wsdl location: it can be provide during the endpoint initialisation (the endpoint constructor take an optional wsdlLocation as parameter) or by giving the wsdl2java task an "wsdlLocation" argument (if you generate your classes from the wsdls). 这是由于端点配置错误:wsdlLocation没有指向wsdl文件...有多种方法可以定义wsdl位置:它可以在端点初始化期间提供(端点构造函数可选wsdlLocation as parameters)或给wsdl2java任务一个“wsdlLocation”参数(如果你从wsdls生成你的类)。

Pointing at a wrong wsdlLocation maybe the cause of this exception... 指向错误的wsdlLocation可能是此异常的原因...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM