如何配置WebLogic 10.3.6使用JAX-WS生成的Web Service,以便在单个WSDL文件声明(而不是导入声明)中包含对象Schema?
示例代码:
界面
import javax.ejb.Local;
@Local
public interface CustomerBeanLocal {
public void updateCustomer(Customer customer);
}
会话Bean
import javax.ejb.Stateless;
import javax.jws.WebService;
@Stateless
@WebService
public class CustomerBean implements CustomerBeanLocal {
@Override
public void updateCustomer(Customer customer) {
// Do stuff...
}
}
已生成WSDL
我们不需要在下面的例子中用<xsd:import>
标记导入模式定义,而是在WSDL中声明模式定义,这意味着所有的合约信息都在一个WSDL文件中,不依赖于其他文件。
<!-- ... -->
<types>
<xsd:schema>
<xsd:import namespace="http://mybeans/" schemaLocation="http://192.168.10.1:7001/CustomerBean/CustomerBeanService?xsd=1" />
</xsd:schema>
</types>
<!-- ... -->
与WildFly相同的代码包括WSDL内部的模式类型,并且不使用导入功能。经过一些研究,我没有找到一种方法来配置bean/服务器在WebLogic中执行此操作(没有找到JAX-WS或WebLogic专有功能来执行此操作)。
我理解导出模式的好处(可重用性等),但项目要求类型必须在WSDL内部声明,而不是导入。
2条答案
按热度按时间jfewjypa1#
是否使用提供的wsgen-tool生成wsdl-generation?如果是,则有一个名为的参数:
这正是你想要的。
dwthyt8l2#
您可以使用jaxws-maven-plugin自动化wsgen。最新版本的插件使用jaxws 2.2,但如果您指定
target
2.1,生成的工件将与您的平台兼容。将生成的WSDL文件打包到war文件中(默认情况下在WEB-INF/wsdl下),然后将wsdlLocation添加到注解中。