用java 写了个简单的web service 包括一个weather 类,和 getweather ,setweather 两个方法。生成的wsdl文件如下- <wsdl:definitions xmlns:axis2="http://service.pojo.sample" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns0="http://data.pojo.sample/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://service.pojo.sample/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://service.pojo.sample">
<wsdl:documentation>Weather POJO Service</wsdl:documentation>
- <wsdl:types>
- <xs:schema xmlns:ax21="http://data.pojo.sample/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://data.pojo.sample/xsd">
<xs:element name="Weather" type="ax21:Weather" />
- <xs:complexType name="Weather">
- <xs:sequence>
<xs:element name="forecast" nillable="true" type="xs:string" />
<xs:element name="howMuchRain" type="xs:float" />
<xs:element name="rain" type="xs:boolean" />
<xs:element name="temperature" type="xs:float" />
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ns="http://service.pojo.sample/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.pojo.sample/xsd">
- <xs:element name="getWeatherResponse">
- <xs:complexType>
- <xs:sequence>
<xs:element name="return" nillable="true" type="ns0:Weather" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="setWeather">
- <xs:complexType>
- <xs:sequence>
<xs:element name="weather" nillable="true" type="ns0:Weather" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="getWeatherMessage" />
- <wsdl:message name="getWeatherResponse">
<wsdl:part name="part1" element="ns1:getWeatherResponse" />
</wsdl:message>
- <wsdl:message name="setWeatherMessage">
<wsdl:part name="part1" element="ns1:setWeather" />
</wsdl:message>
- <wsdl:portType name="WeatherServicePortType">
- <wsdl:operation name="getWeather">
<wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:getWeatherMessage" wsaw:Action="urn:getWeather" />
<wsdl:output message="axis2:getWeatherResponse" />
</wsdl:operation>
- <wsdl:operation name="setWeather">
<wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:setWeatherMessage" wsaw:Action="urn:setWeather" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="WeatherServiceSOAP11Binding" type="axis2:WeatherServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <wsdl:operation name="getWeather">
<soap:operation soapAction="urn:getWeather" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="setWeather">
<soap:operation soapAction="urn:setWeather" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
- <wsdl:binding name="WeatherServiceSOAP12Binding" type="axis2:WeatherServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <wsdl:operation name="getWeather">
<soap12:operation soapAction="urn:getWeather" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="setWeather">
<soap12:operation soapAction="urn:setWeather" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
- <wsdl:binding name="WeatherServiceHttpBinding" type="axis2:WeatherServicePortType">
<http:binding verb="POST" />
- <wsdl:operation name="getWeather">
<http:operation location="getWeather" />
- <wsdl:input>
<mime:content type="text/xml" />
</wsdl:input>
- <wsdl:output>
<mime:content type="text/xml" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="setWeather">
<http:operation location="setWeather" />
- <wsdl:input>
<mime:content type="text/xml" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="WeatherService">
- <wsdl:port name="WeatherServiceSOAP11port_http" binding="axis2:WeatherServiceSOAP11Binding">
<soap:address location="http://61.144.225.35:80/axis2/services/WeatherService" />
</wsdl:port>
- <wsdl:port name="WeatherServiceSOAP12port_http" binding="axis2:WeatherServiceSOAP12Binding">
<soap12:address location="http://61.144.225.35:80/axis2/services/WeatherService" />
</wsdl:port>
- <wsdl:port name="WeatherServiceHttpport1" binding="axis2:WeatherServiceHttpBinding">
<http:address location="http://61.144.225.35:80/axis2/rest/WeatherService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
-------------------------------------------------------------------------------------------------------------------------------
我看过网上的一些delphi调用web service 的例子,在那些例子里,根据wsdl自动生成的接口里面都会有一个 ××××soap类,然后通过调用那些类来调用web service的方法。
可是我在 delphi 2007里面根据这个wsdl生成的接口里面没有那个类, 用delphi 7.0 生成的接口里面什么都没有。 我估计delphi7 生成不了接口应该是wsdl的版本问题。 axis2 生成的wsdl应该是2.0版本的。 我的问题是 delphi 2007生成的接口应该如何调用呢? 哪位朋友做过类似的项目?指点一下?
<wsdl:documentation>Weather POJO Service</wsdl:documentation>
- <wsdl:types>
- <xs:schema xmlns:ax21="http://data.pojo.sample/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://data.pojo.sample/xsd">
<xs:element name="Weather" type="ax21:Weather" />
- <xs:complexType name="Weather">
- <xs:sequence>
<xs:element name="forecast" nillable="true" type="xs:string" />
<xs:element name="howMuchRain" type="xs:float" />
<xs:element name="rain" type="xs:boolean" />
<xs:element name="temperature" type="xs:float" />
</xs:sequence>
</xs:complexType>
</xs:schema>
- <xs:schema xmlns:ns="http://service.pojo.sample/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.pojo.sample/xsd">
- <xs:element name="getWeatherResponse">
- <xs:complexType>
- <xs:sequence>
<xs:element name="return" nillable="true" type="ns0:Weather" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="setWeather">
- <xs:complexType>
- <xs:sequence>
<xs:element name="weather" nillable="true" type="ns0:Weather" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="getWeatherMessage" />
- <wsdl:message name="getWeatherResponse">
<wsdl:part name="part1" element="ns1:getWeatherResponse" />
</wsdl:message>
- <wsdl:message name="setWeatherMessage">
<wsdl:part name="part1" element="ns1:setWeather" />
</wsdl:message>
- <wsdl:portType name="WeatherServicePortType">
- <wsdl:operation name="getWeather">
<wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:getWeatherMessage" wsaw:Action="urn:getWeather" />
<wsdl:output message="axis2:getWeatherResponse" />
</wsdl:operation>
- <wsdl:operation name="setWeather">
<wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:setWeatherMessage" wsaw:Action="urn:setWeather" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="WeatherServiceSOAP11Binding" type="axis2:WeatherServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <wsdl:operation name="getWeather">
<soap:operation soapAction="urn:getWeather" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="setWeather">
<soap:operation soapAction="urn:setWeather" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
- <wsdl:binding name="WeatherServiceSOAP12Binding" type="axis2:WeatherServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <wsdl:operation name="getWeather">
<soap12:operation soapAction="urn:getWeather" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="setWeather">
<soap12:operation soapAction="urn:setWeather" style="document" />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
- <wsdl:binding name="WeatherServiceHttpBinding" type="axis2:WeatherServicePortType">
<http:binding verb="POST" />
- <wsdl:operation name="getWeather">
<http:operation location="getWeather" />
- <wsdl:input>
<mime:content type="text/xml" />
</wsdl:input>
- <wsdl:output>
<mime:content type="text/xml" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="setWeather">
<http:operation location="setWeather" />
- <wsdl:input>
<mime:content type="text/xml" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="WeatherService">
- <wsdl:port name="WeatherServiceSOAP11port_http" binding="axis2:WeatherServiceSOAP11Binding">
<soap:address location="http://61.144.225.35:80/axis2/services/WeatherService" />
</wsdl:port>
- <wsdl:port name="WeatherServiceSOAP12port_http" binding="axis2:WeatherServiceSOAP12Binding">
<soap12:address location="http://61.144.225.35:80/axis2/services/WeatherService" />
</wsdl:port>
- <wsdl:port name="WeatherServiceHttpport1" binding="axis2:WeatherServiceHttpBinding">
<http:address location="http://61.144.225.35:80/axis2/rest/WeatherService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
-------------------------------------------------------------------------------------------------------------------------------
我看过网上的一些delphi调用web service 的例子,在那些例子里,根据wsdl自动生成的接口里面都会有一个 ××××soap类,然后通过调用那些类来调用web service的方法。
可是我在 delphi 2007里面根据这个wsdl生成的接口里面没有那个类, 用delphi 7.0 生成的接口里面什么都没有。 我估计delphi7 生成不了接口应该是wsdl的版本问题。 axis2 生成的wsdl应该是2.0版本的。 我的问题是 delphi 2007生成的接口应该如何调用呢? 哪位朋友做过类似的项目?指点一下?
解决方案 »
- Delphi之reportBuilder報表選中某行或多行打印問題
- Qry2AID.Text:=Query1BID.Text; 取不到值????
- 应CSDN朋友的要求,贴需求分析说明书实例一份
- 一个关于窗体的简单问题!
- 如何对TImage的MetaFile进行操作?
- 下学期毕业,去深圳,DELPHI好找吗?
- 请问怎样将字符"*"转化为算式中的乘号
- 过年了,但还有个关于菜单的小问题要问,进者有分~~
- 已知一个汉字,怎样获得它的拼音呢?
- 我想做一个工艺品制造企业的软件,想先做一个问卷调查,该问些什么问题呢?
- delphi如何注入winlogon?
- 计算机操作系统中"独木桥问题"用PASICAL语言怎么写?
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : C:\Documents and Settings\Administrator\桌面\a.wsdl
// (2008-2-28 11:55:57 - 1.33.2.5)
// ************************************************************************ //unit a;interfaceuses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;type // ************************************************************************ //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
implementationinitializationend.
如果需要我给你传一个例子.
是四层的. client+Soap+com+数据库. 用到WEB服务.
所以默认情况下无法使用D7编写的客户端调用AXIS2的Web Service服务。但是好像有人搞定了,我也非常想知道。
但我的D2007/2010是简化版,WSDL Importer被禁掉了,试都没法试