简体   繁体   中英

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

There is one migration in Java.

I got one.wsdl and in cxf maven plugin I just created stub, implemneted service and submit it to customer.

When Customer try to call

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.

Following is Java code:

Interface

@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)

Implementation:

@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 {

What changes shall i do in code to make it 1.2?

I have done following change to my Java Code and things are fixed now.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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