Webservice applications development

  With the Internet / Intranet development, and there is a change in the development model, the first wave of technology is important http / html, he gave the Internet / Intranet and e-commerce has brought an important impact; second wave of java technology is the rise of java Goods brought cross-Taiwan-Qie, developers can use a single language and the development of application systems environment; third is the emergence of xml technology, it provides a standard data package, to exchange data across a variety of platforms, operating systems and tools, through the xml, all kinds of data exchange is no longer a headache. 

  Webservice concept is the use of a standard interface to the output of the functional definition of the code, so that outsiders can output through the standard interface to call, and so-called standard output interface is wsdl, wsdl is a document composed of xml , describes the procedures to achieve external function to provide a prototype client can achieve wsdl procedures to call the services provided by the code.    Here, I do not wish to dwell on the principles and concepts webservice through an example to demonstrate the new web-based development model. 

  In this example using java-service completed, the client with delphi completed, development tools and Delphi7 is JBuilder9 server is tomcat5.0. 

  First-establish service procedures: 

  JBuilder start the establishment of a project, set up server tomcat4.0 (because JBuilder9 do not support tomcat5.0, will be realized in its tomcat5.0 release). 

  A new class code is as follows: 

  Public class HelloWorld ( 

  Public String sayHello () ( 

  Return "Hello world!"; 

  ) 

  Public String echo (String u) ( 

  Return "Hello" + u; 

  ) 

  ) 

  New File menu option in the pop-up dialog box, select the web services page of the Web Serivice Configuation Wizard, the new webapp axis and configure servers. 

  Select File menu again, and again the window that appears New choose Export as a web service Wizard, in the pop-up wizard to select the class name is derived, and other items of value can be directly elected by default. 

  Just run the procedure established, for a "JBuilder Apache Axis Admin Console" pages that have successfully established webservice.    Click View hyperlink entry "And now … Some Services" page, click HelloWorld (WSDL) links to a WSDL description, thus establishing webservice server completed. 

  Will be released just established webservice to tomcat5.0, in the webapps directory tomcat webservicetest new directory will be used to build projects JBulider directory under the directory axis of documents copied to all of them, restart tomcat, visit http:// localhost: 8080/webservicetest /, to see if "JBuilder Apache Axis Admin Console" page note issued success. 

  Delphi7 start a new project, and then select the new webservices WSDL importer wizard, will be released just webservice description files into WSDL (my address is: http://localhost:8080/webservicetest/services/HelloWorld?wsdl) automatically generates a HelloWorld1 unit in the use of Unit1 unit HelloWorld1, in the form of two button place in the Click incident button1 write test code as follows: 

  Procedure TForm1.Button1Click (Sender: TObject); 

  Var 

  Test: HelloWorld; 

  Str: String; 

  Begin 

  Test: = GetHelloWorld; (webservice be provided by the Remote Interface) 

  Str: = test.sayHello; 

  ShowMessage (str); 

  Test: = nil; 

  End; 

  Testing procedures, pop-up "hello, world" to explain the success.    Button code similar to the test, I will not repeat here. 

  Thus, a complete webservice procedures are completed, and can be running smoothly. 

Bookmark it: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Google
  • DotNetKicks
  • DZone
  • Furl
  • Netvouz

Tags:

Releated Articles


0 Comments to “Webservice applications development”

No Comments. Send your comment.

Leave a Reply

You must be logged in to post a comment.