Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

List of Required Services

CSE445 Service Development Assignment (

Adopted from Dr. Yinong Chen

Introduction

Several services to be developed will use a service in ASU Service Repository called Web2String. The service URL is:

http://venus.sod.asu.edu/wsRepository/Services/Web2StringSVC/Service.svc

This service will download the Web page at the given URL and return the text in the page as a string. The operation offered by this service is: string GetWebContent(string url);

You may also directly use the following code in your program to download data from any given URL:

WebClient channel = new WebClient();            // create a channel

byte[] abc = channel.DownloadData(completeUri); // return byte array

Read the lecture on RESTful service for more detail.

A test page of the service is available at:

http://venus.sod.asu.edu/wsRepository/Services/Web2StringSVC/Tryit.aspx

The service and the test page above are also listed in Table 2 of the ASU Repository at

https://venus.sod.asu.edu/WSRepository/repository.html

Some of the service requirements listed below are related. Combination of the related services can form a coherent application. Some of the service requirements are independent of each other.

Some of the services refer to external services. These services may no longer be free or no longer exist.

Service 1. Top10Words

Description: Analyze the webpage at a given url and return the ten most-frequently occurred words in the webpage. Return the words in the descending order of their appearing frequencies.

Operation: string[] Top10Words(string url)

Input: A webpage url in string.

Output: An array of strings that contains the ten most-frequently occurred words in descending order of their frequencies. You must remove these items that are not semantic words, such as the element tag names and attribute names quoted in angle brackets < … >, if the string represents an XML page or HTML source page.

Service 2. WordFilter

Description: Analyze a string of words and filter out the function words (stop words) such as “a”, “an”, “in”, “on”, “the”, “is”, “are”, “am”, and any words that are not meaningful to be counted at the top words in search.

Operation: string WordFilter(string str)

Input: A string.

Output: A string with the stop words removed.

Service 3. Stemming

Description: Analyze a string containing a word or multiple words and replace each of the inflected or derived words to their stem or root word. For example, “information”, “informed”, “informs”, “informative” will be replaced by the stem word “inform”. This service can help find useful keywords or index words in information processing and retrieval.

Operation: string Stemming(string str)

Input: A string type of a word or words.

Output: The string of the inflected or derived words replaced by their stem words.

Service 4. Top10ContentWords

Description: Analyze the webpage at a given url and return the ten most-frequently occurred “content” words in the webpage. Return the words in descending order of their appearing frequencies. Content words do not include the stop words and the element tag names and attribute names quoted in angle brackets < … >, if the string represents an XML page or HTML source page, as well as other words that do not represent the content of the webpage. The ranking of the words should be used based on the string that have been processed by stemming service.

Operation: string[] Top10ContentWords(string url)

Input: A webpage url in string.

Output: An array of strings that contains the ten most-frequently occurred words in descending order of their frequencies. The required words must not be element tag name or attribute name of XML page or HTML source page.

Service 5. Stock Build and Quote (Two services)

Description: Download a stock price page, for example: http://www.wsj.com/mdc/public/page/2_3024-NYSE.html

Operation1 analyzes the data to obtain the open price of each stock symbol. Save the (symbol price) pairs into a file.

Note, this operation does not have to work for stock pages, It is fine to work for the NYSE page.

Operation2 reads the file generated from operation1 and returns the stock price of the given stock symbol

Operation1: string Stockbuild(string sourceURL); // return file name to the (symbol price) pairs

Operation2: string Stockquote(string symbol); // return the stock price of the given stock symbol

Service 6. WsdlAddress

Description: Analyze a webpage and return all WSDL addresses in that webpage in an array of strings. The WSDL address can have these formats: xxx.wsdl (e.g. developed Java), or ?wsdl (e.g., .php?wsdl,  .svc?wsdl and .asmx?wsdl).

Operation: string[] getWsdlAddress(string url)

Input: A webpage url.

Output: An array of strings that contains WSDL addresses in the given webpage.

Service 7. WsdlDiscovery

Description: Call Google or Bing search engine APIs, using keywords such as .wsdl, .php?wsdl, .svc?wsdl and .asmx?wsdl, to discover the Web pages that contain WSDL addresses, and follow the address to discover WSDL files. You can find Google search APIs in Google code, and you can find Bing search APIs in MSDN library: Bing SOAP Services: http://msdn.microsoft.com/en-us/library/cc966738.aspx or http://msdn.microsoft.com/en-us/library/dd251056.aspx. For example, when I use these ".wsdl", ".php?wsdl", ".svc?wsdl" ".asmx?wsdl", as search keywords, I find pages with the required wsdl files, including the one below, which has a long list of WSDL files:
http://data.serviceplatform.org/servicefinder/sf-wsdls.list.sorted
Notice that you need to analyze the addresses returned from the search engine and remove those that are not wsdl addresses. The service should return only those addresses that are wsdl addresses. If you read service 7, you can see that the addresses will be given to another service to discover the operations in the wsdl file.

Operation: string[] WsdlDiscovery(string keyWords)

Input: A sting of keywords related wsdl address format

Output: An array of strings that contains WSDL addresses discovered through the keywords search engines.

Service 8. WsOperations

Description: Analyze a WSDL file in XML format and return operation names and their corresponding input parameter and return types.

Operation: string[] getWsOperations(string url)

Input: The url address that points to an WSDL file

Output: An array of strings. Each of the array elements contains return the type, operation name, and parameter types

Service 9. NewsFocus

Description: Find news about specific topics, for example, find all (as many as possible) news articles about ASU (Arizona State University).

Operation: string[] NewsFocus(string[] topics)

Input: a list of topics or key words

Output: A list of URLs in which the given topics are reported.

Service 10. Storage Service

Description: Create a service that can load a local file or a file at a URL (implement one of these two options) and store the file  into the server. A URL will be returned.  The returned URL can be used for retrieving the file from the server.

Operation: string Storefile(string fileNameOrUrl)

Input: file name with local path or a URL

Output: URL of the file in the server.

Hint: read: https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.saveas(v=vs.110).aspx

Service 11. Weather Service

Description: Create a 5-day weather forecast service of zipcode location based on the national weather service at: http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl.

Operation: string[] Weather5day(string zipcode)

Input: a U.S. zipcode

Output: An array (or list) of strings, storing 5-day weather forecast for the given zipcode location.

Hint, the given national weather service has an operation: LatLonListZipCode(zipcode); It returns an XML file containing the latitude and longitude of the zipcode location.
For example, LatLonListZipCode(85281) will return

"

xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'

xsi:noNamespaceSchemaLocation='http://graphical.weather.gov/xml/DWMLgen/schema/DWML.xsd'>33.4357,-111.917"

Then, you can use latitude and longitude to call the operation to obtain the 5-day forecast. The available operations in this service is listed and explained at:

http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php

You must discover what is available and how the service can be used. You can also use other weather services for creating your service.

Service 12. Solar Energy Service

Description: Create a service that returns the annual average sunshine index of a given position (latitude, longitude). This service can be used for deciding if installing solar energy device is effective at the location.

Operation: decimal SolarIntensity(decimal latitude, decimal longitude)

Input: latitude and longitude

Output: a number reflecting the annual average solar intensity at the location.

Here is one potential web API to use.

https://developer.nrel.gov/docs/solar/solar-resource-v1/#request-url

Service 13. Wind Energy Service

Description: Create a service that returns the annual average wind index of a given position (latitude, longitude). This service can be used for deciding if installing windmill device is effective at the location.

Operation: decimal WindIntensity(decimal latitude, decimal longitude)

Input: latitude and longitude

Output: a number reflecting the annual average wind intensity at the location.

You must discover what is available and how the discovered service can be used.

Hint: you may find solar and wind data from sources like:
https://idratherbewriting.com/learnapidoc/docapis_aerisweather_example.html

Crime Data Service

Description: Create a service that returns certain crime data for a given location. The service can use data published by police crime reports and statistics.

Operation: int crimedata(decimal latitude, decimal longitude) // or zipcode

Input: latitude and longitude

Output: a number or stream reflecting the number of a given crime in the area of the given location.

You must discover what data are available and how the data can be used.

Hint: use web API repositories to find available web APIs that you can use free (make sure to follow usage guidelines given by the API provider when you use this data). Here is on example. https://www.crimeometer.com/crime-data-api

Service 14. Natural Hazards Service

Description: Create a service that returns the natural hazards (Tsunamis, earthquake, volcanoes) index of a given position (latitude, longitude). This service can be used for building decision and insurance premium.

Operation: decimal NaturalHazards(decimal latitude, decimal longitude)

Input: latitude and longitude

Output: a number reflecting the natural hazards at the location.

Hint: getting data from NOAA (National Geophysical Data Center): http://maps.ngdc.noaa.gov/

In the site, you can search keyword API. You must discover what is available and how the service can be used.

Service 15. Number2Words

Description: Convert a number, e.g., a phone number, into an easy-to-remember character/digit string. All valid words, e.g., helloClass are easy to remember. Other commonly used  character/digit strings, such as CSE100, CSE445, and SCIDSE, are easy to remember strings too.

Operation: string Number2Words(string number)

Input: a string of digits (0, 1, 2, …, 9).

Output: a character/digit string, which are easy-to-remember and each character corresponds to the input digits by the definition of a standard phone touch key system:
0 = none

1 = none

2 = ABC

3 = DEF

4 = GHI

5 = JKL

6 = MNO

7 = P(Q)RS

8 = TUV

9 = WXYZ

If the input contains 0 or 1, these two characters will remain 0 and 1. All other digits must be translated into letter, unless the digits make better sense, e.g., CSE445.

In order to implement the service, you must have a set of easy to remember words of your own, such as CSE445598, ASU, SCIDSE. You also need a dictionary. You could use the Web2String service to read a set of words from a public dictionary service.

Service 16. Find the Nearest Store

Description: Use an existing online service or API to find the provided storeName closest to the zipcode and return the address.  If no store is found, return an error message.  (Optional: if the store is further than 20 miles, from the zipcode, return a “no stores within 20 miles” message). You may find APIs that return store list from site such as Foursquare.com or Yelp.com, and http://www.programmableweb.com

Operation: Operation: string findNearestStore(string zipcode, string storeName)

Input: two strings

Output: string message

Service 17. Wrap an API to create a new service

Explore Useful Services and APIs that you can call in your services, for example:

Google’s APIs

Microsoft APIs

…etc

Service 18. The U.S. Government Data Services

Explore the government service repository and find useful services to build your services.

http://www.usda.gov//wps/portal/usda/usdahome?navid=USDA_DEVELOPER

In the site, you can search keyword API. You must discover what is available and how the service can be used.