1 / 45

Globus C Web Services Core for Developers

Bill Allcock, ANL Joe Bester, ANL GlobusWORLD / GridWORLD Sep 2006. Globus C Web Services Core for Developers. Features. Hosting web services written in C and C++ Implementation of WSRF concepts and port types Type, client, and service bindings generator from WSDL and XML schemas to C

nelly
Télécharger la présentation

Globus C Web Services Core for Developers

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. Bill Allcock, ANL Joe Bester, ANL GlobusWORLD / GridWORLD Sep 2006 Globus C Web Services Corefor Developers

  2. GlobusWORLD / GridWORLD Features Hosting web services written in C and C++ Implementation of WSRF concepts and port types Type, client, and service bindings generator from WSDL and XML schemas to C Client APIs and programs

  3. GlobusWORLD / GridWORLD Service Engine/Container API (globus_service_engine) for processing WS requests within an application Uses HTTP processor in XIO SOAP serializer/deserializer Service loading and invocation Program for hosting services globus-wsc-container

  4. GlobusWORLD / GridWORLD Service Engine Usage globus_service_engine_init() To manage connection usage: globus_service_engine_register_session(),globus_service_engine_register_process() For simplicity globus_service_engine_register_start(),globus_service_engine_register_stop()

  5. GlobusWORLD / GridWORLD WS-Resources Resource management API create/find/destroy resource property management lifetime management globus_wsrf_core_tools.h includes function to find resource from EPR used in the current message

  6. GlobusWORLD / GridWORLD WS-Resource Properties Property values associated with a type_info for serialization information Property values may be dynamic callbacks for attempts to get or set the value Apps can be notified when properties change Call globus_resource_property_changed() for dynamic values

  7. GlobusWORLD / GridWORLD Operation Providers Reuse a port type implementation Resource Properties Operations Examples: wsrp:GetResourceProperty GetResourceProperty operation wsrl:ScheduledResourceTermination SetTerminationTime operation CurrentTime, TerminationTime properties

  8. GlobusWORLD / GridWORLD Notification Consumer Callback-driven notification User has to deal with XML wildcard messages Usage: Create Engine (don't forget to start it!) Create Consumer Returns EPR of Notification Consumer Service Subscribe via client stubs May be different for some services

  9. GlobusWORLD / GridWORLD Notification Producer wsnt:NotificationProducer provider Creates notification-related properties Handles Subscribe/GetCurrentMessage operations Creates Topics for Resource Properties Notification Producer API Create/destroy topics Change topics Also: manage producer, subscriptions, etc but provider handles these for you

  10. GlobusWORLD / GridWORLD Service Groups wssg:ServiceGroup, wssg:ServiceGroupRegistration providers creates wssg-related properties (Entry, MembershipContentRule) implements Add operation service_group API to manage entries add/remove entries enumerate entries also: create/destroy service group provider handles these for you

  11. GlobusWORLD / GridWORLD Handler Chains Handle specific message elements Called when matching header element is found Examples: WS-Addressing Set attributes when addressing values encountered Verify all required addressing elements are present WS-SecureMessage Add attributes for elements to be signed Add message signatures

  12. GlobusWORLD / GridWORLD SOAP Messaging • XML Serialization Handles • to/from file, memory, libxml DOM, HTTP • Options to control (de)serialization • default NS • xsi:type attribute • c14n • …

  13. GlobusWORLD / GridWORLD Message Attributes Key-Value pairs When value is set, optional copy and destroy functions for memory management Default attributes set at engine initialization (service) or on a client stub Additional attributes used to pass info from message handlers Example: wsa:To value set by WS-Addressing handler

  14. GlobusWORLD / GridWORLD Message Attributes (2) Authentication Options TLS / WS-SecureMessage Credentials to use Message protection Peer subject name Also: Message timeouts, persistent connections

  15. GlobusWORLD / GridWORLD Bindings Generator globus-wsrf-cgen program Uses JavaScript-based template language Generates type bindings Data structures, allocators, deallocators, serializers, etc Type information for wildcard handling Generates service module to call service implementation Generates client stub functions to invoke (remote) operations Generates Packaging/Makefiles

  16. Resource Property Element <element name="CounterRP"> <complexType> <sequence> <element ref="tns:Value"/> <element maxOccurs="unbounded" ref="rpns0:Topic"/> <element maxOccurs="unbounded" ref="rpns0:TopicExpressionDialects"/> <element ref="rpns1:TerminationTime"/> <element ref="rpns1:CurrentTime"/> <element ref="rpns0:FixedTopicSet"/> </sequence> </complexType> </element> GlobusWORLD / GridWORLD

  17. Example Counter Service <element name="createCounter"> <complexType/> </element> <element name="createCounterResponse"> <complexType> <sequence> <element ref="wsa:EndpointReference"/> </sequence> </complexType> </element> GlobusWORLD / GridWORLD

  18. Message Definition <message name="CreateCounterRequest"> <part name="request" element="tns:createCounter"/> </message> <message name="CreateCounterResponse"> <part name="response" element="tns:createCounterResponse"/> </message> GlobusWORLD / GridWORLD

  19. Port Type Definition <portType name="CounterPortType" wsrp:ResourceProperties="tns:CounterRP"> <operation name="createCounter"> <input message="tns:CreateCounterRequest"/> <output message="tns:CreateCounterResponse"/> </operation> ... </portType> GlobusWORLD / GridWORLD

  20. C Type Binding typedef struct createCounterResponseType_s { wsa_EndpointReferenceType EndpointReference; } createCounterResponseType; typedef struct createCounterResponseType_array_s { struct createCounterResponseType_s * elements; int length; globus_xsd_type_info_t type_info; } createCounterType_array; GlobusWORLD / GridWORLD

  21. C Type Bindings Functions globus_result_t createCounterResponseType_init( createCounterResponseType ** inst); void createCounterResponseType_destroy( createCounterResponseType * inst); struct createCounterType_s * createCounterResponseType_array_push( createCounterResponseType_array * array); GlobusWORLD / GridWORLD

  22. C Type Serializer globus_result_t createCounterResponseType_serialize( const xsd_QName * element_name, const createCounterResponseType * val, globus_soap_message_handle_t message_handle, globus_xsd_element_options_t options); also deserialize, copy, array, contents-only versions. GlobusWORLD / GridWORLD

  23. XML Wildcards (1) struct globus_xsd_type_info_s { xsd_QName * type; globus_xsd_serialize_func_t serialize; globus_xsd_deserialize_func_t deserialize; globus_xsd_init_func_t initialize; globus_xsd_destroy_func_t destroy; globus_xsd_copy_func_t copy; ...}; GlobusWORLD / GridWORLD

  24. XML Wildcards (2) typedef struct xsd_any_s { globus_xsd_type_registry_t registry; globus_xsd_type_info_t any_info; xsd_QName * element; void * value; xsd_string_array namespaces; } xsd_any; GlobusWORLD / GridWORLD

  25. Client Stub Binding globus_result_t CounterPortType_createCounter( CounterService_client_handle_t handle, const char * service_endpoint, const createCounterType * createCounter, createCounterResponseType ** createCounterResponse, CounterPortType_createCounter_fault_t * fault_type, xsd_any ** fault); Also with EPR in place of service_endpoint Also non-blocking functions Request and response versions GlobusWORLD / GridWORLD

  26. Client Example (1) createCounterType createCounter; createCounterResponseType *createCounterResponse=NULL; createCounterType_init_contents(&createCounter); globus_soap_message_attr_init(&attrs); globus_soap_message_attr_set( attrs, GLOBUS_SOAP_MESSAGE_AUTHENTICATION_METHOD_KEY, NULL, NULL, GLOBUS_SOAP_MESSAGE_AUTH_SECURE_MESSAGE); CounterService_client_init( &client_handle, attrs, NULL); GlobusWORLD / GridWORLD

  27. Client Example (2) result = CounterPortType_createCounter( client_handle, counter_service_contact, &createCounter, &createCounterResponse, &fault_type, &fault); if (result != GLOBUS_SUCCESS) ... globus_wsrf_core_export_endpoint_reference( &createCounterResponse->EndpointReference, "counter.epr", &wsa_EndpointReference_qname)l GlobusWORLD / GridWORLD

  28. Service Initialization globus_result_t CounterService_init( globus_service_descriptor_t * service_desc) { globus_module_activate( GLOBUS_WSRF_RESOURCE_MODULE); ... } GlobusWORLD / GridWORLD

  29. Operation Implementation globus_result_t CounterPortType_createCounter_impl( globus_service_engine_t engine, globus_soap_message_handle_t message, globus_service_descriptor_t * service, createCounterType * createCounter, createCounterResponseType * createCounterResponse, const char ** fault_name, void ** fault) GlobusWORLD / GridWORLD

  30. Service EPR Construction globus_service_engine_get_contact( engine, &endpoint); epr->Address.base_value = globus_common_create_string("%s/%s", endpoint,COUNTERSERVICE_BASE_PATH); counter_key = xsd_any_array_push( epr->ReferenceProperties->any); counter_key->any_info = &xsd_string_info; counter_key->element = &CounterKey_qname; counter_key->value = &resource_id; GlobusWORLD / GridWORLD

  31. add operation globus_result_t CounterPortType_add_impl( globus_service_engine_t engine, globus_soap_message_handle_t message, globus_service_descriptor_t * service, xsd_int * add, xsd_int * addResponse, const char ** fault_name, void ** fault) GlobusWORLD / GridWORLD

  32. add implementation globus_wsrf_core_get_resource( message, service, &resource); globus_resource_get_property(resource, &CounterPortType_Value_rp_qname, (void **)&counter_value, NULL); *counter_value += *add *addResponse = *counter_value; globus_resource_property_changed(resource, &CounterPortType_Value_rp_qname); globus_resource_finish(resource); GlobusWORLD / GridWORLD

  33. Generating WSRF Faults time_t timestamp = time(NULL); wsrp_ResourceUnknownFaultType_init(fault); globus_libc_gmtime_r(&timestamp, &(*fault)->Timestamp); *fault_name="ResourceUnknownFault"; GlobusWORLD / GridWORLD

  34. GlobusWORLD / GridWORLD Performance Snapshot (GT 4.0.1)

  35. GlobusWORLD / GridWORLD Use Case: globusrun-ws Command-line client to submit and monitor WS-GRAM jobs Interacts with WS-Delegation, WS-GRAM, and (indirectly) RFT Includes a service engine to handle notification messages from WS-GRAM On the order of 20x faster than the Java client program Largely due to the JVM startup costs

  36. GlobusWORLD / GridWORLD Use Case: RFT Client Command-line client to RFT service RFT performs reliable 3rd-party transfers using GridFTP Create a transfer, start & monitor it Monitoring via WS-Notification Adds features, improves performance over previous java client Meet Ravi: 9/14 11:30 AM "Globus RFT for Developers"

  37. GlobusWORLD / GridWORLD Use Case: GridFTP Resource Properties Experimental GridFTP feature Server exposes state via resource properties Server load Connection limits Acts as WS-MDS provider

  38. GlobusWORLD / GridWORLD Use Case: Container on an ARM processor Prototype for ocean floor sensor platform for the LOOKING project Port of C WS Core to proprietary embedded operating system Development board with 4MB Flash, 16MB RAM NET+OS C Container statically linked with OS and services

  39. GlobusWORLD / GridWORLD Use Case: Core Command-Line tools Substitute for Java CLI tools in 4.1, 4.2 Clients work with any service implementing the related port types WS-ResourceProperties globus-wsrf-query globus-wsrf-get-property globus-wsrf-get-properties globus-wsrf-insert-property globus-wsrf-update-property globus-wsrf-delete-property

  40. GlobusWORLD / GridWORLD Use Case: Core Command-Line tools WS-ResourceLifetime globus-wsrf-destroy globus-wsrf-set-termination-time WS-BaseNotification globus-wsn-get-current-message globus-wsn-pause-subscription globus-wsn-resume-subscription globus-wsn-subscribe

  41. GlobusWORLD / GridWORLD Project Web Page / Contributions http://dev.globus.org/wiki/C_WS_Core Globus is largely following the Apache project model at this point. We would welcome contributors. Long term, high quality contributors can be voted in as committers. An alternative would be to start a new, independent project that utilized C WS Core, on which you could be a committer at the start.

  42. GlobusWORLD / GridWORLD Getting help / more information Email lists cwscore-[dev|user|announce]@globus.org Documentation http://www.globus.org/toolkit/docs Bugzilla http://bugzilla.globus.org/bugzilla Product is C WS Core HPDC Paper http://www.globus.org/alliance/publications/papers/WSRFComparison2005-3.pdf Comparison of five different WSRF implementations

  43. GlobusWORLD / GridWORLD Futures More clients (delegation, ...) Improved container More core services (registry, secure conversation, …) More flexible container configuration Authorization Improvements Persistent services Update to newer web standards Your C based Web service or client?

  44. GlobusWORLD / GridWORLD Meet the Developers Session at Globus Alliance Booth (152A-P7) September 128:00am - 9:00am"Java WS Core and Security (C, Java)"  -- Olle Mulmo, Jarek Gawor, Rachana Anantakrishnan 11:30am -12:30pm"RLS" -- Rob Schuler, Ann Chervenak12:30pm -1:30pm"MDS" -- Mike D'arcy, Laura Pearlman3:00pm - 4:00pm”Resource Management (GRAM, Virtual Workspaces and Dynamic Accounts)" – Stu Martin, Peter Lane, Tim Freeman, Kate Keahey6:00pm - 7:00pm"C WS Core" -- Joe Bester7:00pm - 8:00pm"Python WS Core" -- Joshua Boverhof September 138:00am - 9:00am"GridShib" -- Von Welch, Ton Scavo, Tim Freeman 11:30am - 12:30pm"GT Installation and Administration" -- Charles Bacon12:30pm - 1:30pm"MyProxy" -- Jim Basney3:00pm - 4:00pm"GridFTP, XIO, RFT" -- John Bresnahan, Ravi Madduri

  45. GlobusWORLD / GridWORLD Question: Do you see a Fun & Exciting Career in my future? Magic 8 Ball: All Signs Point to YES Say YES to Great Career Opportunities SOFTWARE ENGINEER/ARCHITECT Mathematics and Computer Science Division, Argonne National Laboratory The Grid is one of today's hottest technologies, and our team in the Distributed Systems Laboratory (www.mcs.anl.gov/dsl) is at the heart of it. Send us a resume through the Argonne site (www.anl.gov/Careers/), requisition number MCS-310886. SOFTWARE DEVELOPERSComputation Institute, University of Chicago Join a world-class team developing pioneering eScience technologies and applications. Apply using the University's online employment application (http://jobs.uchicago.edu/, click "Job Opportunities" and search for requisition numbers 072817 and 072442). See our Posting on the GlobusWorld Job Board or Talk to Any of our Globus Folks.

More Related