繁体   English   中英

如何使用Enunciate生成SOAP 1.2 WSDL?

[英]How do you generate a SOAP 1.2 WSDL with Enunciate?

我正在研究用Java编写的Web服务,并使用Enunciate生成Web服务客户端。

该项目在SOAP 1.1上运行正常,但是当我尝试升级到SOAP 1.2时,遇到了一些困难。 由Enunciate生成的WSDL仍然是SOAP 1.1,这就是打包到客户端中的东西。

在这里遵循以下建议: 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 {

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>   

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

如何从Enunciate获取SOAP 1.2生成的WSDL?

更新资料

我做了一些进一步的挖掘,发现WSDL是通过wsdl.fmt生成的,并且它具有SOAP 1.1命名空间和类似的硬编码,并且它不考虑注释或调用CXF。

显然,我可以调用CXF来生成SOAP 1.2 WSDL,并且可以通过wsdl元素上的useFile属性使用Enunciate重新使用它。 有什么方法可以在Enunciate客户端jar中包含此WSDL文件? 没有它,代理生成似乎会失败。

我最终发现,Enunciate不支持SOAP 1.2 WSDL或我试图回退的混合匹配方法。 计划将其添加到更高版本:

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

暂无
暂无

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

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