We are facing issues generating the correct SOAP request from wsdl using apache cxf-codegen-plugin. The request that is being fired by the clilent is missing the SOAP envelope and SOAP body tags. Is that something we have to do programatically or is it something that can be configured in the plugin extraargs. Steps to reproduce 1. Included the cxf-codegen-plugin maven plugin version 3.0.3 in pom 2. During generate sources the sources are generated.
When the request is fired it looks like this
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CalculateSomething xmlns="http://something/0.3.1/" xmlns:ns2="http://something/0.1/" xmlns:ns3="http://something"></CalculateSomething>
instead of when we try via POSTMAN (and it succeeds) the request that should generated is
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns3:CalculateSomething xmlns:ns4="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns3="http://something" xmlns:ns2="http://something" xmlns="http://something/0.1/">
<ns3:request>...
</ns3:CalculateSomething>
</S:Body>
</S:Envelope>
Basically it looks like we are not able to generate the SOAP envelope correctly through the cxf codegen plugin, or we did not configure it properly. We have this in the pom.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/something.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.12</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/target/generated-sources/jaxb</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>