Docstoc

Web Services_ J2EE_ and CORBA

Document Sample
Web Services_ J2EE_ and CORBA Powered By Docstoc
					                     Web Services,
                    J2EE and CORBA
                            Hugh Grant
                               CTO
                       Cape Clear Software




www.capeclear.com
                    Agenda

                     Integrating with Web Services
                       Why Bother?

                     Using CORBA with Web Services
                       Mapping CORBA IDL → WSDL and SOAP

                     Using J2EE with Web Services
                       Mapping Java interfaces → WSDL and SOAP

                     Generic Challenges & Issues

                     Q&A

www.capeclear.com
                    Why Web Services?

                     Two key factors
                        ubiquity
                        ease of use


                     Everybody supports or will support web services
                        need to support web services to facilitate integration


                     Web service technologies are oriented towards a less
                     technical community
                        simpler tools / wider adoption
                        open up expensive, back-end, enterprise services to a
                        wider audience




www.capeclear.com
                    Lies, Damned Lies, and Statistics

                     Gartner estimate the web service software market to
                     be $1.7 billion by 2003

                     Evans Data estimate that 63% of all developers will be
                     working on web-service projects by the end of 2003
                        37% are working on web-service projects already

                     Butler Group says over 76% of CIOs believe web
                     services to be highly significant for the way they
                     deliver IT services

                     Jupiter Media Matrix recently found that 60% of CEOs
                     planned to use web services in 2002

                     A recent InfoWorld survey showed that 28% of
                     companies are now using web services
                        another 23% are planning to introduce them this year


www.capeclear.com
                    Web Services Everywhere?

                     Sometimes the hype gets a little too much…

                     Web services are complementary to
                     technologies such as J2EE, CORBA, etc.
                       they do not replace them!


                     They give us a web-friendly “least common
                     denominator” for systems integration
                       definitely the simplest way to integrate .NET,
                       CORBA, J2EE, etc.




www.capeclear.com
                    Integrating with Web Services

                     Web services can be used to integrate components in
                     two ways

                         Wrap existing components as web services

                             Web                SOAP                    Java / CORBA
                            Service                           Adapter
                                                                         Component
                             Client




                         Use web services as “glue” to integrate multiple systems

                    Java / CORBA                       SOAP                   Java / CORBA
                                      Adapter                       Adapter
                     Component                                                 Component




www.capeclear.com
                    Wrapping Existing Components

                     Same issues for both CORBA and J2EE

                     Both development and deployment:
                       generate WSDL representing the service
                       perform run-time SOAP / Java mapping


                     The options:
                       do it by hand
                       use low-level tools (e.g., JAX-RPC)
                       generate directly from IDL files or Java interfaces
                       using automated tools


www.capeclear.com
                    Hand-coding Web Service Adapters

                     Not recommended — a lot of work!

                     What’s involved (for each component):
                       write WSDL definition
                          (messy!)


                       write wrappers, or marshaling / unmarshaling code
                          (tedious!)


                       write network listeners / dispatchers
                          parse incoming XML requests
                          invoke appropriate wrapper
                          (hard!)



www.capeclear.com
                    Wrapping CORBA Components

                     IDL / WSDL Mapping
                       standardization work in-progress in OMG


                     Some of the major issues:
                       object references do not map directly onto SOAP
                       CORBA value types
                       a complete bi-directional mapping is hard, as many
                       XML schema constructs are problematical in IDL




www.capeclear.com
                    Wrapping CORBA Components

                     In practice, a full mapping isn’t really
                     required
                       most applications will involve:
                          web service client → CORBA Server
                          coarse-grained web service interfaces
                          (e.g., hide transactions, etc.)


                     Some common problems remain
                       callbacks
                       CORBA Any parameters




www.capeclear.com
                    IDL / WSDL Mapping
                                         <?xml version="1.0" encoding="UTF-8"?>
                                         <definitions
                                                  name="helloCorba"
                                                  targetNamespace="http://www.capeclear.com/helloCorba.wsdl"
                                                  xmlns="http://schemas.xmlsoap.org/wsdl/"
                                                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                                                  xmlns:tns="http://www.capeclear.com/helloCorba.wsdl"
                                                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"


           WSDL can be a little
                                                  xmlns:xsd1="http://www.capeclear.com/helloCorba.xsd">
                                                  <types>
                                                  <xsd:schema
                                                                 targetNamespace="http://www.capeclear.com/helloCorba.xsd"


           verbose…
                                                                 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
                                                                 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                                                                 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                                                  <xsd:complexType name="CCReference">
                                                  <xsd:sequence>
                                                  <xsd:element
                                                                 maxOccurs="1“
                                                                 minOccurs="0“


          interface HelloWorld {
                                                                 name="reference“
                                                                 nillable="true“
                                                                 type="xsd:string"/>
                                                  </xsd:sequence>


             void foo();
                                                  </xsd:complexType>
                                                  </xsd:schema>
                                                  </types>
                                                  <message name=“foo">
                                                                 <part name="target" type="xsd1:CCReference"/>


          };
                                                  </message>
                                                  <message name=“fooResponse"/>
                                                  <portType name="server.HelloWorld">
                                                                 <operation name=“foo" parameterOrder="target">


                            … maps to
                                                                                         <input message="tns:foo"/>
                                                                                         <output message="tns:fooResponse"/>
                                                                 </operation>
                                                  </portType>
                                                  <binding name="server.HelloWorldBinding" type="tns:server.HelloWorld">
                                                                 <soap:binding style="rpc"
                                                  transport="http://schemas.xmlsoap.org/soap/http"/>
                                                                 <operation name=“foo">
                                                                 <soap:operation
                                                                 soapAction="capeconnect:helloCorba:server/HelloWorld#getMessage"/>
                                                                 <input><soap:body
                                                  encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

                                                                namespace="capeconnect:helloCorba:server/HelloWorld“
                                                                                        use="encoded"/>
                                                                </input>
                                                                <output><soap:body
                                                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/“

                                                                namespace="capeconnect:helloCorba:server/HelloWorld“
                                                                                        use="encoded"/>
                                                                </output></operation>
                                                  </binding>
                                                  <service name="helloCorba">
                                                                 <documentation>helloCorba</documentation>
                                                                 <port binding="tns:server.HelloWorldBinding"
                                                  name="server.HelloWorld">
                                                                 <soap:address location="http://localhost:8000/ccx/helloCorba"/>
                                                                 </port>
                                                  </service>
                                                  <!--Created by CapeConnect on Fri Mar 08 17:29:59 GMT 2002 See
                                                  http://www.capeclear.com for more details-->
                                         </definitions>




