1 / 18

Web services in C++ using Globus Toolkit v4

Web services in C++ using Globus Toolkit v4. Igor Jeremi ć < igor@jwork.net > Faculty of Mathematics - University of Belgrade http://www.jwork.net/GT4WSC. Content:. Globus toolkit Web Services Writing WS in C/C++ using GT4 ndiss Web Service. Globus toolkit.

rufin
Download Presentation

Web services in C++ using Globus Toolkit v4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web services in C++ using Globus Toolkit v4 Igor Jeremić <igor@jwork.net> Faculty of Mathematics - University of Belgrade http://www.jwork.net/GT4WSC

  2. Content: • Globus toolkit • Web Services • Writing WS in C/C++ using GT4 • ndiss Web Service

  3. Globus toolkit • The Globus Toolkit is an open source software toolkit used for building Grid systems and applications.

  4. Web service • Web service is a system designed to support interoperable machine-to-machine interaction over a network. • It has an interface that is described in a machine-processable XML format

  5. Writing WS in C/C++ using GT4 • Writing WSLD schema • Defining a WSDL Target Namespace • Defining Message Types • Defining Messages & Port Type • Writing service • Writing client http://www.jwork.net/GT4WSC/HelloWorldService/

  6. Writing service • GT4 provide tool for generating web service skeleton (globus-wsrf-cgen) • for generating additional wsdl schema we use java program org.globus.wsrf.tools.wsdl.GenerateBinding http://www.jwork.net/GT4WSC/HelloWorldService/

  7. Writing service Writing service • JwHelloPortType_hello_impl function is the place where all is happening. Unfortunately C++ binding are not supported http://www.globus.org/toolkit/docs/4.0/common/cwscore/rn01re02.html[Limitations] • Only generates bindings from document/literal style WSDL schemas. • Only generates ANSI-C bindings. C++ bindings are not supported. • g++ can not build generated code (using gcc32dbg flavor) • One solution is to use Dynamic libraries http://www.jwork.net/GT4WSC/HelloWorldService/

  8. Writing client • GT4 provide tool for generating client bindingsalso that is globus-wsrf-cgen • Client can be written in C or C++, or in any other supported language ( Java ) http://www.jwork.net/GT4WSC/HelloWorldService/

  9. Writing client • #include <JwHelloService_client.h> • New datatypes: (as described in WSDL file) • helloResponseType (need to be initalized) • helloType • modules have to be activated, and client have to be initalized • Service is contacted by JwHelloPortType_hello function http://www.jwork.net/GT4WSC/HelloWorldService/

  10. Writing client • JwHelloPortType_hello( client_handle, "http://127.0.0.1:2408/wsrf/services/JwHelloService", &helloS, &helloR, (JwHelloPortType_hello_fault_t *)&fault_type, &fault); • helloS describe data which needs to be send to service and • HelloR describe data which will be received from service • if parts of HelloResponseType are pointers which point to some allocated memory you don’t need to free that resource after use service, GT4 provides mechanism for that • On the end the following functions should be calledJwHelloService_client_destroy(); globus_module_deactivate_all(); http://www.jwork.net/GT4WSC/HelloWorldService/

  11. ndiss Web Service Service provides data manipulation and program execution with stored input parameters. Service skeleton is written in C, and core of service is written in C++ stored in dynamic library Client is written in C++ http://www.jwork.net/GT4WSC/Ndiss/

  12. ndiss Web Service • Depending of the input parameters, the client contacts the service once or twice, • If necessary to upload the model, the service generates an unique name of the bc file, returns it to the client which using GridFTP transfers this file to the server

  13. XML input file example <?xml version="1.0" encoding="UTF-8"?> <NDISS> <Header ProjectName="TEST" Author="Igor Jeremic" Date="2005-11-11"/> <Models> <Model Name="Model01" BoundaryConditionFile="b01.dat"/> <Model Name="Model02" BoundaryConditionFile="b02.dat"/> <Model Name="Model03" BoundaryConditionFile="b03.dat"/> <Model Name="Model04" BoundaryConditionFile="b04.dat"/> </Models> </NDISS> http://www.jwork.net/GT4WSC/Ndiss/

  14. Schema JwNdiss.wsdl ndissService Client nd_MAIN dataBase GridFTP nd_INIT mySQL Data base arguments argLine exec XML File System option tmp XMLParser http://www.jwork.net/GT4WSC/Ndiss/

  15. Further work… • Adapt database to the framework • Implement ndiss program as web service, using MPI-G2

  16. Source • Source of this work can be found on http://www.jwork.net/GT4WSC Thank you

More Related