【问题标题】:How to convert SOAP 1.1 to Soap 1.2 using Java Web Services in Java Code?如何在 Java 代码中使用 Java Web 服务将 SOAP 1.1 转换为 Soap 1.2?
【发布时间】:2021-04-29 09:51:40
【问题描述】:

Java 中有一个迁移。

我有一个 .wsdl 并在 cxf maven 插件中创建了存根,实现了服务并将其提交给客户。

当客户尝试致电时

has thrown exception, unwinding now: org.apache.cxf.binding.soap.SoapFault: A SOAP 1.2 message is not valid when sent to a SOAP 1.1 only endpoint.

以下是Java代码:

界面

@HandlerChain(file = "/handler-chain.xml")
@WebService(targetNamespace = "http://tsb.eto.com/terp/ws/v2", name = "Terp-v2")
@XmlSeeAlso({com.eto.psi.tsb.schema.common.ObjectFactory.class, com.eto.psi.tsb.schema.offering.ObjectFactory.class, com.eto.psi.kil.system.message.ObjectFactory.class, com.eto.tsb.terp.ws.schema.ObjectFactory.class, com.eto.psi.tsb.schema.task.ObjectFactory.class, com.eto.psi.tsb.schema.servicecontract.ObjectFactory.class, com.eto.psi.tsb.schema.project.ObjectFactory.class, com.eto.tsb.tsb.ObjectFactory.class, com.eto.psi.tsb.schema.customer.ObjectFactory.class})
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)

实施:

@javax.jws.WebService(
                      serviceName = "TerpService",
                      portName = "soap",
                      targetNamespace = "http://tsb.eto.com/terp/ws/v2",
                      //wsdlLocation = "classpath:templates/terp-tone.wsdl",
                      endpointInterface = "com.eto.tsb.terp.ws.v2.TerpV2")

public class SoapImpl implements TerpV2 {

我应该对代码进行哪些更改以使其成为 1.2?

【问题讨论】:

    标签: java soap soap1.2


    【解决方案1】:

    我已对我的 Java 代码进行了以下更改,现在问题已修复。

    @BindingType(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
    public class SoapImpl implements TerpV2 {
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-09-23
      • 2017-07-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-30
      • 2010-11-20
      相关资源
      最近更新 更多