diff options
Diffstat (limited to 'tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather')
4 files changed, 0 insertions, 257 deletions
diff --git a/tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather/Makefile.am b/tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather/Makefile.am deleted file mode 100644 index d0450ef707..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -deploydir=$(prefix)/PythonWeatherForecast/deploy -compositedir=$(deploydir)/sample.weather - -composite_DATA = *.composite *.wsdl *.py -EXTRA_DIST = *.composite *.wsdl *.py - diff --git a/tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather/WeatherForecast.wsdl b/tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather/WeatherForecast.wsdl deleted file mode 100644 index ec39e2287a..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather/WeatherForecast.wsdl +++ /dev/null @@ -1,133 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns:tns="http://www.webservicex.net" - targetNamespace="http://www.webservicex.net" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> - <wsdl:types> - <xsd:schema elementFormDefault="qualified" targetNamespace="http://www.webservicex.net"> - <xsd:element name="GetWeatherByZipCode"> - <xsd:complexType> - <xsd:sequence> - <xsd:element minOccurs="0" maxOccurs="1" name="ZipCode" type="xsd:string" /> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="GetWeatherByZipCodeResponse"> - <xsd:complexType> - <xsd:sequence> - <xsd:element minOccurs="1" maxOccurs="1" name="GetWeatherByZipCodeResult" type="tns:WeatherForecasts" /> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:complexType name="WeatherForecasts"> - <xsd:sequence> - <xsd:element minOccurs="1" maxOccurs="1" name="Latitude" type="xsd:float" /> - <xsd:element minOccurs="1" maxOccurs="1" name="Longitude" type="xsd:float" /> - <xsd:element minOccurs="1" maxOccurs="1" name="AllocationFactor" type="xsd:float" /> - <xsd:element minOccurs="0" maxOccurs="1" name="FipsCode" type="xsd:string" /> - <xsd:element minOccurs="0" maxOccurs="1" name="PlaceName" type="xsd:string" /> - <xsd:element minOccurs="0" maxOccurs="1" name="StateCode" type="xsd:string" /> - <xsd:element minOccurs="0" maxOccurs="1" name="Status" type="xsd:string" /> - <xsd:element minOccurs="0" maxOccurs="1" name="Details" type="tns:ArrayOfWeatherData" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="ArrayOfWeatherData"> - <xsd:sequence> - <xsd:element minOccurs="0" maxOccurs="unbounded" name="WeatherData" type="tns:WeatherData" /> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="WeatherData"> - <xsd:sequence> - <xsd:element minOccurs="0" maxOccurs="1" name="Day" type="xsd:string" /> - <xsd:element minOccurs="0" maxOccurs="1" name="WeatherImage" type="xsd:string" /> - <xsd:element minOccurs="0" maxOccurs="1" name="MaxTemperatureF" type="xsd:string" /> - <xsd:element minOccurs="0" maxOccurs="1" name="MinTemperatureF" type="xsd:string" /> - <xsd:element minOccurs="0" maxOccurs="1" name="MaxTemperatureC" type="xsd:string" /> - <xsd:element minOccurs="0" maxOccurs="1" name="MinTemperatureC" type="xsd:string" /> - </xsd:sequence> - </xsd:complexType> - <xsd:element name="GetWeatherByPlaceName"> - <xsd:complexType> - <xsd:sequence> - <xsd:element minOccurs="0" maxOccurs="1" name="PlaceName" type="xsd:string" /> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="GetWeatherByPlaceNameResponse"> - <xsd:complexType> - <xsd:sequence> - <xsd:element minOccurs="1" maxOccurs="1" name="GetWeatherByPlaceNameResult" type="tns:WeatherForecasts" /> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="WeatherForecasts" type="tns:WeatherForecasts" /> - </xsd:schema> - </wsdl:types> - <wsdl:message name="GetWeatherByZipCodeRequest"> - <wsdl:part name="parameters" element="tns:GetWeatherByZipCode" /> - </wsdl:message> - <wsdl:message name="GetWeatherByZipCodeResponse"> - <wsdl:part name="parameters" element="tns:GetWeatherByZipCodeResponse" /> - </wsdl:message> - <wsdl:message name="GetWeatherByPlaceNameRequest"> - <wsdl:part name="parameters" element="tns:GetWeatherByPlaceName" /> - </wsdl:message> - <wsdl:message name="GetWeatherByPlaceNameResponse"> - <wsdl:part name="parameters" element="tns:GetWeatherByPlaceNameResponse" /> - </wsdl:message> - <wsdl:portType name="WeatherForecastPortType"> - <wsdl:operation name="GetWeatherByZipCode"> - <wsdl:input message="tns:GetWeatherByZipCodeRequest" /> - <wsdl:output message="tns:GetWeatherByZipCodeResponse" /> - </wsdl:operation> - <wsdl:operation name="GetWeatherByPlaceName"> - <wsdl:input message="tns:GetWeatherByPlaceNameRequest" /> - <wsdl:output message="tns:GetWeatherByPlaceNameResponse" /> - </wsdl:operation> - </wsdl:portType> - <wsdl:binding name="WeatherForecastSoapBinding" type="tns:WeatherForecastPortType"> - <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> - <wsdl:operation name="GetWeatherByZipCode"> - <soap:operation soapAction="http://www.webservicex.net/GetWeatherByZipCode" style="document" /> - <wsdl:input> - <soap:body use="literal" /> - </wsdl:input> - <wsdl:output> - <soap:body use="literal" /> - </wsdl:output> - </wsdl:operation> - <wsdl:operation name="GetWeatherByPlaceName"> - <soap:operation soapAction="http://www.webservicex.net/GetWeatherByPlaceName" style="document" /> - <wsdl:input> - <soap:body use="literal" /> - </wsdl:input> - <wsdl:output> - <soap:body use="literal" /> - </wsdl:output> - </wsdl:operation> - </wsdl:binding> - <wsdl:service name="WeatherForecast"> - <wsdl:port name="WeatherForecastPort" binding="tns:WeatherForecastSoapBinding"> - <soap:address location="http://www.webservicex.net/WeatherForecast.asmx" /> - </wsdl:port> - </wsdl:service> -</wsdl:definitions>
\ No newline at end of file diff --git a/tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather/WeatherForecastImpl.py b/tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather/WeatherForecastImpl.py deleted file mode 100644 index 6e3775de0b..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather/WeatherForecastImpl.py +++ /dev/null @@ -1,65 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# -# -# -# This Python code is a simple sample that calls a service that returns an -# SDO which has been converted into an ElementTree Element object. The Element -# object is then converted into formatted text - -import xml.etree.ElementTree - -def getForecastByPlaceName(placeName): - - print "Python - WeatherForecastImpl.getForecastByPlaceName:", placeName - - xmlResult = weatherWebService.GetWeatherByPlaceName(placeName) - - print "Python - Formatting result from weatherService:", xmlResult - - return formatWeather(xmlResult, placeName) - - -def getForecastByZipCode(zipCode): - - print "Python - WeatherForecastImpl.getForecastByZipCode:", zipCode - - xmlResult = weatherWebService.GetWeatherByZipCode(zipCode) - - print "Python - Formatting result from weatherService:", xmlResult - - return formatWeather(xmlResult, zipCode) - - -def formatWeather(weather, name): - - result = "Could not retrieve Weather Forecast for " + str(name) - - pathAndNS = "./{http://www.webservicex.net}" - - if weather.findtext(pathAndNS+"PlaceName"): - - result = "\n\nWeather Forecast for "+ weather.findtext(pathAndNS+"PlaceName")+ ", "+ weather.findtext(pathAndNS+"StateCode")+"\n" - result += "Latitude: "+ weather.findtext(pathAndNS+"Latitude")+ " Longitude: "+ weather.findtext(pathAndNS+"Longitude")+"\n\n" - - for node in weather.findall(".//{http://www.webservicex.net}WeatherData"): - if node.findtext(pathAndNS+"Day"): result += node.findtext(pathAndNS+"Day") - if node.findtext(pathAndNS+"MaxTemperatureC"): result += ":\tMax "+ node.findtext(pathAndNS+"MaxTemperatureC") - if node.findtext(pathAndNS+"MinTemperatureC"): result += "C. Min "+ node.findtext(pathAndNS+"MinTemperatureC")+ "C.\n" - - return result diff --git a/tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather/sample.weather.composite b/tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather/sample.weather.composite deleted file mode 100644 index 70e9674d23..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/samples/PythonWeatherForecast/sample.weather/sample.weather.composite +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> - -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" - name="sample.weather"> - - <component name="WeatherComponent"> - <implementation.python module="WeatherForecastImpl"/> - <!--implementation.ruby script="WeatherForecastImpl.rb" class="WeatherForecastImpl"/--> - <reference name="weatherWebService">WeatherService</reference> - </component> - - <reference name="WeatherService"> - <interface.wsdl interface="http://www.webservicex.net#wsdl.interface(WeatherForecastPortType)"/> - <binding.ws endpoint="http://www.webservicex.net#wsdl.endpoint(WeatherForecast/WeatherForecastPort)"/> - <!--binding.ws uri="http://www.webservicex.net/WeatherForecast.asmx"/--> - </reference> - -</composite> |