One of the best Podcasts I have come across, on Web Services concepts...
Lecture 11: Web Services, SOAP 1.2, and WSDL 1.1
Harvard Extension School\'s Computer Science E-259: XML with J2EE
Double-click on the "blank" screen to start the video, I set "autoplay" option to false, just to make sure users who are not interested in this podcast don't get confused while browsing other content on this blog.
Note : If you fail to see this video, pls make sure you have "Quicktime" Player installed..
Web Services,SOA,everywhere.Well,it certainly has so much positive impact on current IT community and proving its worth being adopted by leading industry players such as IBM, HP, Oracle, Microsoft, Novell, and Sun for different Web Services products.Yes Iam talking about SOA-Web Services which are here to stay and look set to dominate the deployment of major enterprise applications in the coming years.
IBM’s definition of Web Services states that “Web Services are self-contained, modular applications that can be described, published, located, and invoked over a network, generally, the World Wide Web.” In one of my previous articles,Web Services Patterns we looked at the advantages provided by SOA applications. When the definition refers to Web Services being invoked over the World Wide Web, it means that they use HTTP as the transport layer and an XML-based message layer. However, Web Services do not actually require HTTP—XML-formatted data can be sent over other transport protocols (message queuing, for example), which may be more suited to mission-critical transactions.
Web Services generally uses the HTTP and SSL ports (TCP ports 80 and 443, respectively) in order to pass through firewalls. In the early days of “Web Services,” vendors would say that their products were “firewall compliant.” This meant that firewalls would not block the Web Services traffic, whereas CORBA traffic attempting to use CORBA-specific ports may be blocked. Web Services make it easier to deploy distributed computing without having to open firewall ports, or having to “punch a hole in the firewall” as network administrators like to say. This “under the radar” deployment has serious security implications. Most firewalls are unable to distinguish Web Services traffic, traveling over HTTP and SSL ports, from Web browser traffic. The word “Services” in Web Services refers to a Service-Oriented Architecture (SOA). SOA is a recent development in distributed computing, in which applications call functionality from other applications over a network. In an SOA, functionality is “published” on a network where two important capabilities are provided— “discovery,” the ability to find the functionality, and “binding,” the ability to connect to the functionality. In the Web Services architecture, these activities correspond to three roles: Web Service provider, Web Service requester, and Web Service broker, which correspond to the “publish,” “find,” and “bind” aspects of a Service-Oriented Architecture.
Web Services security focuses on the application layer, although security at the lower layers remains important. The implementation technologies on which we focus are HTTP and SOAP, although we will keep SMTP security in mind also since SOAP can be bound to SMTP as well as HTTP.It may not seem immediately obvious why security for SOAP presents such a challenge. After all, SOAP is generally bound to HTTP, which already has SSL for authentication and confidentiality. In addition, many Web authorization tools already exist. It is a reasonable question to ask why these aren’t enough, and the answer is made up of a number of reasons.The first reason is that, although frequently bound to HTTP, SOAP is independent of the underlying communications layers. Many different communications technologies can be used in the context of one multi-hop SOAP message; for example, using HTTP for the first leg, then SMTP for the next leg, and so forth. End-to-end security cannot therefore rely on a security technology that presupposes one particular communications technology. Even in the case of a single SOAP message targeted at a Web Service, transport-level security only deals with the originator of the SOAP request. SOAP requests are generated by machines, not by people. If the Web Service wishes to perform security based on the end user, it must have access to authentication and/or authorization information about the end user on whose behalf the SOAP request is being sent. This is the second reason for Web Services security.
SOAP is a technology used to enable software to talk to other software much easier than was previously possible. End users (that is, humans) do not make SOAP messages themselves. However, if access to the Web Service is to be decided based on the information about the end user, the Web Service must have access to the information that allows it to make this authorization decision. This information does not have to include the end user’s actual identity.How can this information about the end user be conveyed to the Web Service? Session layer or transport layer security between the application server and the Web Service doesn’t convey information about the identity of the end user of the Web Service. It merely conveys information about the application server that is sending the SOAP message. It may be the case that many of the requests to the Web Service originate from that application server.This challenge is addressed by including security information about the end user in the SOAP message itself. This information may concern the end user’s identity, attributes of the end user, or simply an indication that this user has already been authenticated and/or authorized by the Web server. This information allows the Web Service to make an informed authorization decision.This scenario is likely to be widespread where many Web Services are used to implement functionality “behind the scenes.” It shouldn’t be the case that the end user has to reauthenticate each time a SOAP request must be sent on their behalf. The challenge of providing this functionality is sometimes called “single sign-on” or “federated trust.”
WS-Routing provides a means for SOAP messages to route between multiple Web Services. WS-Routing defines how to insert routing information into the header of a SOAP message. This routing information can be thought of as equivalent to routing tables that operate at lower layers of the OSI stack for routing IP packets.WS-Routing means that one SOAP message may traverse multiple SOAP “hops” between the originator and the endpoint. The systems that implement these hops may have nothing in common apart from the ability to parse and route a SOAP message.When routing between Web Services, the requirement for confidentiality can apply from the originator through to the final SOAP endpoint. It may be a requirement that information be kept secret from SOAP intermediaries. There may be a chance that intermediaries may disclose the information either deliberately or through leaving “gaps” between one transport-level security session and the next. While the data is decrypted, it is vulnerable. This is the same problem that plagued the first release of the Wireless Access Protocol (WAP), in which data was decrypted in between the wireless encryption session and encryption on the fixed wire. This so-called “WAP gap” caused a loss of confidence in WAP security and was addressed in later releases of the WAP specification. Implementing encryption only at the transport level makes a “SOAP gap.”It is often noted that most security breaches happen not while data is in transit, but while data is in storage. This is the principle of least resistance—attempting to decrypt eavesdropped encrypted data from an SSL session is much more difficult than simply testing if a Web site maintainer has remembered to block direct access to the database where the credit card numbers are stored. If decrypted data is stolen from a database, the consequences are no less dramatic. Once data has reached its final destination, it must be stored in a secure state. Confidentiality for a SOAP transaction should not involve simply chaining instances of confidentiality together, since “SOAP gaps” of unencrypted data are available between each decryption and encryption.
Web Services Security Specifications Confidential information in a SOAP message should remain confidential over the course of a number of SOAP hops.A number of industry specifications have been developed for this purpose. These specifications can be organized into two distinct categories:A standardized framework to include XML-formatted security data into SOAP messages.Standards for expressing security data in XML format. This security information should be used for the high-level principles of security: confidentiality, authentication, authorization, integrity, and so forth.
WS-Security WS-Security has emerged as the de facto method of inserting security data into SOAP messages. Work on WS-Security began in 2001, was published by Microsoft, VeriSign, and IBM in April 2002, and was then submitted in June 2002 to the OASIS standards body in order to be made into an industry standard. WS-Security defines placeholders in the SOAP header in order to insert security data. It defines how to add encryption and digital signatures to SOAP messages, and then a general mechanism for inserting arbitrary security tokens. WS-Security is “tight” enough to present the definitive means of including security data into SOAP messages, but is “loose” enough to not place limits on what that security data can be.
XML Encryption XML Encryption is a specification from the W3C. It provides not only a way of encrypting portions of XML documents, but also a means of encrypting any data and rendering the encrypted data in XML format. XML Encryption makes encryption functionality easier to deploy.XML Encryption is not a replacement for SSL. SSL is still the de facto choice for confidentiality between two entities that are communicating using HTTP. However, if the security context extends beyond this individual HTTP connection, XML Encryption is ideal for confidentiality. The capability to encrypt XML is nothing new, because XML is just text after all. However, the ability to selectively encrypt XML data is what makes XML Encryption so useful for Web Services. Encrypting an entire SOAP message is counterproductive, because the SOAP message must include enough information to be useful—routing information, for example. Selectively encrypting data in the SOAP message is useful, however. Certain information may be hidden from SOAP intermediaries as it travels from the originator to the destination Web Service.XML Encryption does not introduce any new cryptography algorithms or techniques. Triple-DES or RSA encryption may still be used for the actual encryption. XML Encryption provides a way to format the meta-information about which algorithm was used, and when the encryption occurred. This aids the Web Service in decrypting the data, provided the decryption key is available to it. This is important, because prior to XML Encryption the only standardization of encryption data was for e-mail messages (that is, S/MIME). If an organization wished to send encrypted data to another organization, both organizations would have to agree on the format of the encrypted data, how and which algorithms to use, and possibly also how to send an encrypted key. Now that information can be contained in an XML Encryption block.
XML Signature XML Signature is a specification produced jointly by the W3C and the Internet Engineering Task Force (IETF). Like XML Encryption, it does not only apply to XML. As well as explaining how to digitally sign portions of an XML document, XML Signature also explains how to express the digital signature of any data as XML. As such, it is an “XML-aware digital signature.” PKCS#7 is a means of rendering encrypted data, and signed data, which predates XML Signature and XML Encryption. Rather than using XML, it uses Abstract Syntax Notation number 1 (ASN.1). ASN.1 is a binary format, renowned for its complexity. Producing or verifying a PKCS#7 signature requires not just cryptography software, but also an ASN.1 interpreter. XML Signature also requires cryptography software, of course, but an XML DOM replaces the ASN.1 interpreter. The power of XML Signature for Web Services is the ability to selectively sign XML data. For example, a single SOAP parameter passed to a method of a Web Service may be signed. If the SOAP request passes through intermediaries en route to the destination Web Service, XML Signature ensures end-to-end integrity.WS-Security describes how to include XML Signature data in a SOAP message. An important feature of XML Signature is that it can be very selective about what data in an XML instance is signed. This feature is particularly useful for Web Services. For example, if a single SOAP parameter needs to be signed but the SOAP message’s header needs to be changed during routing, an XML Signature can be used that only signs the parameter in question and excludes other parts of the SOAP message. Doing so ensures end-to-end integrity for the SOAP parameter while permitting changes to the SOAP’s header information.
Security Assertions Markup Language (SAML) provides a means of expressing information about authentication and authorization, as well as attributes of an end user (for example, a credit limit) in XML format. SAML data may be inserted into a SOAP message using the WS-Security framework. SAML is used to express information about an act of authentication or authorization that has occurred in the past. It does not provide authentication, but can express information about an authentication event that has occurred in the past; for example, "User X authenticated using a password at time Y.” If an entity is authorized based on the fact that they were previously authorized by another system, this is called “portable trust.” SAML is important to address the challenge of multihop SOAP messages also, because separate authentication to each Web Service is often out of the question. By authenticating once, being authorized, and effectively reusing that authorization for subsequent Web Services, single sign-on for Web Services can be achieved.Note that this information in a SAML assertion may not indicate the end user’s identity. The user may have authenticated using a username and password, and the administrator of the Web site may have no idea of the user’s actual identity. It may simply be an indication that the user presented credentials and was authenticated and authorized. SAML allows information to be placed into a SOAP message to say “this person was authorized according to a certain security policy at a certain time." If the recipient of this SOAP message trusts the issuer of the SAML data, the end user can also be authorized for the Web Service. This SAML data is known as an “assertion” because the issuer is asserting information about the end user. The concept of security assertions has existed before SAML, and is already widely used in existing software.
XML Access Control Markup Language (XACML) is designed to express access control rules in XML format. Although the two technologies are not explicitly linked, XACML may be used in conjunction with SAML. An authorization decision expressed in a SAML assertion may have been based on rules expressed in XACML.
Microsoft’s Passport technology takes a different approach to single sign-on. The user authenticates to the passport infrastructure, either directly through www.passport .com or through an affiliate site that makes use of functionality provided by passport.com. Once the user is authenticated and authorized by Passport, their authentication status is also available to other Web Services that use Passport. Like SAML, this provides single sign-on. However, the model is different, relying on a central point of authentication rather than SAML’s architecture where authentication happens at an individual Web Service. By being implemented at the site of the Web Service itself, SAML authentication and authorization information may be based on role-based security. Role-based security means that access to resources is based on the user’s organizational role; for example, in a medical setting doctors may have access to certain information while nurses have access to different information.
In this article(from Web Services Security),I tried to just give an overview on the different specifications that can be used to achieve Web Services security,for a detailed understanding,I suggest get a good book like this one,"Web Services Security",to whom I owe these excerpts,and get a clear understanding as to implementing and using specifications for securing the web services you develop.And thanks to ,Mark O'Neil,for his inputs and allowing me to use some stuff from his book.
Web Services provide an important building block for integrating disparate computing platforms and, indirectly, provide a mechanism to integrate their global value chains. You can build Web Services after the system was originally deployed, making them similar in many ways to today's EAI software, but you can also build them along with new software as the open Application Programming Interface (API) to the application.
Advantages of using Web Services Using Web Services , you can build an API which islanguage- neutral and platform-neutral format, programmers can access data from one system and quickly move it to the other through the Web Service. There are several strengths to this approach:
Programmers can write the data-transfer programs in any language or platform with which they are comfortable.
The source and target systems can control the requests and updates of data in such a way that they do not interfere with a running system.
Consider the number of ways that a simple problem, such as notifying interested parties of a change to an object's state, are solved with a platform such as Java 2 Standard Edition. Some developers may use an intermediate file to track changes, with interested parties reading the file to find out when and how an object changed. Other developers may construct a point-to-point notification system, or even a set of one-to-many Publish/Subscribe patterns. Some developers may have one type of naming convention for the adding and removing of listeners; other developers may not have any naming convention for the same operations-these are some of the areas where Web Services can be highly useful
Using Design Patterns Patterns can be applied to any portion of the software cycle which usually involve gathering requirements, creating the architecture, designing the software, and implementing it.Thousands of software design patterns document the common problems encountered by software designers and generic solutions for those problems. For example, an architect may give a system structure that identifies a point in the system where an object change drives listeners to make changes in their own state, or the change kicks off a business process. In these cases, a designer can look and determine that the Publish/Subscribe or the Observer pattern can fulfill the requirements and constraints an architect put on the design. Once identification of patterns is complete, the generic structure given in a pattern drives the design of the particular system structure.
Web Services Design Patterns The following patterns look at how Web Services implement the service-oriented architecture, how service implementations interact with the Web Service environment, and how to locate and use Web Services: Service-Oriented Architecture: The Web Services environment is an architecture implementation known as the service-oriented architecture. There are several different implementations of the service-oriented architecture with Web Services having the most penetration in the industry to date. Implementations of service-oriented architectures stress two attributes: implementation transparency and location transparency. Implementation transparency requires a common system structure that applies equally to all possible underlying service implementations and a neutral mechanism for describing services. Location transparency requires the use of agnostic interfaces. Architecture Adapter: This pattern expands on the GoF Adapter pattern. Although the GoF Adapter pattern resides in object-oriented programming as a way to adapt an exposed interface from a component to an expected dependent interface from another component, the Architectural Adapter pattern is responsible for allowing two completely separate architectures to interoperate. Service Directory: In statically bound systems, and even in many dynamic systems, companies assume that their choices for the purchaser of software are the right choices. The Web Service paradigm challenges this tradition. Instead, by creating detailed metadata about a service, a service user should be able to locate your service and use it without application modification. The metadata in a service-oriented architecture includes its interface, location for binding, mechanism for communication, and information about the business that created the service. This pattern goes into depth on the Service Directory patterns that are inherent in the leading service architectures and that you will encounter in Web Services. Business Object: This pattern discusses the typical structure and contents of a single business object. Although the frequency that you will use a single business object for deployment is low, there are substantial lessons you can learn from the exercise of deploying a business object. As with the first three patterns, this pattern is heavy in discussion around the Web Service environment and lessons you can learn from deploying relatively simple objects. Business Object Collection: In business, you will rarely find business objects that are not collected. Like the business object itself, handling collections with Web Services yields substantial instructional substance as you learn more about the Web Service environment. Business Process (Composition): Business systems today revolve more around business processes than around supporting business objects. A business process does not necessarily correlate to a single business object but is more abstract in nature. This pattern looks at business processes and lays a general framework for exposing them as Web Services. The business process is also a form of composition. To achieve a business process, multiple business objects and, often, other business processes and activities must run. Asynchronous Business Process: A world where all business processes are synchronous would be a fine world to live in for programmers. Unfortunately, most important business processes are not synchronous. Even the most basic business processes, such as fulfilling a book order, run into asynchronous complexities. In introducing the Asynchronous Business Process pattern, you will find many similarities to the relationship between business objects and business object collections Event Monitor: Often, the burden of determining when events occur in a service lies with the client. There are a variety of reasons for this, such as the service not having a reasonable publish/subscribe interface or the client desiring control of the event determination. This is a common, and relatively simple, design pattern to implement that has well- established roots throughout software history. Observer: Rather than leaving a client to determine when data changed on a server, it is often more efficient to have the server component tell interested clients when data changes. This is especially true when the server component has a low frequency of updates compared to the frequency that clients will want to check. The Observer pattern formalizes the relationship between one or more clients and a Web Service that contains interesting state. The Web Service delivers events to interested clients when an interesting change occurs. The Gang of Four documented the Observer pattern. This implementation is similar to the original documentation of the pattern, with necessary information about Web Services. Publish/Subscribe: The Publish/Subscribe pattern [Buschmann] is a heavily used pattern in EAI software as well as in many distributed programming paradigms. The Publish/Subscribe pattern is interesting in the context of the definition of Web Services as application components. Using a topic-based mechanism common in very loosely coupled architectures, you create a stand-alone event service that is, in effect, an application component. The event service forwards published events to subscribers without awareness of the application components that use the event service. Physical Tiers: Throughout the book and the sample implementations in the chapters, you will use a simple Java-based deployment mechanism built into Apache Axis. Therefore, your components live entirely within the process space that Apache Axis uses. This is not an optimal model for enterprise applications. The model discourages runtime reuse and creates a larger footprint than is necessary. Further, the event patterns produced some interesting challenges for a Web Service environment. A client interested in events from a Web Service often exists in its own process. This pattern discusses Web Service implementations that must, and often should, communicate to other processes for their implementation behavior. Faux Implementation: One of the most fascinating pieces of the Internet is the ability of someone or something to be able to pretend to be something they are not and actually get away with it. As long as an interface and the behavior of a service implementation is what others expect, there is no way to tell what drives the behavior of the service implementation. The Observer and Publish/Subscribe patterns require clients to implement a Web Service to receive event publications. The Faux Implementation pattern shows that as long as the behavior fulfills the contract, there is no reason you have to implement a service with traditional mechanisms Service Factory: Class factories are common in Java programming. A class factory gives a mechanism to bind to a class implementation at runtime rather than compile time. The same capability is possible with service implementations. For example, there is no reason that a company must use a single package shipper for all shipments. Instead, the service factory illustrates how your application can determine what service to use at runtime. Data Transfer Object: The Data Transfer Object pattern originated with Java 2 Enterprise Edition (J2EE) patterns. When you move from a single process application to a distributed application, calls between participants in the distributed architecture become more expensive in terms of performance. By giving clients mechanisms to get groups of commonly accessed data in single operations, you can streamline clients and lower the number of accesses necessary to your Web Service. Partial Population: The Data Transfer Object pattern passes fully populated data structures between programs. This is a great paradigm but creates a proliferation of data structures and relegates the service implementation to determining what the most likely groups of accessed data will be. Partial population takes a different approach to data transfers; it allows clients to tell the server what parts of a data structure to populate. In this way, you can lighten the burden on the communication mechanism as well as the query in the server object. This technique is especially useful for services that contain complex, nested data structures (not something you will typically find in a Web Service environment).
SOA is such a buzzword since late 2006 ,that it made me sit up and realize its virtue & importance in Enterprise application development.And having been involved with SOA for a while now,like implementing couple of applications,somewhere down the line I was thinking about how best I can test my SOA application put together in enterprise integration.And as expected by Gartner that by mid 2009 ,nearly 80% of the enterprises development and integration budgets & effort will be devoted to SOA applications alone,that doubled my efforts to get to know about some products and tools for effectively(both unit & integration) testing my SOA applications suite,be it the front end,services layer ,message exchange(ESB layer) and database ,thats when I came across "LISA",the product I would like to share with everyone and give a brief overview.
iTKO LISA,The LISA 4 Complete SOA Test Platform is a comprehensive testing solution that reduces the effort and cost of SOA test creation and maintenance, while allowing your team to drastically improve quality levels over time through test reuse.LISA will carry developers, QA teams and business analysts from unit testing, to regressions, functional testing, end-to-end integration, load testing, and monitoring after deployment.LISA is a complete no-code software testing solution that supports the entire team's development lifecycle for dynamic web apps, web services, ESB messaging layers, enterprise Java, .NET, data and legacy objects, and more.
Why you need LISA?
To deliver quality SOA applications, enterprises need to achieve Complete, Collaborative, and Continuous TM SOA testing (The "Three C's"):
Complete testing of business workflows across every heterogeneous technology layer of the SOA, at both a system and component level.
Collaborative involvement of the whole team in quality. Enable both developers and non-programmers to define and share test cases that prove how the SOA meets business requirements during the entire application lifecycle.
Continuous validation of a changing SOA deployment as it is consumed at runtime, ensuring that business requirements will continue to be met as the system dynamically changes.
LISA was built to specifically meet the above criteria.
Continuous testing at every phase. LISA can be used to automate unit and functional tests early in development, then leverage the same tests in regression builds, load tests and performance monitors that run over time. In addition to typical test data such as pass/fail or response times, LISA gives you real functional validation every time you test. So LISA gives you "black box" testing, "white box" testing, and every color "box" in between.
Every technology. LISA tests web applications, but can go way beyond "screen deep" in validating whether or not they are working as planned. In the same test case as your web apps, you automatically gain the protocols to directly instrument web services, messaging layers, databases, J2EE servers and more, without coding. And LISA's extensibility to test your custom apps is second to none.
At any scale. LISA supports incredibly complex, multidimensional test workflows with drastically reduced effort and very low system overhead. Using LISA Load/Performance Server, you can schedule your tests to automatically run at any time interval, or trigger them with any system event. And LISA's efficient load engines can simulate hundreds, or 100s of thousands of users, with full functional validation and reporting of every transaction.
There are three different versions of LISA,here is an overview of each of them 1)LISA Enterprise Edition SOA Testing -This edition provides provides a test client to directly invoke and verify business requirements at the service component level, at the integration layer, and across the entire workflow that makes up a business process.Using this,you can do functional testing of your web user interfaces and the data residing below the UI.And it does provide support for ensuring interoperability, predictable project delivery and end-to-end quality for all major integration platforms, including IBM MQ-Series, TIBCO, webMethods, Oracle FUSION, Sun JCAPS, Sonic MQ, Fiorano and other leading providers along with Business Process validation. 2)LISA Server-LISA Server automates and schedules LISA test cases and suites, providing sophisticated staging, user simulation and continuous build and performance test orchestration capabilities for a constantly evolving SOA application environment.LISA allows for testing individual components, process, and workflows during design and development, during integration, and in deployment. Capability for Individual functional tests and system-wide business processes load testing. 3)LISA Extension Kit(LEK)-Many complex enterprise applications, even those that are based on open standards, are built within a custom framework or developed on non-supported platforms that LISA does not yet know about. Using LEK allows LISA users to test custom systems just as natively - without writing test code - as the existing technologies that LISA tests out of the box.
And coming to the benefits ,LISA provide in SOA testing,here is the brief synopsis.
SOA Platform Support enhancements provided by LISA include:
ESB Native Integrations: When you need to test an ESB, you should to be able to test every aspect of your integration layer - and LISA natively tests against every access point of ESB systems in ways that no other solution can, whether those are JMS messages, Web Services running on the bus, or connection databases. LISA provides out-of-the-box support for IBM MQ-Series, TIBCO, webMethods, Oracle FUSION, BEA AquaLogic, Sun JCAPS, Sonic MQ, Fiorano and other leading ESB/integration providers.
Governance Platform support: LISA tests provide an excellent way to check in SOA Tests as enforceable and verifiable SOA Policy example alongside services in the repository. Leading enterprise and public sector customers are using LISA as a quality certification platform to ensure trust across multiple services, and the divisions and teams that build, support, and leverage them. LISA supports both the process of Publishing services to a larger community with verifiable service levels, as well as Consuming services with well-defined requirements.
Virtual Endpoint Testing & Lookup: As SOA Governance practices evolve, the Registry/Repository is becoming a system of reference for flexibly building and managing the services that inhabit a loosely coupled environment. LISA interoperates with Type 2 and 3 UDDI registries and service repositories from leading providers such as CentraSite, Infravio, Systinet, BEA/Flashline, and others, providing a way to leverage them for lookup of the most recent services during test design, and dynamic "hookup" of services during test runs through the registry.
And it does provide support for RIA(Rich Internet Applications) testing, SOAP/WSDL testing,JMS testing to name few more benefits.
Having gone through the docs and some webinars myself,I became more curious to get to know about this product and Iam in the process of evaluating this great product by iTKO and I do feel most of the SOA developers/architects should have a look at this product and see how best it reduces the bottlenecks and decrease head aches for SOA initiation.It does have user forums and lots of white papers and documentation to make you feel at home and help you out in choosing best practices ,installation guide,faqs etc
Note : LISA is a java application and runs on a JRE 1.4.2.x or 1.5.x LISA has production customers on Windows, LINUX, HPUX, AIX, Solaris and OSX
This is a step by step guide to hosting a simple Web service with Axis2 and interacting with that service using a client based on generated code.
We will be starting with a simple Java class which will be turned into a service with the necessary packaging. Then a client will be created using the code generated by the WSDL2Java code which will be used to invoke the service we created.
First we need a Web Service and an operation in that service for a client to invoke. Lets develop a Web service with an operation which will echo a string value. The simplest way to do this is with a Java class as shown below:
---------------------------------------------------------------------------------------------------------------------- /** * The service implementation class */ public class SimpleService {
/** * The echo method which will be exposed as the * echo operation of the web service */ public String echo(String value) { return value; } } ---------------------------------------------------------------------------------------------------------------------- save as - SimpleService.java ----------------------------------------------------------------------------------------------------------------------
Step 2: The service descriptor
Each Axis2 service must have a services.xml file which will inform Axis2 about the service. Following is the services.xml file contents for the SimpleService web service.
the "service" element encapsulates the information about a single service. Within the "service" element there should be a parameter specifying the service implementation Java class. The parameter is specified as a "parameter" element as shown below.
The second child element of the "service" element "operation" element describes the operation and the message receiver that is to be used for that operation. For this service we set the "name" attribute of the "operation" element to the name of the method that we wish to expose as a Web service operation. Hence we set it to "echo":
Axis2 provides a MessageReceiver based on Java reflection and the "messageReceiver" element declaring that org.apache.axis2.rpc.receivers.RPCMessageReceiver should be used.
Step 3: Packaging the service
Axis2 expects services to be packaged according to a certain format. The package must be a .jar file with the compiled Java classes and a META-INF directory which will hold the services.xml file. The jar file can be name .aar to distinguish it as an Axis2 service archive. Its important to note that the part of the file name before ".aar" is the service name.
Create a temp directory in the same location where the SimpleService.java file exists
[Linux] mkdir temp
[Windows] md temp
Now compile the SimpleService.java class and move the SimpleService.class file to the temp directory.
javac SimpleService.java -d temp/
Create a META-INF directory within the "temp" directory and copy the service.xml file into the META-INF directory.
Change directory to the "temp" directory and use the "jar" command as follows to create the service archive named SimpleService.aar.
jar cvf SimpleService.aar .
Step 4: Hosting the service
There are a number of ways to host the service that was created in the previous step. The two main methods are
* Using the SimpleHTTPServer that is available in the Axis2 distribution * Using Axis2 with Tomcat
This tutorial will use the org.apache.axis2.transport.http.SimpleHTTPServer to host the SimpleService.aar
Axis2 service archives are placed in a directory named "services" in a repository directory. The structure of an example repository directory is shown below.
Now create the my-axis2-repo directory structure and copy the SimpleService.aar file into the "services" directory. This example does not require the axis2.xml to be available in the "conf" directory.
Now we have to start the SimpleHTTPserver using the above my-axis2-repo directory as the repository directory. The axis2-std-1.0-RC1-bin distribution comes with a "bin" directory which contains a Linux shell script and a Windows batch file to start the SimpleHTTPServer: http-server.sh and http-server.bat
Start the server pointing to my-axis2-repo directory:
The following output will be shown in the console:
[SimpleHTTPServer] Starting [SimpleHTTPServer] Using the Axis2 Repository /home/ruchith/Desktop/ibm-workshop/axis2-repo [SimpleHTTPServer] Listening on port 8080 [JAM] Warning: You are running under a pre-1.5 JDK. JSR175-style source annotations will not be available [SimpleHTTPServer] Started
Now when we point a browser to http://localhost:8080/ the SimpleHTTPServer will respond with a list of available services and the SimpleService will be listed there.
Step 5: Accessing the service with a generated client
Now lets use the WSDL2Java tool generate the client side stubs to interact with the service.
[Linux] $ sh WSDL2Java.sh -uri http://localhost:8080/axis2/services/SimpleService?wsdl -o /path/to/my/client/code/
This generates two .java files and we will be using the org.apache.axis2.SimpleServiceStub to invoke the "echo" operation of the service.
Now lets create a new Client.java class which uses the org.apache.axis2.SimpleServiceStub. For simplicity lets create the Client.java file in the same package as the generated code (i.e. org.apache.axis) and save it along with the other generated code.
public static void main(String[] args) throws Exception { SimpleServiceStub stub = new SimpleServiceStub();
//Create the request EchoRequest request = new SimpleServiceStub.EchoRequest(); request.setParam0("Hello world");
//Invoke the service EchoResponse response = stub.echo(request);
System.out.println(response.get_return()); }
} ---------------------------------------------------------------------------------------------------------------------- save as - Client.java ----------------------------------------------------------------------------------------------------------------------
Now to we can compile and run the client code. Its is important to note that the classpath must have all the jars in the "lib" directory of the axis2-std-1.0-RC1-bin distribution when compiling and running the client.
The following command will compile the client's source to a "temp" directory
To view the request and response SOAP messages we can use the tcpmon tool.
We can start the SimpleHTTPServer on port 9090 and make the tcpmon listen on port 8080 and forward the requests to port 9090.
Using "-p9090" as an additional argument in starting the SimpleHTTPServer we can start it on port 9090.
Example:
sh http-server.sh /path/to/my-axis2-repo -p9090
Now when we run the client once again we can view the messages.
Conclusion
This example is the most simple example one can use to start using axis2. I hope this will be a starting point for you to explore more and more about Apache Axis2. If you have any questions please feel free to mail the axis-user mailing list, with [Axis2] as the subject prefix.
Axis and XFire are competing Java web service frameworks; Axis is an Apache project and XFire is a Codehaus project.
It is difficult to compare the Axis and XFire web services frameworks for the purpose of deciding which one to adopt. Both web services frameworks have some significant challenges associated with using them, and there are good reasons to choose either one or the other. It all depends on where the emphasis is being placed when comparing them: stability, performance, or ease of use.
2 Branches Of Axis
Before comparing Axis to anything else, however, it is important to make note of the fact that there are two separate Axis frameworks: Axis 1 and Axis2. The Axis development team has shifted to Axis2 and has made it clear that while Axis1 bugs may be fixed, all enhancement and feature work is going to take place on Axis2, which is a ground-up reimplementation of the framework using a very different model.
Axis1 is a stable platform—stable to the point of ossification. It does have outstanding bugs, but there seems to be little effort on the part of the developers to correct them, or even evaluate patches contributed by non-Axis developers. Recent months have seen a drop-off even in responses to Axis1 question on the axis-users mailing list.
For this reason, it is reasonable to continue to use Axis1 for legacy applications that are already working and do not require major changes, as its very stability is an advantage there. However, in developing new applications it is probably advisable to look to Axis2, since it is under active development and it has a large, active community associated with it. Therefore it makes more sense to compare Axis2 and XFire for purposes of selecting a platform for new applications, or porting an existing legacy application to one of the current frameworks.
Comparing Axis2 and XFire
With this in mind, then, what differentiates Axis2 and XFire? Perhaps before highlighting differences we should look at the ways in which they are the same:
* Both have active user and developer communities * As of February 12, 2007, both have an almost identical number of open bugs * As of February 12, 2007, both have an almost identical quantity and distribution of Blocker, Critical, Major, Minor and Trivial bugs in their JIRAs (Axis2 JIRA, XFire JIRA)
So from this we can conclude that in terms of the number of reported bugs the two projects are pretty similar. How are they different? Axis2:
* Has more active committers * Has both Java and C/C++ implementations * Has a sponsoring company (WSO2) * Is perhaps more widely known * Has completed a major codebase change and is moving towards stability (but is not as stable as Axis1 yet) * Performance is comparable to XFire
XFire:
* Is thought to be easier to use * Has more clearly-written documentation * Is currently fairly stable * Performance is much better than Axis1 and equivalent to Axis2 in most cases
However, there is one major issue that makes Axis2 preferable over XFire at this time: On July 22, 2006, the XFire team announced that in XFire 2 they would be merging codebases with the Celtix framework and joining the Apache Software Foundation as CeltiXfire. One of the stated non-goals for this migration stated by the team is backwards compatibility with the current XFire code base—meaning that developers who write new applications using the XFire 1.x framework are going to be facing a situation similar to the one faced by Axis developers when that team dropped Axis1 and began Axis2. Since Axis2 has already completed this transition it makes sense not to adopt XFire for new projects at this time.
NOTE from XFire author: XFire services will be deployable inside CXF with little/no modification for most people. Your XML deployment descriptors and/or your usage of the XFire APIs wlil need to change though. Hoewver, the APIs in CXF are very similar to the XFire APIs. It is not a major departure for the most part!
Once the CeltiXfire migration is complete, however, and the new version of the software has had the chance to mature, this comparison needs to be revisited. See also
You develop a WebLogic Web Service, by using standard J2EE components, such as stateless session EJBs, and Java classes. Because WebLogic Web Services are based on the J2EE platform, they automatically inherit all the standard J2EE benefits, such as a simple and familiar component-based development model, scalability, support for transactions, life-cycle management, easy access to existing enterprise systems through the use of J2EE APIs (such as JDBC and JTA), and a simple and unified security model. A single WebLogic Web Service consists of one or more operations; you can implement each operation using different back-end components and SOAP message handlers. For example, an operation might be implemented with a single method of a stateless session EJB or with a combination of SOAP message handlers and a method of a stateless session EJB.
Here is what happens when a client application invokes this type of WebLogic Web Service operation:
1. The client application sends a SOAP message request to WebLogic Server over HTTP. Based on the URI in the request, WebLogic Server identifies the Web Service being invoked. 2. The Web Service reads the SOAP message request and identifies the operation that it needs to run. The operation corresponds to a method of a stateless session EJB or a Java class, to be invoked in a later step. 3. The Web Service converts the operation's parameters in the SOAP message from their XML representation to their Java representation using the appropriate deserializer class. The deserializer class is either one provided by WebLogic Server for built-in data types or a user-created one for non-built-in data types. 4. The Web Service invokes the appropriate back-end component method, passing it the Java parameters. 5. The Web Service converts the method's return value from Java to XML using the appropriate serializer class, and packages it into a SOAP message response. 6. The Web Service sends the SOAP message response back to the client application that invoked the Web Service.
Recently one of my friends put forth this question to me ? Why POJO web services does not require binding and what are the limitations of POJO web services?
I tried convincing him by giving many answers like, When you are dealing with Business web services you need some kind of contract , so you need to bind the Java objects with the XML data together and also to handle security of the data passing between systems, He didnt agree to any of my suggestions?
Then I asked him can you tell me when do you use a Java Bean vs Java class,to see whether he gets the point here,but no luck, he is a hard nut to crack.
So my question to everyone of folks interested in POJO Web Services,please provide me any answers to this question and avoid more embarrassment for me.