请问各位大虾如何通过web service发布和调取批量数据 string当然是可以的,这是soap的基本数据类型列表型的应该用Vector,也是支持的数据类型之一 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 to:jFresH_MaN(听说距离产生美,所以我将离开你!) 请问有具体的实例吗? 返回数组类型就可以了。在wsdl中搞一个anyType[] 我刚才做了一个简单的类,并发布成了服务,请问,对于这样的结果我怎么获取?//book.java 源码import java.util.*;public class book { public List getBook(String BookID) { List aa; aa = new ArrayList(); aa.add(new String("张三")); aa.add(new String("李四")); aa.add(new String("五五")); aa.add(new String("赵六")); return aa; }}//wsdl <?xml version="1.0" encoding="UTF-8" ?> - <wsdl:definitions targetNamespace="http://localhost:8080/axis/services/urn:book" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8080/axis/services/urn:book" xmlns:intf="http://localhost:8080/axis/services/urn:book" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">- <wsdl:message name="getBookRequest"> <wsdl:part name="in0" type="xsd:string" /> </wsdl:message>- <wsdl:message name="getBookResponse"> <wsdl:part name="getBookReturn" type="soapenc:Array" /> </wsdl:message>- <wsdl:portType name="book">- <wsdl:operation name="getBook" parameterOrder="in0"> <wsdl:input message="impl:getBookRequest" name="getBookRequest" /> <wsdl:output message="impl:getBookResponse" name="getBookResponse" /> </wsdl:operation> </wsdl:portType>- <wsdl:binding name="urn:bookSoapBinding" type="impl:book"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> - <wsdl:operation name="getBook"> <wsdlsoap:operation soapAction="" /> - <wsdl:input name="getBookRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" /> </wsdl:input>- <wsdl:output name="getBookResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/services/urn:book" use="encoded" /> </wsdl:output> </wsdl:operation> </wsdl:binding>- <wsdl:service name="bookService">- <wsdl:port binding="impl:urn:bookSoapBinding" name="urn:book"> <wsdlsoap:address location="http://localhost:8080/axis/services/urn:book" /> </wsdl:port> </wsdl:service> </wsdl:definitions> 数据大的时候建议采用附件的方式传输!不然。等着down吧。 这于这个结果,直接获取。建议用Vecter或List,注意有的版本支持List有问题。如果确实是很大量的数据,建议直接传xml信息,或者倒成文本文件压缩后传。或者用FTP方式,或者直接写Socket freemark中遇到的问题 java变量 JFreeChart热Map 的例子 请大家帮忙优化一个SQL <FCK:editor>赋值问题,继续在线等。 求一好的jsp时间标签及jsp表格标签,谢谢。 调用WSDL2Java生成客户端代码时出错!急!!!!!!!! 用 ==null 作判断条件有什么弊端? 将class文件用混淆器处理后访问的时候出现怪问题!!! 如何简单取得XML的element的值,请相助 客户端和服务端的通信!! sql2000数据库的某字段类型为text,怎样在javabean里怎样读取?
import java.util.*;
public class book {
public List getBook(String BookID) {
List aa;
aa = new ArrayList();
aa.add(new String("张三"));
aa.add(new String("李四"));
aa.add(new String("五五"));
aa.add(new String("赵六"));
return aa;
}
}//wsdl
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://localhost:8080/axis/services/urn:book" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8080/axis/services/urn:book" xmlns:intf="http://localhost:8080/axis/services/urn:book" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:message name="getBookRequest">
<wsdl:part name="in0" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="getBookResponse">
<wsdl:part name="getBookReturn" type="soapenc:Array" />
</wsdl:message>
- <wsdl:portType name="book">
- <wsdl:operation name="getBook" parameterOrder="in0">
<wsdl:input message="impl:getBookRequest" name="getBookRequest" />
<wsdl:output message="impl:getBookResponse" name="getBookResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="urn:bookSoapBinding" type="impl:book">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getBook">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getBookRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" />
</wsdl:input>
- <wsdl:output name="getBookResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/services/urn:book" use="encoded" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="bookService">
- <wsdl:port binding="impl:urn:bookSoapBinding" name="urn:book">
<wsdlsoap:address location="http://localhost:8080/axis/services/urn:book" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
如果确实是很大量的数据,建议直接传xml信息,或者倒成文本文件压缩后传。或者用FTP方式,或者直接写Socket