Web Services
  Home arrow Web Services arrow Page 3 - Web Services for K-12 Education Systems
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB SERVICES

Web Services for K-12 Education Systems
By: Ahm Asaduzzaman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    2004-02-18

    Table of Contents:
  • Web Services for K-12 Education Systems
  • Requirement Analysis
  • Walkthrough Example
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Web Services for K-12 Education Systems - Walkthrough Example


    (Page 3 of 4 )

    I. Start a VB project with Visual Studio, from project->Reference check Microsoft SOAP Type Library V3.0. Create a SOAP class Listing 1. We will use this class to create SOAP messages.


    Private Sub GetDataOnConnect()    
    ‘ On connect display 
    list of activities to choose 
    Dim k 
    As String
    Dim soap 
    As SOAPSender
    Set soap 
    = New SOAPSender
    soap
    .BeginBodyPart "fnWebService"http://az.homeunix.com/as/k12.php   
    ‘function name
    soap.BeginElement " ActivityTitle ", ""
    soap.WriteText ActivityTitle.text
    soap.EndElement
    soap.EndBodyPart
    soap.SoapAction = " http://az.homeunix.com/as/k12.php " 
    ‘ Web Service end point
    soap.ServiceUrl = " http://az.homeunix.com/as/k12.php "
    soap.Send
    DisplayData k
    End Sub
     
    Private Sub DisplayData(ByVal response As String)
    On Error GoTo L1
    Dim mTemp 
    As String
    Dim doc 
    As MSXML2.DOMDocument
    Set doc 
    = New MSXML2.DOMDocument
    If doc
    .loadXML(responseThen
    ‘ Parse the response text   
    mTemp 
    doc.selectSingleNode("//noname").text
    WebBrowser1
    .Visible True
    End If
    Else
    MsgBox 
    "Failed to load the response text: " vbCrLf response
    End If
    Exit Sub
    L1
    :
    MsgBox 
    "Content for this activity title not available now, please check back later.",   vbInformation"Empty Activity"
    End Sub    

    II. Above code will parse SOAP envelope and display list of available (or subscribed) activities as soon as it connects to Web Service.
    Server:


    <?php
    require_once
    ('nusoap.php');
    $s 
    = new soap_server;
    $s
    ->register('fnWebService');
    function fnWebService 
    ($name){
     
    $link
    =mysql_connect('localhost','root','') or die (mysql_error());
    mysql_select_db
    ('db_webservice') or die (mysql_error());
    $arrGrSub
    =explode('/'$name); 
    $s
    =$arrGrSub[1];
    $g
    =$arrGrSub[0];
    $query
    ="SELECT * FROM astabquestionentry ORDER BY qeLessonName";
     
    if 
    ($name!=''){
    $query
    ="SELECT * FROM astabquestionentry where qeLessonName='".$name."' LIMIT 1";
    $result
    =mysql_query($query) or die (mysql_error());
    while 
    ($row mysql_fetch_array($resultMYSQL_ASSOC)) {
    $k
    ='[ws:] http://localhost/ws.php?ln='.$row["qeLessonName"].'&r=NO&attempt='.$row["qeAttempt"].'&tq='.$row["qeTotalNumberOfQuestion"].'&ActType='.$row["qeActivity"].
    '&strip=localhost&dbuser=root&dbpassword=
    &mydatabase=db_webservice'
    ;
    //ws.php  script is responsible to display items with description. This feature is not discussed in the article.
     
    mysql_free_result($result);
    mysql_close
    ($link);
    return $k
    ;
    }
    }
    $result
    =mysql_query($query) or die (mysql_error());
    while 
    ($row mysql_fetch_array($resultMYSQL_ASSOC)) {
    $k
    =$k.$row["qeLessonName"].'nr'.' Description:'.strtolower(ucwords($row["qeObjective"] .'    '.$row["qeSubSkill"])).' nr';
    }
    mysql_free_result
    ($result);
    mysql_close
    ($link);
    return $k
    ;
    }
    $s
    ->service($HTTP_RAW_POST_DATA);




    More Web Services Articles
    More By Ahm Asaduzzaman


     

    WEB SERVICES ARTICLES

    - Safety, Idempotence, and the Resource-Orient...
    - The Resource-Oriented Architecture in Action
    - Features of the Resource-Oriented Architectu...
    - The Resource-Oriented Architecture
    - Getting Started with Flex
    - Automated Billing and Faxing for the Web
    - An Introduction to Web Services
    - The Foundations of Web Services: From Novice...
    - Web Services Reengineering: Finishing Touches
    - Fault Handling with Web Services
    - Flow and Web Services
    - Process Lifecycles and Web Services
    - Business Processes and Web Services
    - Orchestrating Web Services
    - Notifications and Resources in the WS-Resour...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek