S A N K H Y A Copyright (c) 2003 Sankhya Technologies Private Limited. All rights reserved. SANKHYA Varadhi: Developer Notes for Web Services Support in SANKHYA Varadhi ============================================================================ Introduction ------------ SANKHYA Varadhi ORB is an Object middleware for platform independent distributed application development. It is compliant with Object Management Group's CORBA (Common Object Request Broker Architecture) specification. CORBA specifies both language and platform independent way of accessing remote (i.e. distributed) services. In addition to the compliance with Object Management Group's CORBA specification, SANKHYA Varadhi provides support for the below. * SOAP protocol layer for Varadhi Varadhi applications can send and receive XML based SOAP messages over HTTP transport. SOAP/HTTP Client <================> Server * Ability to access WSDL defined Web-based services, with ports (WSDL ) bound to SOAP/HTTP from CORBA client application. * Ability to develop a Web Service using CORBA framework that can be accessed from any Web Services client. SOAP protocol is a simple text based (XML) protocol mostly over HTTP that allows RPC style request-response messages. Varadhi idlc can translate IDL to WSDL and vice versa in addition to C++, Java mapping. SANKHYA Varadhi Platform Creation for SOAP/HTTP configuration: ------------------------------------------------------------- Varadhi can be customized for a particular target configuration using vconf. On Unix, Varadhi configuration files are provided under $VARADHI/etc/config directory to create various Varadhi Target Platforms. On Window NT/2000 host, the location is %VARADHI%\etc\config directory. A new Varadhi Target Platform needs to be built for soap configuration. The pre-built Platforms shipped with SANKHYA Varadhi cannot be used. The Varadhi Platform configuration should use the 'soap.cfg'. For example, to build the demo in Solaris host, the Varadhi Target Platform should be created as below In csh % vconf defaults soap sol2-gcc The configuration that is built with 'soap.cfg' configuration file enables the SOAP/HTTP protocol support. ORB message param size must be bigger than the default for SOAP which is increased in 'se.cfg' configuration file. 'soap.cfg" includes 'se.cfg' to increase the ORB message param size. The configuration files 'soap.cfg', 'se.cfg' are provided under $VARADHI/etc/config. Where $VARADHI is the Varadhi installation location. SANKHYA Varadhi IDL/WSDL Translator: ----------------------------------- IDL to WSDL translation using Varadhi idlc: SANKHYA Varadhi IDL to WSDL translator (idlc) can be used to translate an IDL input to a corresponding WSDL mapping in conformance with the OMG CORBA to WSDL/SOAP Interworking specification. The generated WSDL file can be used to develop the relevant WebService applications. WSDL to IDL translation using Varadhi idlc: WSDL file can be provided as input to idlc and it generates an IDL file in the case of WSDL to IDL translation in conformance with the OMG WSDL to IDL mapping specification. The generated IDL file can be used to develop the relevant CORBA applications. IDL/WSDL to C++/Java Mapping using Varadhi idlc: idlc compiler can be used to generate C++/Java stub/skeleton for the input IDL/WSDL for the CORBA/Webservice application. WSDL to C++/Java mapping is not yet standardized by OMG. Please refer $VARADHI/docs/help/idlc.txt for the idlc usage for various translations discussed above. Where $VARADHI is the Varadhi installation location. Using http URL on the SOAP client/server Applications: ----------------------------------------------------- "corbaloc:" form of URL cannot be used for addressing a Web Service since SOAPAction and other information needs to be specified. So "http:" form of addressing is chosen for Varadhi as below http:::## The object URL is formed using the info below soap action attribute value of tag in section of the WSDL file namespace attribute value of element in section of the WSDL file location attribute value of element in element of section in WSDL. TCP/IP address of internal HTTP gateway, or the external HTTP server for the WSDL service. The component for a service is like the object key in CORBA. CORBA clients still need to use TCP/IP to connect to the actual server or a HTTP gateway. This requires IP address and port number also to be specified in addition to the HTTP information. This can be in corbaloc IIOP protocol IP addressing format. For e.g., to address a service with the following information from WSDL and with a HTTP gateway running in localhost at port number 8128, the following format can be used. WSDL: Service Location: http://www.sankhya.com/AdderService/ SOAPAction : Adder Namespace : Adder-add CORBA Object URL: http://www.sankhya.com/AdderService/:127.0.0.1:8128#Adder#Adder-add If namespace is empty, then it can be ignored or just the "#" can be given. If soapAction is empty, then it should be replaced with "#" If either IP address or port number is default then they can be empty. Client can use either - resolve_initial_reference() with the object id - string_to_object() with the Object URL to resolve the object references. Limitation: 1. The Object ID and SOAPAction should be same for string_to_object() to work in the current version. Note: 1. -ORBInitRef option can be used to override the values mentioned in the .cfg file while building the platform/app 2. --VaradhiRedirect option can be used to redirect the request to different TCP/IP address than that is mentioned in Object URL. Using IOR for Varadhi SOAP client/server Applications: ----------------------------------------------------- a) Varadhi SOAP Server can dump its object reference to IOR file, which can be used by the Client to invoke operations on server. The CORBA object url is formed using the below information. URI is http://localhost/ Namespace is empty SOAPAction is object ID like /0:0:1070003597 Service need not be registered using a config file by means of Vconf. If required, clients can use the above info and create a platform with a .cfg file containing -register command with Object URL http://localhost/::#/0:0:1070003597# where and is the TCP/IP address of the server or HTTP agent/gateway. b) Server can use .cfg file to register an Object via -register command. Client can use either - IOR file - resolve_initial_reference() with the object id - string_to_object() with the Object URL to resolve the object references. Limitation: 1. The Object ID and SOAPAction should be same for string_to_object() to work in the current version. SOAP Profile in the Object Reference: ------------------------------------ SOAP profile in the Object Reference is an IOP profile and the tag "TAG_SOAP_IOP" identifies the Simple Object Access Protocol. SOAP profile tag has been assigned by OMG. Body of the SOAP profile will have the information regarding the Soap Action attribute, Namespace attribute and the Service location attribute. IIOP profile body contains a CDR encapsulation of a structure containing addressing and object identification information used by IIOP. SOAP profile has been added similar to the IIOP. Below is the output obtained using 'dumpior' utility for a sample application which contains the structure of the SOAP profile in the Object reference. ... struct IOR { type_id ==> IDL:SiteInspectPort:1.0 profiles ==> 2 struct IOPProfile { ProfileId Tag ==> TAG_INTERNET_IOP struct IIOPProfileBody { struct Version { major ==> 1 minor ==> 1 } hostname ==> 127.0.0.1 port ==> 2040 object_key ==> /0:urn:SiteInspectAction:1070372133 components ==> 0 } ProfileId Tag ==> TAG_SOAP_IOP struct SOAPProfile { URI ==> http://www.flash-db.com/services/ws/siteInspect.php Namespace ==> urn:SiteInspect SOAPAction ==> urn:SiteInspectAction } } } SOAP Exception and SOAP error minor codes: ----------------------------------------- The SOAP Exception is a Varadhi defined CORBA User Exception. This Exception will be generated when CORBA client applications gets SOAP Fault message from any SOAP server (non CORBA/Varadhi). Please refer the "SOAP and HTTP related Message Codes" section of $VARADHI/docs/MinorCodes.txt document for soap related error codes. Where $VARADHI is the Varadhi installation location.. Building and running sample application: --------------------------------------- Please refer to $VARADHI/samples/soap_wsdl/README. Where $VARADHI is the Varadhi installation location. Below listed Varadhi sample CORBA applications ($VARADHI/samples) will work with SOAP support enabled. Varadhi platform has to be created for these samples as mentioned in "SANKHYA Varadhi Platform Creation for SOAP/HTTP configuration" section in this document. 1. adder 2. defservant 3. hostserver 4. multiplier 5. persist 6. soap_wsdl 7. stringseq 8. union 9. multithread/adder 10. multithread/add_strseq Limitations: ----------- Current version does not support the following types. 1. SOAP support for Array, Any, Wstring, Fixed, Enumerator, CORBA::TypeCode type.