简体   繁体   中英

How do you generate a SOAP 1.2 WSDL with Enunciate?

I am working on a web service written in Java and generating the web service client with Enunciate.

The project was working fine with SOAP 1.1, but when I tried to upgrade to SOAP 1.2, I ran into some difficulties. The WSDL that is generated by Enunciate remains SOAP 1.1 and this is what is packaged into the client.

In following the advice here: https://jax-ws.java.net/2.1.5/docs/soap12.html I attempted to annotate the service to indicate SOAP 1.2, but to no avail:

@WebService(endpointInterface = "com.example.MyService", serviceName="myService")
@Service("myService")
@BindingType(value=javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
public class  MyServiceImpl implements MyService {

The Maven plugin configuration looks something like this:

        <plugin>
            <groupId>org.codehaus.enunciate</groupId>
            <artifactId>maven-enunciate-plugin</artifactId>
            <version>1.29</version>
            <executions>
                <execution>
                    <id>docs</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>docs</goal>
                    </goals>
                    <configuration>
                        <configFile>enunciate.xml</configFile>
                    </configuration>
                </execution>
                <execution>
                    <id>install</id>
                    <goals>
                        <goal>install-artifact</goal>
                        <goal>deploy-artifact</goal>
                    </goals>
                    <configuration>
                        <enunciateArtifactId>java.client.library</enunciateArtifactId>
                        <groupId>com.example</groupId>
                        <artifactId>myServiceClient</artifactId>
                        <version>${client.version}</version>
                    </configuration>
                </execution>
            </executions>
        </plugin>   

I also do not see anything that looks helpful on the enunciate XML documentation at https://github.com/stoicflame/enunciate/wiki/Module-XML .

How do I go about getting a SOAP 1.2 generated WSDL from Enunciate?

Update

I have been doing a little more digging and I see that the WSDL is generated through the wsdl.fmt and that it has the SOAP 1.1 namespaces and such hard-coded and that it doesn't account for the annotation or invoke CXF.

Obviously, I can invoke CXF to generate SOAP 1.2 WSDLs and can use Enunciate to re-use this through the useFile attribute on the wsdl element. Is there any way to include this WSDL file in the Enunciate client jar? Without it, the proxy generation seems to fail.

What I ultimately discovered is that Enunciate does not support either SOAP 1.2 WSDLs or the mix and match approach upon which I was trying to fall back. It is planned for addition to a later version:

https://github.com/stoicflame/enunciate/issues/95#issuecomment-123498784

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