Presentation is loading. Please wait.

Presentation is loading. Please wait.

SCA C++, C and COBOL Bryan Aupperle David Haney 13 Dec. 2007.

Similar presentations


Presentation on theme: "SCA C++, C and COBOL Bryan Aupperle David Haney 13 Dec. 2007."— Presentation transcript:

1 SCA C++, C and COBOL www.oasis-open.org Bryan Aupperle (aupperle@us.ibm.com) David Haney (haney@roguewave.com) 13 Dec. 2007

2 Specification Status n C and C++ specification development proceeding in OASIS l Based on work started in Open SOA (OSOA) l Now proceeding in the SCA-C-C++ TC n COBOL specification remains under OSOA l SCA-C-C++ TC work will influence

3 SCA-C-C++ TC Work n Updated conformance statements n Definition of a conformance test suite n Formal definition of C/C++ Annotations n Updated C++ -> WSDL, WSDL -> C++ Mapping n Incorporation of SCA Policy

4 SCDL for C++ n interface.cpp l header – C++ header file describing the interface l class – (optional) Class defining the interface l callbackHeader – (optional) C++ header describing the callback interface l callbackClass – (optional) Class defining the callback interface l remotable – (optional) Indicates whether the service can be called from a remote system n implementation.cpp l library – Shared library defining the service factory l path – (optional) Path to search for the library l header – C++ header file describing the implementation l class – (optional) Class defining the implementation l scope – (optional) Specifies the lifetime and reuse options for an implementation instance

5 C++ APIs n ComponentContext l Primary interface for accessing SCA defined components. l Component Meta Information n getCurrent(), getURI(), getProperties(), getDataFactory() l Service Lookup n getService(), getServices() l Service References n getServiceReference(), getServiceReferences() n getSelfReference()

6 C++ APIs (cont) n ServiceReference l Interface for interacting with service instances l Conversational interface n getConversationID(), setConversationID() l Asynchronous interface n getCallbackID(), setCallbackID() n getCallback(), setCallback()

7 C++ WSDL Mapping n Defines a translation from a C++ class interface to a WSDL n Uses comment annotations to control the conversion n Defines mapping rules for: l primitive types l C++ Standard Library types l SDO l classes, structs, arrays, enums n Defines a mapping from a WSDL to a C++ class interface l Currently defers to the OMG WSDL to C++ Mapping l Alternative mappings are being reviewed.

8 C++ Example n Interface SCDL n Implementation SCDL <implementation.cpp library=“loan” header=“LoanServiceImpl.h”/>

9 C++ Example (cont) n LoanService Interface class LoanService { public: virtual bool approveLoan( unsigned long customerNumber, unsigned long loanAmount) = 0; };