www.capeclear.com
                    Wrapping CORBA Components

                       Specialized IDL compiler generates WSDL and
                       mapping code



              Web                  SOAP




                                                Mapping
                                                 SOAP
             Service                                       CORBA         IDL
              Client                                      Component


                                                                       (parse IDL)


                                                                      Web Service
                            UDDI Repository                            Generator




www.capeclear.com
                    Wrapping J2EE Components

                     Same basic steps as wrapping CORBA

                     Java / WSDL Mapping
                       de-facto standard introduced with JAX-RPC


                     Some of the major issues:
                       stateless nature of SOAP
                       (need to deal in terms of stateless session beans)
                       interoperability — J2EE vendors had already built
                       mappings before JAX-RPC




www.capeclear.com
                    JAX-RPC

                       Generates stubs and WSDL definition
                            based on RMI — requires remote interface classes




                                                                                       (1) analyzes
                                                                                       interface classes
                                                             Service Interface
                    Client Program
                                                                 Classes
                Generated “stubs”                            Generated “ties”                 xrpcc
                                     (3) performs run-time                                  Generator
                                     SOAP/Java mapping
                JAX-RPC runtime                              JAX-RPC runtime     (2) generates
                                                                                 stubs and ties




www.capeclear.com
                    Wrapping Java Components

                       Perform Java reflection to analyze interface classes in
                       order to generate WSDL and mapping code



              Web                   SOAP                                     Java




                                                   Mapping
                                                    SOAP
             Service                                                         Class
                                                             App Server
              Client
                                                                              EJB

                                                                            (reflection)



                                                                          Web Service
                             UDDI Repository                               Generator




www.capeclear.com
                    Generic Challenges

                     “Interface Impedance Mismatch”
                           unlikely that raw components work well as web services

                     Need to provide web service wrappers (“facades”) to
                     simplify for web use
                           facade object just calls underlying object

                     How should we build these facades?
                           wrap at CORBA/J2EE level
                           map wrapper to web service

                      or

                           wrap at the web services level


www.capeclear.com
                    Facade Objects Via XSLT

                     WSDL is just an XML schema
                       already have XSLT as a standard mechanism for
                       mapping schemas


                     Use XSLT to map WSDL  WSDL
                       this allows us to create virtual facade objects

                       incoming messages are rewritten to map to “real”
                       web service implementation




www.capeclear.com
                    Façade Objects Via XSLT

                     Define XSLT mapping between WSDL definitions
                       it will convert SOAP messages accordingly



       WSDL level


                           WSDL for      define XSLT mapping     WSDL for
                           “façade”
                                                               “real” service
                            service




                                         apply XSLT mapping    SOAP request
                         SOAP request
                                                                 for “real”
                          for “façade”
                                                                  service
       SOAP level



www.capeclear.com
                    Leveraging XML

                     Web services are more than just
                     “middleware + XML”
                       otherwise, what would be the point?


                     Need to explore the opportunity of mixing
                     document-oriented and RPC approaches

                     XSLT facades are a good example of this

                     Look out for other opportunities
                       e.g., XPath for pattern matching, etc.

www.capeclear.com
                    Some Real Challenges Remain

                     Web services make it much easier to glue components
                     together at a basic connectivity level

                     Incompatibility remains between the underlying
                     services
                        a very real problem integrating multiple component
                        systems
                           e.g., J2EE, CORBA, .NET, MQ, etc.

                        naming services
                           UDDI versus JNDI / CosNaming
                        security
                           SAML versus J2EE versus CosSecurity versus NT Security…
                        transactions
                        persistence
                        etc.


www.capeclear.com
                    Final Thoughts

                     Distributed systems are hard…
                     “…anyone who says differently is selling something.”

                     Web services share all of the problems and
                     advantages of distributed systems!

                     However, they really make life easier when integrating
                     different systems

                     More work needs to be done around security, etc…
                     …but the technology is maturing rapidly, so expect to
                     see new standards and products addressing these
                     issues


www.capeclear.com
                    Q&A



                    That’s all folks!



                    Further Info:

                      Web site:     www.capeclear.com

                      Email:        hugh.grant@capeclear.com

www.capeclear.com

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:3
posted:10/2/2011
language:English
pages:22