用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生成的接口应该如何调用呢? 哪位朋友做过类似的项目?指点一下?
解决方案 »
- 通过软件实现qq消息记录采集和qq发送好友信息
- pdf。ocx的打印问题
- fastreport 竖线问题?
- 显示指定路径的图片
- BrightnessChange(ImageBeforeChange.Picture.Bitmap,ImageAfterChange.Picture.Bitmap,ValueChange)在文什么意思
- 求助关于线程的创建和调用的基本问题,刚接触线程不是很懂,谢谢大家
- Delphi2007新功能 -- 有限的栈对象
- Delphi算法请教一?
- 如何处理TidFtp控件编程时出错问题
- 提个有点难度的问题
- 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被禁掉了,试都没法试