java - 如何在 Spring 中生成没有默认请求/响应后缀的 wsdl?

标签 java spring-ws

第 3 方已向我提供了 Web 服务方法的定义,我已经创建了 java 类,maven schemagen 插件从这些类中出色地生成了 xsd。然后我设置了一个 spring-ws-servlet 等来发布 wsdl,只有 WSDL11Definition 类需要请求和响应后缀....我没有后缀。方法名称是 getAttribute、setAttribute、refreshDetails、manageAttribute 等。有人知道解决这个问题的方法吗?是否有其他可以引用的 wsdl 定义类来执行此操作,或者是否有其他提供程序(而不是 defaultWsdl11Definition 使用的 suffixProviders)?

任何帮助将不胜感激!

最佳答案

Spring-WS 是围绕 "schema first" design 设计的,而不是“代码优先”:

When creating Web services, there are two development styles: Contract Last and Contract First. When using a contract-last approach, you start with the Java code, and let the Web service contract (WSDL, see sidebar) be generated from that. When using contract-first, you start with the WSDL contract, and use Java to implement said contract.

Spring-WS only supports the contract-first development style, and this section explains why.

可以以“代码优先”的方式使其工作,但您将面临一场战斗。

如果您想坚持使用 Spring-WS,那么我强烈建议您使用 Web 服务规范编写描述操作的 XML 模式,然后从该模式生成 java,或者手动编写 java。

关于java - 如何在 Spring 中生成没有默认请求/响应后缀的 wsdl?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3227985/

相关文章:

Java 编码问题与 Ñ

java - 如何解析内存字符串以获取私钥和​​公钥 RSA

spring - 如何在使用第三方 Web 服务时使用 PayloadLoggingInterceptor 和 SOAPLoggingInterceptor 拦截器

java - 获取 com.sun.xml.wss.XWSSecurityException 的 NoClassDefFoundError

java - 无法为 Spring Web 服务的元素找到 BeanDefinitionParser

java - 如何使用方法测试java类

java - 无法从 Map<String,Object> 转换为 Map<String,List<Map<String,String>>>

java - 遍历矩阵的匝数时的最大和

spring - 是否可以在 Spring WS web 服务中重命名响应 namespace 前缀?

Java SSL 错误 403 禁止访问