簡體   English   中英

How to convert SOAP 1.1 to Soap 1.2 using Java Web Services in Java Code?

[英]How to convert SOAP 1.1 to Soap 1.2 using Java Web Services in Java Code?

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 代碼進行了以下更改,現在事情已經修復。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM