Home
Tools
Translation
Transliteration
Dictionary
Word LookUp
Urdu Email
Urdu Writer
 
Services
ApniUrdu on Cell
WebService
 
Documentation
Testimonials
History
FAQ
Todo
 
Contact
Link to ApniUrdu
Credits
Contact

English |

SOAP

SOAP is Simple Object Access Protocol. ApniUrdu.com offers RPC through SOAP. In short, you can use our translation engine from your own software. You can send SOAP calls through Java, C#, VB, VC, Perl, PHP etc. Our SOAP server runs on Perl (SOAP::Lite). I wonder how many people will actually use this, but please let me know if you are using it. Here's the first release info:
6/16/2002 12:27PM (PK, DST) - SOAP v1.01, First Urdu Web Service released. You can use our engine in your Perl/Java/PHP/Python/VB/ASP/etc apps.

Methods

NameInputOutputVersionDescription
GetWordsStringInteger1.01Returns the total number of words in dictionary. The input parameter is not of any use right now, but in the future you will be able to supply the type of words to count. For example 'N' or 'noun' to get a count of all the nouns etc.
TranslateStringString1.01Translates the input English sentence into roman Urdu
TransliterateEnglishStringString1.01Transliterates English text into Urdu and returns Urdu mapping (use GetUnicode to get Urdu characters)
TransliterateUrduStringString1.01Transliterates Roman Urdu text into Urdu and returns Urdu mapping (use GetUnicode to get Urdu characters)
GetMappingStringString1.01Translates the input English sentence into ApniUrdu's Keyboard Mapping
GetUnicodeStringString (UTF-8)1.01Translates the input ApniUrdu Keyboard Mapping into Unicoded Urdu equivalent

There will be more methods in the future!

Examples

Perl

NOTE: You must have SOAP::Lite installed. If you are on Unix/Linux use: perl -MCPAN -e 'install SOAP::Lite'. For ActivePerl: ppm install SOAP-Lite. Perl 5.6+ supports unicode natively.
      use strict;
      use warnings;
      use SOAP::Lite;
			
      my $soap = SOAP::Lite -> service('http://apniurdu.com/SOAP/Urdu2.wsdl');
      my $data = SOAP::Data -> value ( 'Urdu is a great language' ) -> type ( 'string' );
			
      my $dict = $soap -> GetWords ('');
      my $text = $soap -> Translate ( $data );
      my $urdu = $soap -> GetMapping ( $data );
      my $utf8 = $soap -> GetUnicode ( $urdu );
			
      print <<EOT;
      Words in Dictionary: $dict
      Translated   Text  : $text
      ApniUrdu Urdu Map  : $urdu
      Unicode Urdu text  : $utf8
      EOT

PHP

NOTE: You must have php-soap installed and running.
      <?
        $s = new SoapObject ('http://apniurdu.com/SOAP/Urdu2.wsdl');
        $dict = $s -> GetWords ();
        $text = $s -> Translate ( 'Urdu is a great language' );
        echo "Words in Dictionary: $dict\n";
        echo "Translated into: $text\n";
      ?>

Visual Basic/VBScript/ASP

NOTE: You must have Microsoft SOAP library installed.
      Set urduservice = CreateObject("MSSOAP.SoapClient") 
      urduservice.mssoapinit "http://apniurdu.com/SOAP/Urdu2.wsdl"

      MsgBox urduservice.GetWords ("")
      MsgBox urduservice.Translate ("Urdu is a great language")
For VB, you may add Microsoft Soap Type Library as a Reference and do Dim urduservice As New SoapClient instead of CreateObject. For ASP, change MsgBox to something else, e.g. Response.Write.

There are many Java SOAP implementations. Please contribute code samples for different languages.



©2002-2003 by Faisal Nasim. All Rights Reserved.