Facebook Integration

As you have probably noticed, I have integrated a pseudo-Facebook hook into my little Wordpress blog. I am wanting more comments to come thru via Facebook, and am building a full Facebook application that will integrate my posts in a non Wordpress format, link to different resources on command and…

0 Comments

Testing the NuSOAP Webservice in C#

For the past few posts, the main focus has been a NuSOAP Webservice that does really basic things with very limited data. The different functions of the service have done a variety of things:

  • showNumbers – Returns an array of numbers in a non-assoc array key format
  • showMadLib – Returns a mad lib based on the data it is sent. Need 4 Adjectives, 2 Adverbs, 3 Nouns, 1 Verb, and 2 Verb: Past Tense. It replies with a string that contains the madlib.
  • showGroupItems – Simplistic service to return an array of items for a specific event, the ones available are: movie, picnic, drive, shopping
  • showTaxes – Shows the taxes based on state taxes. Currently, the only states available in this are: AZ,AL,AK, CA, OR, WA, UT, ID, WY, Defaults to CA if no state is provided. The input for this function is an array.
  • showPhrases – Shows a phrase from Shakespeare and replaces the name with the supplied name. ID is a number from 0 – 4

Although these are very basic and the real world applications are very limited, it can provide a spring board to building real world webservices that can be used for a variety of reasons. But, the power of webservices are that they can be code independent if written correctly. The server portion we have done is all in PHP. The client we have tested this on has been a PHP base. Based on the client functioning properly, we know that PHP based applications will be able to access the data. But the web is not 100% PHP based. Other code exists, which could be .NET flavors, Java, even ColdFusion. We need to ensure that the webservice built will be accepted by applications written in other languages.
(more…)

0 Comments

Modifying the NuSOAP Server

OK, the last couple of posts have strayed from the NuSOAP topic. but I wanted to do a quick post before going into to testing the server on a .NET application. The whole point of this post is to modify the result set we are sending back for some of the items. And let’s also change around one of the inputs so it accepts an array of data as the input, instead of strings. Hopefully this example will help others build a NuSOAP server. Which is why I am doing some of these examples. I was tired of seeing example after example of NuSOAP servers with a “Hello World” type of structure. That does not help in the real world. So hopefully these examples will help others.

First, we need to recall our last example we had out there, it was the following files:
Data Used: http://www.hirdweb.com/webservice/items.txt
Server File: http://www.hirdweb.com/webservice/20100720_server.txt
Client File: http://www.hirdweb.com/webservice/20100720.txt

We will be modifying those files, so if you do not already have those, you can grab those there. The data file “items” is ok, and we do not need to change anything there. The server file we will need to change, so go ahead and save that file with a new name. After you do that, you will need to change the line in the server that sets the wsdl address. I named the new file 20100805_server.php.

$wsdl_addr = 'http://www.hirdweb.com/webservice/20100805_server.php';

The first thing to do is change the result set for the showNumbers functions. This is the function that accepts an identifier of 0 thru 5 and returns a list of numbers. It is a pretty simple example. In the real world, the identifier may be a book ISDN, or a product code, or a user id. Based on how you use this, it could return anything, like a list of authors (ISDN), or related products (product code), or friends (user ID). Or this can be used in conjunction with another function. But we need to format this a little better.
(more…)

0 Comments