How to create a SOAP 1.2 version endpoint using JAX-WS and Maven

So, I'm trying to use WSDL with SOAP version 1.2 with JAX-WS, however it will only generate version 1.1. I am using Maven to use WSDL. The contents of the POM file of the WSDL are as follows.

   <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxws-maven-plugin</artifactId>
    <version>1.10</version>

    <executions>
      <execution>
       <goals>
          <goal>wsimport</goal>
        </goals>
        <configuration>
          <wsdlFiles>
            <wsdlFile>MEAI_OnlineServices.webServices.Volubill_selfCare_04.wsdl</wsdlFile>
          </wsdlFiles>
          <bindingDirectory>${basedir}/src/wsdl</bindingDirectory>
          <extension>true</extension>
          <protocol>Xsoap1.2</protocol>            
        </configuration>
      </execution>

    </executions>

  </plugin>

Below are snippets from WSDL

   <wsdl:definitions name="selfCare" targetNamespace="http://eaidev.mobinil.com/MEAI_OnlineServices/webServices/Volubill/selfCare" 
   xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
   xmlns:soapjms="http://www.w3.org/2008/07/soap/bindings/JMS/" 
   xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
   xmlns:tns="http://eaidev.mobinil.com/MEAI_OnlineServices/webServices/Volubill/selfC
   are" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
   xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
   xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">

Then, when declaring oversights, I have the following.

    <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="deleteBucket">
  <soap12:operation soapAction="MEAI_OnlineServices_webServices_Volubill_selfCare_Binder_deleteBucket" style="document"/>
  <wsdl:input>
    <soap12:body parts="parameters" use="literal"/>
  </wsdl:input>
  <wsdl:output>
    <soap12:body parts="parameters" use="literal"/>
  </wsdl:output>
</wsdl:operation>

I will not be able to get this building version 1.2. I have 2 bind files, as shown below, which will prevent parts of the WSDL from generating void methods instead of return methods.

JAXB-binding.xml

   <?xml version="1.0" encoding="UTF-8"?>
   <!-- Prevent any Strings being changed to a JAXBE<String> element -->
<jaxb:bindings version="2.1" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <jaxb:globalBindings generateElementProperty="false" />     
</jaxb:bindings>

And bindings.xml

  <?xml version="1.0" encoding="UTF-8"?>
   <bindings xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="MEAI_OnlineServices.webServices.Volubill_selfCare_04.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<!-- Disable default wrapper style -->
<enableWrapperStyle>false</enableWrapperStyle>  
<endpoints xmlns='http://java.sun.com/xml/ns/jax-ws/ri/runtime' version='2.0'>
<endpoint binding="http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/"/>
</endpoints>

The endpoints in the bindings class were an attempt to get it to generate SOAP 1.2, but I was met without success.

Anyway, have an idea how to fix this? If more code is required, just let me know. Thanks in advance.

+4

All Articles