简体   繁体   English

如何使用Axis2将数组传递给Java中的SOAP Web服务?

[英]How to pass an array to soap web service in java using axis2?

I have a web service that is developed with soap using axis2 implementaion but my server side needs array as method argument. 我有一个使用axis2实现用soap开发的Web服务,但是我的服务器端需要数组作为方法参数。 How to expose an array in soap request? 如何在soap请求中公开数组?

public boolean addOperation(String params[]){
    ...
}

You would need to make changes to the Web service WSDL first and then regenerate the Skeleton from the WSDL, like wise the WebService client will have to regenerate Client Stub with new WSDL and use it on the client side. 您将需要首先对Web服务WSDL进行更改,然后从WSDL重新生成Skeleton,就像明智的选择一样,WebService客户端将必须使用新的WSDL重新生成Client Stub并在客户端使用它。

Example of changes to WSDL: WSDL更改示例:

<complexType name='ArrayOfString'>
    <sequence>
        <element name='item' type='xsd:string' maxOccurs='unbounded'/>
    </sequence> 
</complexType>

This is a similar question Describing a string array in a wsdl file 这是一个类似的问题, 描述wsdl文件中的字符串数组

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

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