Posts Tagged Web Service

Top wordpress plugin for your blog

  • Akismet checks your comments against the Akismet web service to see if they look like spam or not. You need a WordPress.com API key to use it. You can review the spam it catches under “Comments.” This is a default plugin for wp. You just need to activate it.
  • All in One SEO Pack. Out-of-the-box SEO for your Wordpress blog.
  • Contact Form. Just another contact form plugin. Simple but flexible. It’s important to have contact form on your blog.
  • Easy Retweet. Adds a Retweet button to your WordPress posts.
  • Global Translator. Automatically translates a blog in fourteen different languages. This can help you gain more pages indexed at Google.
  • Google XML Sitemaps. This plugin will generate a sitemaps.org compatible sitemap of your WordPress blog which is supported by Ask.com, Google, MSN Search and YAHOO. Configuration Page. After having the sitemap, submit it to Google webmaster.
  • Link Cloaker. Maintains a list of ‘cloaked’ URLs for redirection to outside URLs
  • Subscribe To Comments. Allows readers to receive notifications of new comments that are posted to an entry.
  • Tag content from amazon. Add product based from Amazon on your tag page. Contact me if you want this plugin. Demo here.
  • Twitter Tools. A complete integration between your WordPress blog and Twitter. Bring your tweets into your blog and pass your blog posts to Twitter. Show your tweets in your sidebar, and post tweets from your WordPress admin.
  • Whydowork Adsense. Show adsense on your blog.
  • Wordbook. Cross-post your blog updates to your Facebook account.
  • WordPress Related Posts. Generate a related posts list via tags of WordPress. This helps your blog’s inner linking.
  • WP Auto Tagger. Automatically finds tags based on your post content. This will create more pages for your blog, but you need to have Tag content from amazon plugin that I create.

, , , , , , , , , , , , , , , , , , ,

No Comments

Nusoap header authentification

A web service often need authentication where it needs username and password. You need to pass the header when calling the web service. Here’s an example for http://webservice.apm.com.au/Feed/ web service.

$headers = ‘<Authentication xmlns=”http://webservice.apm.com.au/Feed/”>
<User>youruser</User>
<Password>password</Password>
</Authentication>’;

$result = $client->call($function, array(’parameters’ => $params), ”, ”,$headers, true);

, , , , , , , , , ,

No Comments

SOAP PHP example

This article will show how to do web service using SOAP (Simple Object Access Protocol). You can use SOAP using your PHP. It is usually enabled by default. You can check whether you have SOAP in your phpinfo setting.

For the example we will be using this WSDL. You can see that it have the TopGoalScorers operation:

<operation name=”TopGoalScorers”>
<documentation>
Returns an array with the top N goal scorers and their current score. Pass 0 as TopN and you get them all.
</documentation>
<input message=”tns:TopGoalScorersSoapRequest”/>
<output message=”tns:TopGoalScorersSoapResponse”/>
</operation>

And the operation have the input message:

<message name=”TopGoalScorersSoapRequest”>
<part name=”parameters” element=”tns:TopGoalScorers”/>
</message>

The input operation have one parameter from the element “TopGoalScorers“. The parameter is iTopN which have int value.

<xs:element name=”TopGoalScorers”>
<xs:complexType>
<xs:sequence>
<xs:element name=”iTopN” type=”xs:int”/>
</xs:sequence>
</xs:complexType>
</xs:element>

The return value from the output message is ArrayOftTopGoalScorer:

<xs:element name=”TopGoalScorersResponse”>
<xs:complexType>
<xs:sequence>
<xs:element name=”TopGoalScorersResult” type=”tns:ArrayOftTopGoalScorer”/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:complexType name=”ArrayOftTopGoalScorer”>
<xs:sequence>
<xs:element name=”tTopGoalScorer” type=”tns:tTopGoalScorer” minOccurs=”0″ maxOccurs=”unbounded” nillable=”true”/>
</xs:sequence>
</xs:complexType>

The return element is tTopGoalScorer, have two value sName (string) and iGoals (int).

<xs:complexType name=”tTopGoalScorer”>
<xs:sequence>
<xs:element name=”sName” type=”xs:string”/>
<xs:element name=”iGoals” type=”xs:int”/>
</xs:sequence>
</xs:complexType>

So the code will be:

$client = new SoapClient(”http://euro2008.dataaccess.eu/footballpoolwebservice.wso?WSDL”);

$params = array(’iTopN’ => 3);

result = $client->TopGoalScorers($params);

print_r($result->TopGoalScorersResult);

, , , , , , , , , , , , , , , , , , , , , , ,

No Comments