web service 问题 急!(100分)

  • 主题发起人 主题发起人 lin-bin
  • 开始时间 开始时间
L

lin-bin

Unregistered / Unconfirmed
GUEST, unregistred user!
我现用java写一个webservice 其中一个方法要返回一个数据表的记录,而客户端用
的是delphi,请问是否需要进行数据类型转换,是不是要自已在web服务端中封装一
个xml文件,然后再传到客户端时,再进行解析,如果是这样那么怎么来封装会比较
好呢。望高手指教。
 
JB 开发webservices时,会生成一个XML文件,根据这个文件,声成Delphi客户端
http://192.168.10.137:8080/webApp/services/webtest?wsdl
<?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;
?>
- <wsdl:definitions targetNamespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
xmlns=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
xmlns:apachesoap=&quot;http://xml.apache.org/xml-soap&quot;
xmlns:impl=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
xmlns:intf=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
xmlns:soapenc=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
xmlns:tns1=&quot;null&quot;
xmlns:tns2=&quot;http://webserv&quot;
xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
xmlns:wsdlsoap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;
xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;>
- <wsdl:types>
- <schema targetNamespace=&quot;null&quot;
xmlns=&quot;http://www.w3.org/2001/XMLSchema&quot;>
<import namespace=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
/>
- <complexType name=&quot;ArrayOffString&quot;>
- <complexContent>
- <restriction base=&quot;soapenc:Array&quot;>
<attribute ref=&quot;soapenc:arrayType&quot;
wsdl:arrayType=&quot;xsd:string[]&quot;
/>
</restriction>
</complexContent>
</complexType>
<element name=&quot;ArrayOffString&quot;
nillable=&quot;true&quot;
type=&quot;tns1:ArrayOffString&quot;
/>
- <complexType name=&quot;ArrayOffint&quot;>
- <complexContent>
- <restriction base=&quot;soapenc:Array&quot;>
<attribute ref=&quot;soapenc:arrayType&quot;
wsdl:arrayType=&quot;xsd:int[]&quot;
/>
</restriction>
</complexContent>
</complexType>
<element name=&quot;ArrayOffint&quot;
nillable=&quot;true&quot;
type=&quot;tns1:ArrayOffint&quot;
/>
</schema>
- <schema targetNamespace=&quot;http://webserv&quot;
xmlns=&quot;http://www.w3.org/2001/XMLSchema&quot;>
<import namespace=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
/>
- <complexType name=&quot;stManageAccount&quot;>
- <sequence>
<element name=&quot;p_operateID&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
<element name=&quot;p_accountNum&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
<element name=&quot;p_password&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
<element name=&quot;p_payType&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
<element name=&quot;p_payTele&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
<element name=&quot;p_businessArea&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
<element maxOccurs=&quot;unbounded&quot;
name=&quot;p_details&quot;
nillable=&quot;true&quot;
type=&quot;tns2:PropertyData&quot;
/>
<element name=&quot;p_actionCode&quot;
type=&quot;xsd:int&quot;
/>
<element name=&quot;p_CSPID&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
<element name=&quot;p_CSPName&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
<element name=&quot;p_CSPTypeID&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
<element name=&quot;p_CSPTypeName&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
</sequence>
</complexType>
- <complexType name=&quot;PropertyData&quot;>
- <sequence>
<element name=&quot;p_dataName&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
<element name=&quot;p_dataValue&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
</sequence>
</complexType>
<element name=&quot;stManageAccount&quot;
nillable=&quot;true&quot;
type=&quot;tns2:stManageAccount&quot;
/>
- <complexType name=&quot;OperateResult97&quot;>
- <sequence>
<element name=&quot;operateID&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
<element name=&quot;resultCode&quot;
type=&quot;xsd:int&quot;
/>
<element name=&quot;errorInfo&quot;
nillable=&quot;true&quot;
type=&quot;xsd:string&quot;
/>
</sequence>
</complexType>
<element name=&quot;OperateResult97&quot;
nillable=&quot;true&quot;
type=&quot;tns2:OperateResult97&quot;
/>
</schema>
</wsdl:types>
- <wsdl:message name=&quot;getStringResponse&quot;>
<wsdl:part name=&quot;getStringReturn&quot;
type=&quot;xsd:string&quot;
/>
</wsdl:message>
- <wsdl:message name=&quot;getAddResponse&quot;>
<wsdl:part name=&quot;getAddReturn&quot;
type=&quot;xsd:int&quot;
/>
</wsdl:message>
- <wsdl:message name=&quot;getArrayAddRequest&quot;>
<wsdl:part name=&quot;ss&quot;
type=&quot;tns1:ArrayOffint&quot;
/>
</wsdl:message>
- <wsdl:message name=&quot;setSampleRequest&quot;>
<wsdl:part name=&quot;sample&quot;
type=&quot;xsd:string&quot;
/>
</wsdl:message>
- <wsdl:message name=&quot;getStringRequest&quot;>
<wsdl:part name=&quot;s1&quot;
type=&quot;xsd:string&quot;
/>
<wsdl:part name=&quot;s2&quot;
type=&quot;xsd:string&quot;
/>
</wsdl:message>
<wsdl:message name=&quot;mainResponse&quot;
/>
<wsdl:message name=&quot;setNumberRequest&quot;
/>
<wsdl:message name=&quot;setNumberResponse&quot;
/>
- <wsdl:message name=&quot;mainRequest&quot;>
<wsdl:part name=&quot;args&quot;
type=&quot;tns1:ArrayOffString&quot;
/>
</wsdl:message>
- <wsdl:message name=&quot;ManageAccountRequest&quot;>
<wsdl:part name=&quot;p_ma&quot;
type=&quot;tns2:stManageAccount&quot;
/>
</wsdl:message>
- <wsdl:message name=&quot;ManageAccountResponse&quot;>
<wsdl:part name=&quot;ManageAccountReturn&quot;
type=&quot;tns2:OperateResult97&quot;
/>
</wsdl:message>
<wsdl:message name=&quot;getSampleRequest&quot;
/>
- <wsdl:message name=&quot;getAddRequest&quot;>
<wsdl:part name=&quot;s1&quot;
type=&quot;xsd:int&quot;
/>
<wsdl:part name=&quot;s2&quot;
type=&quot;xsd:int&quot;
/>
</wsdl:message>
- <wsdl:message name=&quot;getSampleResponse&quot;>
<wsdl:part name=&quot;getSampleReturn&quot;
type=&quot;xsd:string&quot;
/>
</wsdl:message>
<wsdl:message name=&quot;setSampleResponse&quot;
/>
- <wsdl:message name=&quot;getArrayAddResponse&quot;>
<wsdl:part name=&quot;getArrayAddReturn&quot;
type=&quot;xsd:int&quot;
/>
</wsdl:message>
- <wsdl:portType name=&quot;webtest&quot;>
- <wsdl:operation name=&quot;main&quot;
parameterOrder=&quot;args&quot;>
<wsdl:input message=&quot;impl:mainRequest&quot;
name=&quot;mainRequest&quot;
/>
<wsdl:output message=&quot;impl:mainResponse&quot;
name=&quot;mainResponse&quot;
/>
</wsdl:operation>
- <wsdl:operation name=&quot;getString&quot;
parameterOrder=&quot;s1 s2&quot;>
<wsdl:input message=&quot;impl:getStringRequest&quot;
name=&quot;getStringRequest&quot;
/>
<wsdl:output message=&quot;impl:getStringResponse&quot;
name=&quot;getStringResponse&quot;
/>
</wsdl:operation>
- <wsdl:operation name=&quot;setNumber&quot;>
<wsdl:input message=&quot;impl:setNumberRequest&quot;
name=&quot;setNumberRequest&quot;
/>
<wsdl:output message=&quot;impl:setNumberResponse&quot;
name=&quot;setNumberResponse&quot;
/>
</wsdl:operation>
- <wsdl:operation name=&quot;getSample&quot;>
<wsdl:input message=&quot;impl:getSampleRequest&quot;
name=&quot;getSampleRequest&quot;
/>
<wsdl:output message=&quot;impl:getSampleResponse&quot;
name=&quot;getSampleResponse&quot;
/>
</wsdl:operation>
- <wsdl:operation name=&quot;setSample&quot;
parameterOrder=&quot;sample&quot;>
<wsdl:input message=&quot;impl:setSampleRequest&quot;
name=&quot;setSampleRequest&quot;
/>
<wsdl:output message=&quot;impl:setSampleResponse&quot;
name=&quot;setSampleResponse&quot;
/>
</wsdl:operation>
- <wsdl:operation name=&quot;getAdd&quot;
parameterOrder=&quot;s1 s2&quot;>
<wsdl:input message=&quot;impl:getAddRequest&quot;
name=&quot;getAddRequest&quot;
/>
<wsdl:output message=&quot;impl:getAddResponse&quot;
name=&quot;getAddResponse&quot;
/>
</wsdl:operation>
- <wsdl:operation name=&quot;getArrayAdd&quot;
parameterOrder=&quot;ss&quot;>
<wsdl:input message=&quot;impl:getArrayAddRequest&quot;
name=&quot;getArrayAddRequest&quot;
/>
<wsdl:output message=&quot;impl:getArrayAddResponse&quot;
name=&quot;getArrayAddResponse&quot;
/>
</wsdl:operation>
- <wsdl:operation name=&quot;ManageAccount&quot;
parameterOrder=&quot;p_ma&quot;>
<wsdl:input message=&quot;impl:ManageAccountRequest&quot;
name=&quot;ManageAccountRequest&quot;
/>
<wsdl:output message=&quot;impl:ManageAccountResponse&quot;
name=&quot;ManageAccountResponse&quot;
/>
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name=&quot;webtestSoapBinding&quot;
type=&quot;impl:webtest&quot;>
<wsdlsoap:binding style=&quot;rpc&quot;
transport=&quot;http://schemas.xmlsoap.org/soap/http&quot;
/>
- <wsdl:operation name=&quot;main&quot;>
<wsdlsoap:operation soapAction=&quot;&quot;
/>
- <wsdl:input name=&quot;mainRequest&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:input>
- <wsdl:output name=&quot;mainResponse&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name=&quot;getString&quot;>
<wsdlsoap:operation soapAction=&quot;&quot;
/>
- <wsdl:input name=&quot;getStringRequest&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:input>
- <wsdl:output name=&quot;getStringResponse&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name=&quot;setNumber&quot;>
<wsdlsoap:operation soapAction=&quot;&quot;
/>
- <wsdl:input name=&quot;setNumberRequest&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:input>
- <wsdl:output name=&quot;setNumberResponse&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name=&quot;getSample&quot;>
<wsdlsoap:operation soapAction=&quot;&quot;
/>
- <wsdl:input name=&quot;getSampleRequest&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:input>
- <wsdl:output name=&quot;getSampleResponse&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name=&quot;setSample&quot;>
<wsdlsoap:operation soapAction=&quot;&quot;
/>
- <wsdl:input name=&quot;setSampleRequest&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:input>
- <wsdl:output name=&quot;setSampleResponse&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name=&quot;getAdd&quot;>
<wsdlsoap:operation soapAction=&quot;&quot;
/>
- <wsdl:input name=&quot;getAddRequest&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:input>
- <wsdl:output name=&quot;getAddResponse&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name=&quot;getArrayAdd&quot;>
<wsdlsoap:operation soapAction=&quot;&quot;
/>
- <wsdl:input name=&quot;getArrayAddRequest&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:input>
- <wsdl:output name=&quot;getArrayAddResponse&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name=&quot;ManageAccount&quot;>
<wsdlsoap:operation soapAction=&quot;&quot;
/>
- <wsdl:input name=&quot;ManageAccountRequest&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:input>
- <wsdl:output name=&quot;ManageAccountResponse&quot;>
<wsdlsoap:body encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
namespace=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
use=&quot;encoded&quot;
/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name=&quot;webtestService&quot;>
- <wsdl:port binding=&quot;impl:webtestSoapBinding&quot;
name=&quot;webtest&quot;>
<wsdlsoap:address location=&quot;http://192.168.10.137:8080/webApp/services/webtest&quot;
/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
 
re:HANFI,你上面的这个xml是一个公布给客户端的一个接口吧,而我是要公布接口后,再调用里面的方法,来返回表数据的,然后再赋给clientDataset。
 
还有一个问题,如何在客户端用sql语句来提交二进制的数据呢,如:图片等。
 
后退
顶部