我正在尝试寻找是否有一种方法可以自定义,例如CSID2ExtRefs
操作为ChemSpider 网络服务 http://www.chemspider.com/Search.asmx?WSDL传递一个字符串列表作为参数之一并返回对象列表:
<!-- Request element: -->
<s:element name="CSID2ExtRefs">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="CSID" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="datasources" type="tns:ArrayOfString"/>
<s:element minOccurs="0" maxOccurs="1" name="token" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<!-- Response element: -->
<s:element name="CSID2ExtRefsResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CSID2ExtRefsResult" type="tns:ArrayOfExtRef"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfExtRef">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="ExtRef" type="tns:ExtRef"/>
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string"/>
</s:sequence>
</s:complexType>
生成的wsimport
接口方法是(与jaxws:enableWrapperStyle = true
):
@WebMethod(operationName = "CSID2ExtRefs", action = "http://www.chemspider.com/CSID2ExtRefs")
@WebResult(name = "CSID2ExtRefsResult", targetNamespace = "http://www.chemspider.com/")
@RequestWrapper(localName = "CSID2ExtRefs", targetNamespace = "http://www.chemspider.com/", className = "chemspider.core.CSID2ExtRefsRequest")
@ResponseWrapper(localName = "CSID2ExtRefsResponse", targetNamespace = "http://www.chemspider.com/", className = "chemspider.core.CSID2ExtRefsResponse")
public ArrayOfExtRef csid2ExtRefs(
@WebParam(name = "CSID", targetNamespace = "http://www.chemspider.com/")
int csid,
@WebParam(name = "datasources", targetNamespace = "http://www.chemspider.com/")
ArrayOfString datasources,
@WebParam(name = "token", targetNamespace = "http://www.chemspider.com/")
String token);
但我想要ArrayOfExtRef
and ArrayOfString
打开并转到列表,例如得到以下内容:
public List<ExtRef> csid2ExtRefs(
@WebParam(...)
int csid,
@WebParam(...)
List<String> datasources,
@WebParam(...)
String token);
如果我手动进行此更改,JAX-WS 工作正常。我想知道是否有办法写一个合适的定制 http://jax-ws.java.net/jax-ws-20-fcs/docs/customizations.html为了那个原因?