Project 4 - Using the Blinky Web Service

Version 1.0, last updated 08/07/2006

Your client application will use a web service designed by Gayle Laakmann to post a new blog to the server or to perform any operation that writes to the database.  See the web service description (here's a local copy of it) to read about the supported operations.

CREATING A WEB REFERENCE in VS.NET:

In the VS.NET project, right click over "References" and select "Add Web Reference".  Enter the Web Reference URL as http://wren.cis.upenn.edu/Blinky/Blinky.asmx.

The name of the Web Reference you create is arbitrary, but it will the be name of the object you must instantiate in your client application to call the methods of the web service.

SAMPLE CODE FOR USING THE WEB SERVICE:

Using the Blinky service just involves creating an object and sending it a message; here's an example of how it's done:

  string username = "Gayle";
string password = "gayle";
string title = "My Post";
string body = "I am posting a blog.";

private edu.upenn.cis.wren.Blinky myBlinkySvc = new edu.upenn.cis.wren.Blinky();

if (myBlinkySvc.PostBlog(username, password, title, body) >= 0)
{
       MessageBox.Show("Your blog was sent!", "Sent!");
}
else
{
       MessageBox.Show("Your blog could not be sent.", "Sorry");
}

Visitors: Hit Counter