简体   繁体   English

如何使用Enunciate生成SOAP 1.2 WSDL?

[英]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. 我正在研究用Java编写的Web服务,并使用Enunciate生成Web服务客户端。

The project was working fine with SOAP 1.1, but when I tried to upgrade to SOAP 1.2, I ran into some difficulties. 该项目在SOAP 1.1上运行正常,但是当我尝试升级到SOAP 1.2时,遇到了一些困难。 The WSDL that is generated by Enunciate remains SOAP 1.1 and this is what is packaged into the client. 由Enunciate生成的WSDL仍然是SOAP 1.1,这就是打包到客户端中的东西。

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: 在这里遵循以下建议: https : //jax-ws.java.net/2.1.5/docs/soap12.html我试图注释该服务以指示SOAP 1.2,但无济于事:

@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: Maven插件配置如下所示:

        <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 . https://github.com/stoicflame/enunciate/wiki/Module-XML上,对于可识别的XML文档也没有任何帮助。

How do I go about getting a SOAP 1.2 generated WSDL from Enunciate? 如何从Enunciate获取SOAP 1.2生成的WSDL?

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. 我做了一些进一步的挖掘,发现WSDL是通过wsdl.fmt生成的,并且它具有SOAP 1.1命名空间和类似的硬编码,并且它不考虑注释或调用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. 显然,我可以调用CXF来生成SOAP 1.2 WSDL,并且可以通过wsdl元素上的useFile属性使用Enunciate重新使用它。 Is there any way to include this WSDL file in the Enunciate client jar? 有什么方法可以在Enunciate客户端jar中包含此WSDL文件? 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. 我最终发现,Enunciate不支持SOAP 1.2 WSDL或我试图回退的混合匹配方法。 It is planned for addition to a later version: 计划将其添加到更高版本:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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