10 C++ Example (cont) n LoanServiceImpl Interface class LoanServiceImpl : public LoanService { public: virtual bool approveLoan( unsigned long customerNumber, unsigned long loanAmount) { // … } };

11 C++ Example (cont) n SCA Application int main(void) { ComponentContextPtr context = ComponentContext::getCurrent(); LoanService* service = (LoanService*) context->getService(“LoanService”); bool result = service->approveLoan(12345, 100); return 0; }

12 SCDL for C n Interface defined by a set of functions n interface.c l header – header file describing the interface l callbackHeader – (optional) header file describing the callback interface l remotable – (optional) Indicates whether the service can be called from a remote system n implementation.c l module – binary executable for the component implementation l library – (optional) indicates whether the service is implemented as a library or a program l location – (optional) location of the module l scope – (optional) Specifies the lifetime and reuse options for an implementation instance

13 C APIs n Synchronous Programming l SCALocate(), SCALocateMultiple() – get handle(s) to services l SCAInvoke() – invokes an operation of a service l SCAProperty () – get the value of a property l SCAGetFaultMessage(), SCASetFaultMessage() – get or set a fault message for a service operation n Asynchronous Programming l SCAGetCallback() – get handle of callback instance l SCACallback() – invoke a callback operation l SCASetCallback() – set a callback function for a reference l SCASetCallbackID(), SCAGetCallbackID() – get or set the callback ID for a service instance n Conversation Services l SCAGetConversationID(), SCASetConversationID() – get or set a user provided conversation ID l SCAEndConversation() – end a conversation

14 C Example n Interface SCDL n Implementation SCDL

15 C Example (cont) n LoanService Interface char approveLoan( long customerNumber, long loanAmount); n LoanService Implementation char approveLoan( long customerNumber, long loanAmount) { … }

16 C Example (cont) n SCA Application void clientFunction() { … SCALocate(L”customerService”, &serviceToken, &compCode, &reason); SCAInvoke(serviceToken, L“getCreditRating”, sizeof(custNum), (void *)&custNum, sizeof(rating), (void *)&rating, &compCode, &reason); }

17 SCDL for COBOL n interface.cobol l copybook – copybook file describing the interface l callbackCopybook – (optional) copybook file that describing the callback interface l location – (optional) location of library containing the copybook files l remotable – (optional) Indicates whether the service can be called from a remote system n implementation.cobol l program –binary executable for the component implementation l location – (optional) location of library containing the binary executable l scope – (optional) Specifies the lifetime and reuse options for an implementation instance

18 COBOL APIs n Same functions as in C l Synchronous Programming n SCAProperty is not typed l Program-Based Implementation Support l Asynchronous Programming l Conversation Services

19 Implementation as Program n Support environments where function is provided by programs n API l SCAService() – get name of invoked service l SCAOperation() – get name of invoked operation l SCAMessageIn() – get input message SCAMessageOut() – set output message

20 COBOL Example n LoanService Interface 01 LoanServiceInf. * @Operation name="LoanApplication" * input="CustomerName" * output="LoanAmount" 03 LoanApplication. 05 CustomerName PIC X(255). 05 LoanAmount PIC 9(4).

21 COBOL Example (cont) n LoanService Implementation PROCEDURE DIVISION. IN-THE-BEGINNING. PERFORM GET-MY-CONTEXT. EVALUATE My-Operation WHEN ApproveLoanOperation * Get service request MOVE length of CustomerNumber of ApproveLoan To InputMessageLength CALL "SCAMessageIn" using by content SCA-COMPCODE, SCA-REASON, My-Service, My-Operation, InputMessageLength, CustomerNumber of ApproveLoan PERFORM CUSTOMER-SERVICE * Return service response CALL "SCAMessageOut" using by content SCA-COMPCODE, SCA-REASON, My-Service, My-Operation, OutputMessageLength, LoanAmount of ApproveLoan WHEN OTHER CONTINUE END-EVALUATE. * Return to SCA runtime GOBACK. GET-MY-CONTEXT. CALL "SCAService" using by content SCA-COMPCODE, SCA-REASON, My-Service. CALL "SCAOperation" using by content SCA-COMPCODE, SCA-REASON, My-Operation.

22 COBOL Example (cont) n SCA Application PROCEDURE DIVISION.. CALL "SCALocate" using by content SCA-COMPCODE, SCA-REASON, CustomerServiceReference, CustomerServiceToken. CALL "SCAInvoke" using by content SCA-COMPCODE, SCA-REASON, My-CustomerServiceToken, CreditRatingOperation, InputMessagelength, CustomerNumber, OutputMessageLength, Rating.

23 C & COBOL WSDL Mapping n Defines a translation between language structures and WSDL n Defines type mapping rules for: l Primitive types l Structs or Groups l Variable length strings and unbounded arrays n Defines mapping rules between operations and functions

24 Annotations n Contained in comments, processed by tools n Interface l Invocation attribute n OneWay n Remotable n Callback l EndConversation n Implementation l Scope l Lifecycle l Conversation information l Property l Reference

25 Open Implementations n Apache Tuscany Native l http://incubator.apache.org/tuscany/sca -native.html http://incubator.apache.org/tuscany/sca -native.html l Implements pre-1.0 C++ specification l Working towards 1.0 compliance

26 OASIS References n Open CSA Member Section l http://www.oasis- open.org/committees/tc_home.php?wg_abbre v=opencsa-ms http://www.oasis- open.org/committees/tc_home.php?wg_abbre v=opencsa-ms n SCA-C-C++ Technical Committee l http://www.oasis- open.org/committees/tc_home.php?wg_abbre v=sca-c-cpp http://www.oasis- open.org/committees/tc_home.php?wg_abbre v=sca-c-cpp n SCA-C-C++ Charter l http://www.oasis-open.org/committees/sca-c- cpp/charter.php http://www.oasis-open.org/committees/sca-c- cpp/charter.php

27 OSOA References n OSOA SCA Specifications l http://www.osoa.org/display/Main/Servi ce+Component+Architecture+Specifica tions http://www.osoa.org/display/Main/Servi ce+Component+Architecture+Specifica tions l Specifications n SCA C++ Client and Implementation n SCA C Client and Implementation n SCA COBOL Client and Implementation

28 Thank You Merci Grazie Gracias Obrigado Danke Japanese English French Russian GermanItalian Spanish Brazilian Portuguese Arabic Traditional Chinese Simplified Chinese Thai

29 Backup

30 C++ APIs (cont) n Supplemental APIs l RefCountingPointer n Defines a reference-counted pointer interface l SCAException n Provides a hierarchy of exception classes for use with the SCA API. SCANullPointerException ServiceRuntimeException ServiceUnavailableException NoRegisteredCallbackException ConversationEndedException MultipleServicesException

31 C++ Annotations n Contained in comments, processed by tools n Interface Header File l @Remotable, @Conversational l @Callback, @OneWay l @EndsConversation n Implementation Header File l @Scope l @EagerInit l @AllowsPassByReference l @ConversationAttributes l @Property l @Reference

32 C Annotations n Contained in comments, processed by tools n Header File l @Interface l @Operation, @Callback, @OneWay l @Remotable, @Conversational l @EndsConversation n Implementation File l @Service l @Reference l @Property l @Scope l @Init, @Destroy, @EagerInit l @AllowPassByReference l @ConversationAttributes

33 COBOL Annotations n Contained in comments, processed by tools n Interface File l @Interface l @Operation, @Callback, @OneWay l @Remotable, @Conversational l @EndsConversation n Implementation File l @Service l @Reference l @Property l @Scope l @Init, @Destroy, @EagerInit l @AllowPassByReference l @ConversationAttributes


Download ppt "SCA C++, C and COBOL Bryan Aupperle David Haney 13 Dec. 2007."

Similar presentations


Ads by Google