java2ws:在wsdl中保留请求响应命名空间

时间:2011-06-10 00:22:57

标签: jax-ws

我通过maven插件运行java2ws。我发现生成的wsdl没有 保留请求/响应对象树的名称空间。我想知道什么样的设置 /注释我可以设置允许这种情况发生吗?

例如,

@WebService(name = "MyService")
@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL, parameterStyle = ParameterStyle.BARE)
public interface IMyService extends MyBase {
@WebResult(targetNamespace = "mypackage.response")
public MyResponse findNames(
@WebParam(targetNamespace = "mypackage.request") MyRequest request);
}

运行java2ws generate,

<wsdl:definitions name="MyService" targetNamespace="http://mypackage/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://mypackage/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">    
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://mypackage/" attributeFormDefault="unqualified"
elementFormDefault="unqualified" targetNamespace="http://mypackage/">

然而,我希望,

<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap"  xmlns:impl="urn:mypackage"
xmlns:intf="urn:mypackage" xmlns:tns1="http://request.mypackage"  xmlns:tns5="http://response.mypackage"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"  xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:mypackage">

请分享您对什么样的设置可以引导我达到预期wsdl的想法。谢谢。

0 个答案:

没有答案
相关问题