我只需要调用服务就可以,我用的是axis进行客户端的开发。其中包括Update、Add、Get三个服务函数而我也只关心这三个,
Update和Add两个方法的输入参数和返回值都是基本数据类型在axis中很好设置,并且我已经成功的调用了没有问题。
问题出现在Get方法上,通过看WSDL了解到它的输入参数是string这没问题,但是返回值是一个叫ArrayOfString的应该是自定义的数据类型,
就不知道怎么调用了。同学说可以用MyEclipse的Web Service功能自动生成调用代码,我也试了可以是可以,但是需要jdk1.5以上,可是系统的
是1.4.2版本的,生成出来的很多代码放到上面都报错不认的,又不能因为加个服务就把jdk换了是不可能的。
还请各位帮帮忙吧,我一直在线等着,如果能提供些调用Get方法或定义ArrayOfString数据类型的代码,鄙人感激不尽了。。。谢谢了
5 个解决方案
#1
内容太长了我分开贴
<?xml version="1.0" encoding="utf-8" ?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="HelloWorld">
<s:complexType />
</s:element>
<s:element name="HelloWorldResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Add">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="fbm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdh" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdz" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ffzr" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="ffl" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="fkzq" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fgsdm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="flx" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fsszd" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AddResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Update">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="fxh" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="fbm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdh" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdz" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ffzr" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="ffl" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="fkzq" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fgsdm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="flx" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fsszd" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="UpdateResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="UpdateResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<?xml version="1.0" encoding="utf-8" ?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="HelloWorld">
<s:complexType />
</s:element>
<s:element name="HelloWorldResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Add">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="fbm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdh" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdz" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ffzr" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="ffl" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="fkzq" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fgsdm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="flx" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fsszd" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AddResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Update">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="fxh" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="fbm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdh" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdz" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ffzr" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="ffl" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="fkzq" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fgsdm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="flx" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fsszd" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="UpdateResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="UpdateResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
#2
<s:element name="Get">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="fbm" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetResult" type="s0:ArrayOfString" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
</s:sequence>
</s:complexType>
</s:schema>
</types>
<message name="HelloWorldSoapIn">
<part name="parameters" element="s0:HelloWorld" />
</message>
<message name="HelloWorldSoapOut">
<part name="parameters" element="s0:HelloWorldResponse" />
</message>
<message name="AddSoapIn">
<part name="parameters" element="s0:Add" />
</message>
<message name="AddSoapOut">
<part name="parameters" element="s0:AddResponse" />
</message>
<message name="UpdateSoapIn">
<part name="parameters" element="s0:Update" />
</message>
<message name="UpdateSoapOut">
<part name="parameters" element="s0:UpdateResponse" />
</message>
<message name="GetSoapIn">
<part name="parameters" element="s0:Get" />
</message>
<message name="GetSoapOut">
<part name="parameters" element="s0:GetResponse" />
</message>
<portType name="WSInterfaceSoap">
<operation name="HelloWorld">
<input message="s0:HelloWorldSoapIn" />
<output message="s0:HelloWorldSoapOut" />
</operation>
<operation name="Add">
<input message="s0:AddSoapIn" />
<output message="s0:AddSoapOut" />
</operation>
<operation name="Update">
<input message="s0:UpdateSoapIn" />
<output message="s0:UpdateSoapOut" />
</operation>
<operation name="Get">
<input message="s0:GetSoapIn" />
<output message="s0:GetSoapOut" />
</operation>
</portType>
<binding name="WSInterfaceSoap" type="s0:WSInterfaceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="HelloWorld">
<soap:operation soapAction="http://tempuri.org/HelloWorld" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Add">
<soap:operation soapAction="http://tempuri.org/Add" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Update">
<soap:operation soapAction="http://tempuri.org/Update" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Get">
<soap:operation soapAction="http://tempuri.org/Get" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="WSInterface">
<port name="WSInterfaceSoap" binding="s0:WSInterfaceSoap">
<soap:address location="http://192.168.1.112/WSInterface.asmx" />
</port>
</service>
</definitions>
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="fbm" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetResult" type="s0:ArrayOfString" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
</s:sequence>
</s:complexType>
</s:schema>
</types>
<message name="HelloWorldSoapIn">
<part name="parameters" element="s0:HelloWorld" />
</message>
<message name="HelloWorldSoapOut">
<part name="parameters" element="s0:HelloWorldResponse" />
</message>
<message name="AddSoapIn">
<part name="parameters" element="s0:Add" />
</message>
<message name="AddSoapOut">
<part name="parameters" element="s0:AddResponse" />
</message>
<message name="UpdateSoapIn">
<part name="parameters" element="s0:Update" />
</message>
<message name="UpdateSoapOut">
<part name="parameters" element="s0:UpdateResponse" />
</message>
<message name="GetSoapIn">
<part name="parameters" element="s0:Get" />
</message>
<message name="GetSoapOut">
<part name="parameters" element="s0:GetResponse" />
</message>
<portType name="WSInterfaceSoap">
<operation name="HelloWorld">
<input message="s0:HelloWorldSoapIn" />
<output message="s0:HelloWorldSoapOut" />
</operation>
<operation name="Add">
<input message="s0:AddSoapIn" />
<output message="s0:AddSoapOut" />
</operation>
<operation name="Update">
<input message="s0:UpdateSoapIn" />
<output message="s0:UpdateSoapOut" />
</operation>
<operation name="Get">
<input message="s0:GetSoapIn" />
<output message="s0:GetSoapOut" />
</operation>
</portType>
<binding name="WSInterfaceSoap" type="s0:WSInterfaceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="HelloWorld">
<soap:operation soapAction="http://tempuri.org/HelloWorld" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Add">
<soap:operation soapAction="http://tempuri.org/Add" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Update">
<soap:operation soapAction="http://tempuri.org/Update" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Get">
<soap:operation soapAction="http://tempuri.org/Get" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="WSInterface">
<port name="WSInterfaceSoap" binding="s0:WSInterfaceSoap">
<soap:address location="http://192.168.1.112/WSInterface.asmx" />
</port>
</service>
</definitions>
#3
上面的WSDL是一个完整的,三楼是与Get、ArrayOfString有关的定义;
我再把生成的ArrayOfString类的代码贴出来,大家看看。其中一些xml的定义是1.4.2不认的,不知道源代码是不是这么简单
package org.tempuri;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ArrayOfString", propOrder = {
"string"
})
public class ArrayOfString {
@XmlElement(required = true, nillable = true)
protected List<String> string;
public List<String> getString() {
if (string == null) {
string = new ArrayList<String>();
}
return this.string;
}
}
我再把生成的ArrayOfString类的代码贴出来,大家看看。其中一些xml的定义是1.4.2不认的,不知道源代码是不是这么简单
package org.tempuri;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ArrayOfString", propOrder = {
"string"
})
public class ArrayOfString {
@XmlElement(required = true, nillable = true)
protected List<String> string;
public List<String> getString() {
if (string == null) {
string = new ArrayList<String>();
}
return this.string;
}
}
#4
#5
我也在搞这个问题 ,兄台是怎么解决的??
#1
内容太长了我分开贴
<?xml version="1.0" encoding="utf-8" ?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="HelloWorld">
<s:complexType />
</s:element>
<s:element name="HelloWorldResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Add">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="fbm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdh" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdz" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ffzr" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="ffl" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="fkzq" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fgsdm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="flx" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fsszd" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AddResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Update">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="fxh" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="fbm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdh" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdz" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ffzr" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="ffl" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="fkzq" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fgsdm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="flx" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fsszd" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="UpdateResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="UpdateResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<?xml version="1.0" encoding="utf-8" ?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="HelloWorld">
<s:complexType />
</s:element>
<s:element name="HelloWorldResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="HelloWorldResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Add">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="fbm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdh" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdz" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ffzr" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="ffl" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="fkzq" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fgsdm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="flx" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fsszd" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AddResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Update">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="fxh" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="fbm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdw" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdh" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fdz" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ffzr" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="ffl" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="fkzq" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fgsdm" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="flx" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname4" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname5" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftel6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ftelname6" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="fsszd" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="UpdateResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="UpdateResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
#2
<s:element name="Get">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="fbm" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetResult" type="s0:ArrayOfString" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
</s:sequence>
</s:complexType>
</s:schema>
</types>
<message name="HelloWorldSoapIn">
<part name="parameters" element="s0:HelloWorld" />
</message>
<message name="HelloWorldSoapOut">
<part name="parameters" element="s0:HelloWorldResponse" />
</message>
<message name="AddSoapIn">
<part name="parameters" element="s0:Add" />
</message>
<message name="AddSoapOut">
<part name="parameters" element="s0:AddResponse" />
</message>
<message name="UpdateSoapIn">
<part name="parameters" element="s0:Update" />
</message>
<message name="UpdateSoapOut">
<part name="parameters" element="s0:UpdateResponse" />
</message>
<message name="GetSoapIn">
<part name="parameters" element="s0:Get" />
</message>
<message name="GetSoapOut">
<part name="parameters" element="s0:GetResponse" />
</message>
<portType name="WSInterfaceSoap">
<operation name="HelloWorld">
<input message="s0:HelloWorldSoapIn" />
<output message="s0:HelloWorldSoapOut" />
</operation>
<operation name="Add">
<input message="s0:AddSoapIn" />
<output message="s0:AddSoapOut" />
</operation>
<operation name="Update">
<input message="s0:UpdateSoapIn" />
<output message="s0:UpdateSoapOut" />
</operation>
<operation name="Get">
<input message="s0:GetSoapIn" />
<output message="s0:GetSoapOut" />
</operation>
</portType>
<binding name="WSInterfaceSoap" type="s0:WSInterfaceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="HelloWorld">
<soap:operation soapAction="http://tempuri.org/HelloWorld" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Add">
<soap:operation soapAction="http://tempuri.org/Add" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Update">
<soap:operation soapAction="http://tempuri.org/Update" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Get">
<soap:operation soapAction="http://tempuri.org/Get" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="WSInterface">
<port name="WSInterfaceSoap" binding="s0:WSInterfaceSoap">
<soap:address location="http://192.168.1.112/WSInterface.asmx" />
</port>
</service>
</definitions>
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="fbm" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetResult" type="s0:ArrayOfString" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfString">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
</s:sequence>
</s:complexType>
</s:schema>
</types>
<message name="HelloWorldSoapIn">
<part name="parameters" element="s0:HelloWorld" />
</message>
<message name="HelloWorldSoapOut">
<part name="parameters" element="s0:HelloWorldResponse" />
</message>
<message name="AddSoapIn">
<part name="parameters" element="s0:Add" />
</message>
<message name="AddSoapOut">
<part name="parameters" element="s0:AddResponse" />
</message>
<message name="UpdateSoapIn">
<part name="parameters" element="s0:Update" />
</message>
<message name="UpdateSoapOut">
<part name="parameters" element="s0:UpdateResponse" />
</message>
<message name="GetSoapIn">
<part name="parameters" element="s0:Get" />
</message>
<message name="GetSoapOut">
<part name="parameters" element="s0:GetResponse" />
</message>
<portType name="WSInterfaceSoap">
<operation name="HelloWorld">
<input message="s0:HelloWorldSoapIn" />
<output message="s0:HelloWorldSoapOut" />
</operation>
<operation name="Add">
<input message="s0:AddSoapIn" />
<output message="s0:AddSoapOut" />
</operation>
<operation name="Update">
<input message="s0:UpdateSoapIn" />
<output message="s0:UpdateSoapOut" />
</operation>
<operation name="Get">
<input message="s0:GetSoapIn" />
<output message="s0:GetSoapOut" />
</operation>
</portType>
<binding name="WSInterfaceSoap" type="s0:WSInterfaceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="HelloWorld">
<soap:operation soapAction="http://tempuri.org/HelloWorld" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Add">
<soap:operation soapAction="http://tempuri.org/Add" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Update">
<soap:operation soapAction="http://tempuri.org/Update" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="Get">
<soap:operation soapAction="http://tempuri.org/Get" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="WSInterface">
<port name="WSInterfaceSoap" binding="s0:WSInterfaceSoap">
<soap:address location="http://192.168.1.112/WSInterface.asmx" />
</port>
</service>
</definitions>
#3
上面的WSDL是一个完整的,三楼是与Get、ArrayOfString有关的定义;
我再把生成的ArrayOfString类的代码贴出来,大家看看。其中一些xml的定义是1.4.2不认的,不知道源代码是不是这么简单
package org.tempuri;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ArrayOfString", propOrder = {
"string"
})
public class ArrayOfString {
@XmlElement(required = true, nillable = true)
protected List<String> string;
public List<String> getString() {
if (string == null) {
string = new ArrayList<String>();
}
return this.string;
}
}
我再把生成的ArrayOfString类的代码贴出来,大家看看。其中一些xml的定义是1.4.2不认的,不知道源代码是不是这么简单
package org.tempuri;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ArrayOfString", propOrder = {
"string"
})
public class ArrayOfString {
@XmlElement(required = true, nillable = true)
protected List<String> string;
public List<String> getString() {
if (string == null) {
string = new ArrayList<String>();
}
return this.string;
}
}
#4
#5
我也在搞这个问题 ,兄台是怎么解决的??