A Cross Platform Web Service Implementation Using SOAP
|
|
|
- Melissa Russell
- 10 years ago
- Views:
Transcription
1 A Cross Platform Web Service Implementation Using SOAP By Nan-Chao Huang Submitted in partial fulfillment of the requirements For The Degree of Master of Science in Computer and Information Science Approved by: Dr. Cheng-Yuan Hsieh Knowledge Systems Institute Skokie, IL April
2 Acknowledgements It is amazing what one little protocol can do for an individual s life. In June 2002, Dr. Hsieh asked what the Simple Object Access Protocol (SOAP) was. Never having heard of it, I went out and found the v1.1 specification and learned it. After completing my initial survey, I could not shake the feeling that SOAP was about to become something very big and important. By July 2002, I was signed up to write the thesis you now hold. Writing a thesis on new technology helps me understand how experts are created. I learned to understand the various nuances of what I can do with the protocol. Other standards may emerge to handle things the early adopters deem necessary (WSDL and UDDI emerged almost in response to SOAP s existence) and I learned those as well. I wrote this thesis during what seems to be the busiest year of my life (so far). I could not have done all this without the support and help of my family. I have to thank my wife Michelle. She gives me the strength and support to do amazing things. I also have to thank my parents, my sister Eunice and my brother Tony for helping and believing in me. I want to thank Dr. Cheng-Yuan Hsieh my thesis advisor, who has given me advice that has helped me with this thesis. As a JAVA/ASP programming expert, he has helped me to start my own project. Dr. Shi-Kuo Chang also has given me advice to improve my project. I have learned many things from both of them. Finally, I give many thanks to each one who has helped me study at KSI over this period. 2
3 Abstract SOAP's place in the web services technology stack is as a standardized packaging protocol for the messages shared by the applications. It uses Extensible Markup Language (XML) as the mechanism for information exchange. Since Web protocols are installed and are available for application by all major operating system platforms, HTTP and XML provide an already at-hand solution to the problem of how programs run under different operating systems in a network. SOAP specifies exactly how to encode an HTTP header and an XML file so that a program in one computer can call a program in another computer and pass its information. It also specifies how the called program can return a response. SOAP is XML. That is, SOAP is an application of the XML specification. It relies heavily on XML standards like XML Schema and XML Namespaces for its definition and function. XML messaging is where applications exchange information using XML documents. It provides a flexible way for applications to communicate, and forms the basis of SOAP. All SOAP messages are encoded using XML. In this thesis, web services, SOAP, WSDL and UDDI are discussed. A web service which queries stock quotes from Yahoo! Finance using SOAP under different server platforms (JAVA and ASP) is implemented and compared in this project. 3
4 Table of Contents Acknowledgements...2 Abstract...3 Table of Conents...4 List of Figures...6 Chapter 1 Introducing Web Services What are Web Services Web Service Fundamentals The Web Service Technology Stack The Peer Services Model...11 Chapter 2 Introducing SOAP SOAP and XML SOAP Messages SOAP Fault SOAP Messages Exchange Model SOAP Data Encoding SOAP Data Types SOAP Transport...23 Chapter 3 How SOAP Web Services Work Web Services Anatomy SOAP Web Services in Java with Apache SOAP SOAP Web Services In.NET...32 Chapter 4 Describing SOAP Services Describing Web Services Defining Data Types and Structures with XML Schemas Using XML Schemas in WSDL Describing the Web Service Interface Describing the Web Service Implementation Messaging Patterns...46 Chapter 5 Discovering SOAP Services The UDDI Registry The UDDI Interfaces Using UDDI to Publish Services Using UDDI to Locate Services
5 5.5 Generating UDDI from WSDL Using UDDI and WSDL Together...63 Chapter 6 The Future of Web Services The Future of Web Development The Future of SOAP The Future of WSDL The Future of UDDI...73 Chapter 7 Implementation Systems and Requirements Installation and Setup Program Input, Output and Snapshot...93 Chapter 8 Conclusion The Contenders SOAP Version 1.1 Conformance Ease of Use Stability Compatibility Summary References
6 List of Figures FIGURE 1-1 FIGURE 1-2 FIGURE 1-3 FIGURE 1-4 FIGURE 2-1 FIGURE 2-2 FIGURE 2-3 FIGURE 3-1 WEB SERVICES PROVIDE AN ABSTRACTION LAYER BETWEEN THE APPLICATION CLIENT AND THE APPLICATION CODE...9 THE WEB SERVICE TECHNOLOGY STACK...10 THE TCP/IP NETWORK MODEL...10 THE PEER WEB SERVICES MODEL SIMPLY APPLIES THE CONCEPTS OF THE WEB SERVICES ARCHITECTURE IN A PEER-TO-PEER NETWORK...13 XML MESSAGE...14 THE SOAP MESSAGE STRUCTURE...16 SOAP REQUEST MESSAGES ARE POSTED TO THE HTTP SERVER AND RESPONSE MESSAGES ARE RETURNED OVER THE SAME HTTP CONNECTION...23 THE.NET MANAGED RUNTIME
7 Chapter 1 Introducing Web Services 1.1 What are Web Services Web services (sometimes called application services) are services (usually including some combination of programming and data, but possibly including human resources as well) that are made available from a business Web server for Web users or other Web-connected programs. Providers of Web services are generally known as application service providers. Web services range from such major services as storage management and customer relationship management (CRM) down to much more limited services such as the furnishing of a stock quote and the checking of bids for an auction item. The accelerating creation and availability of these services is a major Web trend.[7] Users can access some Web services through a peer-to-peer arrangement rather than by going to a central server. Some services can communicate with other services and this exchange of procedures and data is generally enabled by a class of software known as middleware. Services previously possible only with the older standardized service known as Electronic Data Interchange (EDI) increasingly are likely to become Web services. Besides the standardization and wide availability to users and businesses of the Internet itself, Web services are also increasingly enabled by the use of the Extensible Markup Language (XML) as a means of standardizing data formats and exchanging data. XML is the foundation for the Web Services Description Language (WSDL).[21] 7
8 As Web services proliferate, concerns include the overall demands on network bandwidth and, for any particular service, the effect on performance as demands for that service rise. A number of new products have emerged that enable software developers to create or modify existing applications that can be "published" (made known and potentially accessible) as Web services.[7,19] 1.2 Web Service Fundamentals As Figure 1-1 illustrates, a web service is an interface positioned between the application code and the user of that code. It acts as an abstraction layer, separating the platform and programming-language-specific details of how the application code is actually invoked. This standardized layer means that any language that supports the web service can access the application's functionality.[7] The web services deployed on the Internet today are HTML web sites. In these, the application services-the mechanisms for publishing, managing, searching, and retrieving content-are accessed through the use of standard protocols and data formats: HTTP and HTML. Client applications (web browsers) that understand these standards can interact with the application services to perform tasks like ordering books, sending greeting cards, or reading news. 8
9 Application code Platform and language specific communication Web service Platform and language agnostic communication Application client Figure 1-1 Web services provide an abstraction layer between the application client and the application code Because of the abstraction provided by the standards-based interfaces it does not matter whether the application services are written in Java and the browser is written in C++, or the application services are deployed on a Unix box while the browser is deployed on Windows. Web services allow for cross-platform interoperability in a way that makes the platform irrelevant. Interoperability is one of the key benefits gained from implementing web services. Java and Microsoft Windows-based solutions have typically been difficult to integrate, but a web services layer between application and client can greatly remove friction. There is currently an ongoing effort within the Java community to define an exact architecture for implementing web services within the framework of the Java 2 Enterprise Edition specification. Each of the major Java technology providers (Sun, IBM, BF-A, etc.) are all working to enable their platforms for web services support. Many significant application vendors such as IBM and Microsoft have completely embraced web services. IBM for example, is integrating web services support throughout their Websphere, Tivoli, Lotus, and DB: products. And Microsoft's new.net 9
10 development platform is built around web services.[7] 1.3 The Web Service Technology Stack The web services architecture is implemented through the layering of five types of technologies, organized into layers that build upon one another. (Figure 1-2). Discovery Discovery Discription Discription Packaging Packaging Transport Transport Network Network Figure 1-2 The web service technology stack This stack is very similar to the TCP/IP network model used to describe the architecture of Internet-based applications (Figure 1-3). Application Application Transport Transport Network Network Link Link Figure 1-3 The TCP/IP network model The additional packaging, description, and discovery layers in the web services stack are the layers essential to providing Just-in-Time Integration capability and the necessary 10
11 platform-neutral programming model. [1, 16] Because each part of the web services stack addresses a separate business problem, only those pieces have to be implemented that make the most sense at any given time. When a new layer of the stack is needed, it does not have to rewrite significant chunks of the infrastructure just to support a new form of exchanging information or a new way of authenticating users. The goal is total modularization of the distributed computing environment as opposed to recreating the large monolithic solutions of more traditional distributed platforms like Java, CORBA, and COM. Modularity is particularly necessary in web services because of the rapidly evolving nature of the standards. [13] 1.4 The Peer Services Model The peer services model is a complimentary but alternative view of the web services architecture. Based on the peer-to-peer (P2P) architecture, every member of a group of peers shares a common collection of services and resources. A peer can be a person, an application, a device, or another group of peers operating as a single entity. While it may not be readily apparent, the same fundamental web services components are present as in the peer services architecture. There are both service providers and service consumers, and there are service registries. The distinction between providers and 11
12 consumers, however, is not as clear-cut as in the web services case. Depending on the type of service or resource that the peers are sharing, any individual peer can play the role of both a service provider and a service consumer. This makes the peer services model more dynamic and flexible.[19] Instant Messaging is the most widely utilized implementation of the peer services model. Every person that uses instant messaging is a peer. When receiving an invitation to chat with somebody, the role of a service provider is being played. When sending an invitation out to chat with somebody else, the role of a service consumer is being played. When logging on to the Instant Messaging Server, the server is playing the role of the service registry-that is, the Instant Messaging Server keeps track of where the players currently are and what the instant messaging capabilities are.[19] Peer services and web services emerged and evolved separately from one another, and accordingly make use of different protocols and technologies to implement their respective models. Peer web services tie the two together by unifying the technologies, the protocols, and the models into a single comprehensive big picture.[15] 12
13 Service registry Service provider Service consumer Service provider Service provider Service consumer Service registry Service consumer Service registry Figure 1-4 The peer web services model simply applies the concepts of the web services architecture in a peer-to-peer network. 13
14 Chapter 2 Introducing SOAP SOAP's place in the web services technology stack is as a standardized packaging protocol for the messages shared by the applications. The specification defines nothing more than a simple XML-based envelope for the information being transferred, and a set of rules for translating application and platform-specific data types into XML representations. SOAP's design makes it suitable for a wide variety of application messaging and integration patterns. This, for the most part, contributes to its growing popularity. [19] 2.1 SOAP and XML SOAP is XML. That is, SOAP is an application of the XML specification. It relies heavily on XML standards like XML Schema and XML Namespaces for its definition and function.[21] XML messaging is where applications exchange information using XML documents (see Figure 2-1). It provides a flexible way for applications to communicate, and forms the basis of SOAP.[19] Application XML Message Application Figure 2-1 XML Message 14
15 All SOAP messages are encoded using XML. A SOAP application SHOULD include the proper SOAP namespace on all elements and attributes defined by SOAP in messages that it generates. A SOAP application MUST be able to process SOAP namespaces in messages that it receives. It MUST discard messages that have incorrect namespaces and it MAY process SOAP messages without SOAP namespaces as though they had the correct SOAP namespaces.[21] 2.2 SOAP Messages A SOAP message consists of an envelope containing an optional header and a required body, as shown in Figure 2-2. The header contains blocks of information relevant to how the message is to be processed. This includes routing and delivery settings, authentication or authorization assertions, and transaction contexts. The body contains the actual message to be delivered and processed. Anything that can be expressed in XML syntax can go in the body of a message. 15
16 SOAP envelope SOAP header Header block Header block SOAP body Message body Figure 2-2 The SOAP message structure The XML syntax for expressing a SOAP message is based on the http: // namespace. This XML namespace identifier points to an XML Schema that defines the structure of what a SOAP message looks like. The following is a document-style SOAP with the XML. Example 2-1. A purchase order in document-style SOAP <s:envelope xmlns:s='' <s:header> <m:transaction xmlns:m=''soap-transaction'' s:mustunderstand="true"> <transactionld>1234</transactionid> </m:transaction> </s:heater> <s:body> <n:purchaseorder xmlns:n=''urn:orderservice''> <from><person>christogher Robin</person> <dept>accounting</dept></from> <to><person>pooh Bear</person> <dept>honey</dept></to> <order><quantity>1<quantity> 16
17 <item>pooh Stick</item></order> </n:purchaseorder> </s:body> </s:envelope> This example illustrates all of the core components of the SOAP Envelope specification. There is the <s:envelope>, the topmost container that comprises the SOAP message; the optional <s:header>, which contains additional blocks of information about how the body payload is to be processed; and the mandatory <s:body> element that contains the actual message to be processed.[5, 10, 19, 21] 2.3 SOAP Fault A SOAP fault is a special type of message specifically targeted at communicating information about errors that may have occurred during the processing of a SOAP message. The SOAP Fault element is used to carry error and/or status information within a SOAP message. If present, the SOAP Fault element MUST appear as a body entry and MUST NOT appear more than once within a body element. The SOAP Fault element defines the following four subelements: faultcode: The faultcode element is intended for use by software to provide an algorithmic mechanism for identifying the fault. The faultcode MUST be present in a SOAP Fault 17
18 element and the faultcode value MUST be a qualified name. SOAP defines a small set of SOAP fault codes covering basic SOAP faults. faultstring: The faultstring element is intended to provide a human readable explanation of the fault and is not intended for algorithmic processing. The faultstring element is similar to the 'Reason-Phrase' defined by HTTP. It MUST be present in a SOAP Fault element and SHOULD provide at least some information explaining the nature of the fault. faultactor: The faultactor element is intended to provide information about who caused the fault to happen within the message path. It is similar to the SOAP actor attribute but instead of indicating the destination of the header entry, it indicates the source of the fault. The value of the faultactor attribute is a URI identifying the source. Applications that do not act as the ultimate destination of the SOAP message MUST include the faultactor element in a SOAP Fault element. The ultimate destination of a message MAY use the faultactor element to indicate explicitly that it generated the fault. detail: The detail element is intended for carrying application specific error information related to the Body element. It MUST be present if the contents of the Body element could not be successfully processed. It MUST NOT be used to carry information about error 18
19 information belonging to header entries. Detailed error information belonging to header entries MUST be carried within header entries. The absence of the detail element in the Fault element indicates that the fault is not related to processing of the Body element. This can be used to distinguish whether the Body element was processed or not in case of a fault situation. All immediate child elements of the detail element are called detail entries and each detail entry is encoded as an independent element within the detail element. The encoding rules for detail entries are as follows: A detail entry is identified by its fully qualified element name, which consists of the namespace URI and the local name. Immediate child elements of the detail element MAY be namespace-qualified. [19] The SOAP encodingstyle attribute MAY be used to indicate the encoding style used for the detail entries. Other Fault subelements MAY be present, provided they are namespace-qualified. 2.4 SOAP Messages Exchange Model SOAP messages are fundamentally one-way transmissions from a sender to a receiver. SOAP messages are often combined to implement patterns such as request/response. SOAP implementations can be optimized to exploit the unique characteristics of 19
20 particular network systems. For example, the HTTP binding provides for SOAP response messages to be delivered as HTTP responses, using the same connection as the inbound request.[19] Regardless of the protocol to which SOAP is bound, messages are routed along a so-called "message path", which allows for processing at one or more intermediate nodes in addition to the ultimate destination. A SOAP application receiving a SOAP message MUST process that message by performing the following actions in the order listed below: 1. Identify all parts of the SOAP message intended for that application. 2. Verify that all mandatory parts identified in step 1 are supported by the application for this message and process them accordingly. If this is not the case then discard the message. The processor MAY ignore optional parts identified in step 1 without affecting the outcome of the processing. 3. If the SOAP application is not the ultimate destination of the message then remove all parts identified in step 1 before forwarding the message. Processing a message or a part of a message requires that the SOAP processor understands, among other things, the exchange pattern being used (one way, request/response, multicast, etc.), the role of the recipient in that pattern, the employment (if any) of RPC mechanisms, the representation or encoding of data, as well as other 20
21 semantics necessary for correct processing.[20] While attributes such as the SOAP encodingstyle attribute can be used to describe certain aspects of a message, this specification does not mandate a particular means by which the recipient makes such determinations in general. 2.5 SOAP Data Encoding The SOAP encoding style is based on a simple type system that is a generalization of the common features found in type systems in programming languages, databases and semi-structured data. A type either is a simple (scalar) type or is a compound type constructed as a composite of several parts, each with a type. This is described in more detail below. This section defines rules for serialization of a graph of typed objects. It operates on two levels. First, given a schema in any notation consistent with the type system described, a schema for an XML grammar may be constructed. Second, given a type-system schema and a particular graph of values conforming to that schema, an XML instance may be constructed. In reverse, given an XML instance produced in accordance with these rules, and given also the original schema, a copy of the original value graph may be constructed. The namespace identifier for the elements and attributes defined in this section is " The encoding samples shown assume all 21
22 namespace declarations are at a higher element level. Use of the data model and encoding style described in this section is encouraged but not required; other data models and encodings can be used in conjunction with SOAP.[20] 2.6 SOAP Data Types SOAP defines types corresponding to the following structural patterns often found in programming languages: struct: A "struct" is a compound value in which the accessor name is the only distinction among member values, and no accessor has the same name as any other. array: An "array" is a compound value in which the ordinal position serves as the only distinction among member values. SOAP also permits serialization of data that is neither a Struct nor an Array, for example data such as is found in a Directed-Labeled-Graph Data Model in which a single node has many distinct accessors, some of which occur more than once. SOAP serialization does not require that the underlying data model make an ordering distinction among accessors, but if such an order exists, the accessors MUST be encoded in that sequence.[20] 22
23 2.7 SOAP Transport As mentioned before, SOAP fits in on the web services technology stack as a standardized packaging protocol layered on top of the network and transport layers. As a packaging protocol, SOAP does not care what transport protocols are used to exchange the messages. This makes SOAP extremely flexible in how and where it is used. Because of its pervasiveness on the Internet, HTTP is by far the most common transport used to exchange SOAP messages. The SOAP specification even goes so far as to give special treatment to HTTP within the specification itself-outlining in specific detail how the semantics of the SOAP message exchange model map onto HTTP. SOAP-over-HTTP is a natural match with SOAP's RPC (request-response) conventions because HTTP is a request-response-based protocol. The SOAP request message is posted to the HTTP server with the HTTP request, and the server returns the SOAP response message in the HTTP response (see Figure 2-3). HTTP post -> SOAP request HTTP server HTTP response -> SOAP response HTTP client Figure 2-3 SOAP request messages are posted to the HTTP server and response messages are returned over the same HTTP connection 23
24 Chapter 3 How SOAP Web Services Work 3.1 Web Services Anatomy A web service consists of three components: a listener to receive the message, a proxy to take that message and translate it into an action to be carried out (such as invoking a method on a Java object), and the application code to implement that action. The listener and proxy components should be completely transparent to the application code, if properly implemented. The ideal situation in most cases is that the code does not even know it is being invoked through a web service interface, but that is not always possible, or desirable.[20] SOAP Implementations and Toolkits There is a long list of SOAP implementations available to developers. No matter which toolkit is to be used, the fundamental process of creating, deploying, and using SOAP web services is the same Handling SOAP Messages The integration of SOAP toolkits varies with the transport layer. Some implement their own HTTP servers. Some expect to be installed as part of a particular web server, so that rather than serving up a web page, the HTTP daemon hands the SOAP message to the 24
25 toolkit's proxy component, which does the work of invoking the code behind the web service (see Figure 3-1). Code HTTP Daemon SOAP Server Figure 3-1 The HTTP daemon passes the request to the SOAP proxy, which then invokes the code behind the web service Still other SOAP toolkits support a pluggable transport mechanism that allows the selection of different transport protocols by doing hardly anything more than setting a property value.[20] Whether the transport is built-in or pluggable, all SOAP toolkits provide the proxy component, which parses and interprets the SOAP message to invoke the application code. The proxy must understand how to deal with things like encoding styles, translation of native types of data into XML (and vice versa), and whether headers in the SOAP message that have the mustunderstand="true" flag set are actually understood. When the proxy component is handed a SOAP message by a listener, it must do three things: 1. Deserialize the message, if necessary, from XML into some native format suitable for passing off to the code. 25
26 2. Invoke the code. 3. Serialize the response to the message (if one exists) back into XML and hand it back to the transport listener for delivery back to the requester. Despite differences in how various SOAP implementations accomplish these tasks, all SOAP web service tools follow this same simple pattern.[13] Deploying Web Services Deploying a web service involves telling the proxy component which code to invoke when a particular type of message is received. In other words, the proxy component has to know that a message is going to be handled. Once this has happened, clients can access the server, send the message, and trigger a call to the application code. Web service tools have different deployment mechanisms. 3.2 SOAP Web Services in Java with Apache SOAP To illustrate how it is done, let's create the same Hello World web service and deploy it using the Apache SOAP tools. Apache SOAP is the Apache Software Foundation's implementation of the SOAP protocol. It is designed to run as a servlet within any Java HTTP Server. As such, it implements only the proxy part of the message handling process. 26
27 3.2.1 Installing Apache SOAP Apache SOAP can be used as both a client and provider of SOAP web services. A server-side installation of Apache SOAP involves placing some.jar files in the classpath. A web server that supports Servlets and Java Server Pages is needed, such as Apache's Tomcat ( The Apache SOAP homepage, has links to both source-only and precompiled distributions of the toolkit. Installing the precompiled binary distribution is as simple as downloading a Zip archive and extracting it into a directory. On the client side, three.jar files from the distribution (soap.jar, mail.jar, and activation.jar) must be present in the classpath. Also present must be any Java API for XML Parsing (JAXP) aware XML parser, such as Xerces Version 1.4 ( Assuming that an Apache SOAP.jar files is installed in the C:\Tomcat\soap directory, set the SOAP_LIB environment variable to C:\Tomcat\soap\lib. Adding the.jar files to the classpath then entails: set CLASSPATH = %CLASSPATH%;%SOAP_LIB%\soap.jar set CLASSPATH = %CLASSPATH%;%SOAP_LIB%\mail.jar 27
28 set CLASSPATH = %CLASSPATH%;%SOAP_LIB%\activation.jar Or, in the Unix Bourne shell (/bin/sh): CLASSPATH = $CLASSPATH;$SOAP_LIB/soap.jar CLASSPATH = $CLASSPATH;$SOAP_LIB/mail.jar CLASSPATH = $CLASSPATH;$SOAP_LIB/activation.jar The exact steps for a server installation will depend on which web application server which is being used, but the process is essentially the same. The first step is to ensure the same three.jar files are located in the application server's classpath. If the application server supports the use of web application archives (WAR files), simply use the soap.war file that ships with Apache SOAP. Apache Tomcat supports this. The Apache SOAP documentation includes detailed installation instructions for Tomcat and a number of other environments. Use the Bean Scripting Framework (BSF) to make script-based web services. The bsf.jar and js.jar (a BSF JavaScript implementation) must be included in the web application server's classpath. The vast majority of problems encountered by new Apache SOAP users are related to incorrect classpaths. If problems occurred in writing web services with Apache SOAP, be sure to start debugging by checking the classpath. Apache SOAP supports the use of pluggable providers that allow web services to be 28
29 implemented not only as Java classes, but as Enterprise Java Beans, COM Classes, and Bean Scripting Framework scripts. Full information about how to use pluggable providers is available in the documentation and not covered here. While simple in structure, deployment descriptor files must be created for every web service that is desired to be deployed. There are tools available that automate that process, but they still require the developer to walk through some type of wizard to select the Java class, the methods, and the type mappings. (A type mapping is an explicit link between a type of XML data and a Java class, and the Java classes that are used to serialize or deserialize between those types.) Once the file is created, it has to be deployed with the Apache SOAP service manager. There are two ways to do this: use the Service Manager Client or, if the XML-based Service Manager that ships with Apache SOAP is being used, modify the deployment registry directly. The first method requires executing the following command: % java org.apache.soap.server.servicemanagerclient deploy foo.xml Where hostname:port is the hostname and port that the web service is listening on. One interesting fact that should be noticed here is that the Apache Service Manager is itself a web service, and that deployment of a new service takes place by sending a SOAP 29
30 message to the server that includes the deployment descriptor. While this is handy, it is not necessarily all that secure (considering the fact that it would allow anybody to deploy and undeploy services on the web server). To disable this, set the SOAPInterfaceEnabled option in the soap.xml configuration file to false. This will prevent the ServiceManagerClient from working. The second approach will only work if the XML Configuration Manager is being used. This component allows the deployment information to be stored in an XML file. This file is located in the web-apps folder where the Apache SOAP servlet is located. The XML is nothing more than a root element that contains all of the deployment descriptors for all of the services deployed. To deploy the Hello World service, simply take the deployment descriptor written earlier and append it to this list. The next time that the SOAP servlet is started, the service manager will be reinitialized and the new service will be ready for use as follows.[3] Apache SOAP configuration file <root> <dd:service xmlns:dd=" id="urn:example1"> <dd:provider type="java" scope="application" methods="sayhello"> <dd:java class="samples.hello" static="false" /> </dd:provider> 30
31 <dd:faultlistener> org.apache.soap.server.domfaultlistener </dd:faultlistener> <dd:mappings /> </dd:service> </root> Launch the tool by typing: % java org.apache.soap.util.net.tcptunnelgui listenport tunnelhost tunnelport Listenport is the local TCP/IP port number. The tool will open and listen to requests. Tunnelhost is the address of the server (either DNS or IP address) where the traffic is to be redirected, and tunnelport is the port number at tunnelhost. For example, a Hello World service is deployed at To view the messages sent to and from that service by redirecting traffic through local TCP/IP port 8080, launch the TCPTunnelGui tool with the following parameters: % java org.apache.soap.util.net.tcptunnelgui And now direct the Hello World SOAP requests to 31
32 3.3 SOAP Web Services In.NET For web service developers working strictly on the Windows platform, Microsoft's.NET development platform offers built-in support for easily creating and deploying SOAP web services Installing.NET The first thing needed is to download and install the Microsoft.NET SDK Beta 2 from This free distribution contains everything needed to create and run any.net application, including.net Web Services. There are several prerequisites: 1. Must be running Windows 2000, Windows NT 4.0, Windows 98, or Windows Millennium Edition. 2. Must have the Microsoft Internet Explorer Version 5.01 or higher. 3. Must have the Microsoft Data Access Components (Version 2.6 or higher) installed. 4. Must have the Microsoft Internet Information Server (IIS) installed and running..net Web services can only be deployed within the IIS environment. The.NET Framework SDK installation is a fairly automatic process, with an easy-to-use installation wizard. Once installed, the Hello World service can be created.[17] 32
33 3.3.2 Introducing.NET Before getting into exactly how web services are created in.net, let's take a quick walk through the.net architecture to help put things into perspective. First and foremost,.net is a runtime environment similar to the Java Virtual Machine. Code packages, called assemblies, can be written in several.net specific versions of popular programming languages like Visual Basic, C++, C#, Perl, Python, and so on. Assemblies run within a managed, hierarchically organized runtime called the "Common Language Runtime" that deals with all of the low-level memory and system management details (see Figure 3-2). C++ C# VB NET intermediate compiler.net managed runtime Garbage collection Resource management Web services support, etc. Figure The.NET managed runtime Currently,.NET runs basically as an extension to the existing COM environment upon which the current versions of Windows are built. As such,.net can be utilized anywhere COM can be used, including within Microsoft's Internet Information Server (IIS) 33
34 environment..net web services are specific types of.net assemblies that are specially flagged for export as web services. These assemblies are either contained within or referenced from a new type of server-side script called an.asmx file. The.NET extensions to IIS recognize files ending in.asmx as web services and automatically export the functions of the referenced assemblies..net introduces a programming language called C#. Also keep in mind that.net makes it just as easy to develop in Visual Basic, C++, and other languages.[17] Invoking the Service Using SOAP Creating a SOAP client for a simple program, such as Hello World service using.net is, surprisingly, harder than creating the service itself SOAP fault from.net <?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:soap=" <soap:body> <soap:fault> <faultcode>soap:client</faultcode> <faultstring> System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: urn:example#sayhello. at System.Web.Services.Protocols.SoapServerProtocol.Initialize( ) at System.Web.Services.Protocols.ServerProtocolFactory.Create( 34
35 Type type, HttpContext context, HttpRequest request, HttpResponse response) </faultstring> <detail /> </soap:fault> </soap:body> </soap:envelope>.net requires that the HTTP SOAPAction header be used to exactly identify the operation and which service is being invoked..net requires the format of the SOAPAction header to be the service namespace, followed by a forward slash, followed by the name of the operation, or urn:example/sayhello. Notice, though, that SOAP::Lite's default is to use a pound sign (#) to separate the service namespace from the name of the operation. This was not an issue when Java services were being invoked with SOAP::Lite because Apache SOAP simply ignores the SOAPAction header altogether. To fix this problem, SOAP::Lite must explicitly know how to format the SOAPAction header. To do so, make the change to the client script.[6, 12] A SOAP request encoded by.net <SOAP-ENV:Envelope xmlns:soap-enc=" SOAP-ENV:encodingStyle=" xmlns:soap-env=" xmlns:xsi=" xmlns:xsd=" 35
36 <SOAP-ENV:Body> <namesp1:sayhello xmlns:namesp1="urn:hello"> <name xsi:type="xsd:string"> Richard </name> </namesp1:sayhello> </SOAP-ENV:Body> </SOAP-ENV:Envelope> The.NET beta also did not properly recognize that the name element is declared as part of the same namespace as its parent sayhello element. This is a standard rule of XML namespaces. Developers who are writing and using web services that may be accessed by a wide variety of SOAP implementations need to be aware that inconsistencies like this will exist between the various toolkits, so they need to be prepared to deal with them. As web services become more complex and more missions critical, it is important to have a clear understanding of how to manage these issues. Over time, the more popular SOAP implementations will be honed to a point where they will work together seamlessly, but with many of these implementations still being released as beta and sometimes alpha code status, be aware that issues will exist.[7, 12] 36
37 Chapter 4 Describing SOAP Services 4.1 Describing Web Services The introduction of web services in Chapter 1 mentioned that one of the key things that sets web services apart from other types of applications is that they can be made self-describing. What that means will be described here. Every application exposes some type of functionality; the functionality through various types of operations can be invoked. Those operations are required to provide specific pieces of information. Once the operation is complete, the application may return information back. This entire exchange must be conducted using some agreed upon protocol for packaging the information and sending it back and forth. However, most applications typically require the developer to describe how all of this is supposed to happen. The specific details of how a service is implemented become entrenched in the application. lf any changes need to be made, the application must be changed and recompiled. These applications are not very flexible. With web services, though, it is possible to allow applications to discover all of this information dynamically while the application is being run. This ability makes changes easier to accommodate and much less disruptive. The SOAP specification does not address description. The de facto standard specification used to make web services self-describing is the Web Services Description Language 37
38 (WSDL). Using WSDL, a web service can describe everything about what it does, how it does it, and how consumers of that web service can go about using it. 1. WSDL makes it easier to write and maintain services by providing a more structured approach to defining web service interfaces. 2. WSDL makes it easier to consume web services by reducing the amount of code (and potential errors) that a client application must implement. 3. WSDL makes it easier to implement changes that will be less likely to break SOAP client applications. Dynamic discovery of WSDL descriptions allows such changes to be pushed down automatically to clients using WSDL so that potentially expensive modifications to the client code do not have to be made every time a change occurs. WSDL is not perfect, however. Currently, there is no support for versioning of WSDL descriptions, so web services providers and consumers need to be aware that when significant changes to a WSDL description occur, there may very well be problems propagated down to the client. For the most part, however, WSDL descriptions should be treated in a similar manner to traditional object interfaces-where the definition of the service, once put into production, is immutable and cannot be changed. Another key point is that, for the most part, web service developers will not be required to manually create WSDL descriptions of services. Many toolkits include tools for generating WSDL automatically from existing application components. 38
39 Microsoft's.NET platform, for example, will automatically generate a WSDL description of deployed.asmx services simply by appending?wsdl to the URL of the.asmx file.[21] Keep in mind that not every web services toolkit includes WSDL support; third party add-ons may be required. IBM supplies an extension to Apache SOAP called the Web Services ToolKit that provides comprehensive WSDL support on top of Apache SOAP. Although many use SOAP without WSDL, WSDL descriptions of services make life easier for consumers of those services. 4.2 Defining Data Types and Structures with XML Schemas lnteroperability between applications on various operating system platforms and programming languages is most often hindered because one system's "integer" may not be exactly the same as another system's "integer.'' Because different operating systems and programming languages have different definitions of what particular base (or primitive) data types are not only called, but also of how they are expressed when sent out over the wire, those operating systems and programming languages cannot communicate with each other. To allow seamless cross-platform interoperability, there must be a mechanism by which the service consumer and the service provider agree to a common set of types and the 39
40 textual representation of the data stored in them. The web services description provides the framework through which the common data types may be defined. In WSDL, the primary method of defining these shared data types is the W3C's XML Schema specification. WSDL is, however, capable of using any mechanism to define data types, and may actually leverage the type definition mechanisms of existing programming languages or data interchange standards. No matter what type definition mechanism is used, both the service consumer and the service provider must agree to it or the service description is useless. That is why the authors of the WSDL specification chose to use XML Schemas-they are completely platform neutral. Interestingly, while XML Schemas are used to define the data types, the message that is actually sent does not have to be serialized as XML. For example, if a standard HTML form is used to invoke a web service, the input message will not be in syntax. The XML Schema specification itself recognizes that a schema may be used to describe data that is not serialized as an XML document instance, as evidenced by Section 2 of the XML Schema specification primer ( The purpose of a schema is to define a class of XML documents, and so the term "instance document'' is often used to describe an XML document that conforms to a particular schema. In fact, neither instances nor schemas need to exist as documents per se-they may exist as streams of bytes sent between applications, as fiends in a database 40
41 record, or as collections of XML lnfoset "Information Items." -XML Schema Part 0: Primer, Section 2. So, if the data can be expressed as XML, then XML Schemas can be used to describe the rules that define the data.[21] 4.3 Using XML Schemas in WSDL Once the data types are defined, they must be referenced within a WSDL description. Do so either by embedding the schema directly within the <wsdl:types /> element, or by importing the schema using the <wsdl: import /> element. While both approaches are valid, many WSDL-enabled tools do not yet properly support <wsdl : import />. The <wsdl :types /> method is by far the most common. Examples of both approaches are shown here. With import, the namespace that the XML Schema defines must be declared, then import the XML Schema document. This is shown in Example 4-1 Example 4-1. Using import to reference a type definition <?xml version="1.0" encoding="utf-8"?> <wsdl: definitions name="helloworlddescription" targetnamespace="urn:helloworld" Xmlns:tns="urn:HelloWorld" xmlns:types'" urn: MyDataTypes " xnlns:soap=" xmlsoap. org/wsdl/soap/" xmlns:wsdl=" <wsdl:import namespace="urn: MyDataTypes " location="telephonenumber.xsd" /> 41
42 </wsdl:definitions> 4.4 Describing the Web Service Interface Web service interfaces are generally no different from interfaces defined in object-oriented languages. There are input messages (the set of parameters passed into the operation), output messages (the set of values returned from the operation), and fault messages (the set of error conditions that may arise while the operation is being invoked). In WSDL, a web service interface is known as a port type. With this in mind, let's look again at the WSDL used earlier to describe the Hello World service. The relevant parts are shown in Example 4-2. Example 4-2. Describing the Hello World service <definitions...> <wsdl: message name="sayhello_in" > <part name="name" type="xsd: string" /> </wsdl:message> <wsdl: message name="sayhello_out"> <part name="greeting" type="xsd: string" /> </wsdl:message> <wsdl :porttype name="helloworldlnterface"> <wsdl: operation name="sayhello"> <wsdl:input message="tns:sayhello_in" /> <wsdl:output message="tns:sayhello_out" /> </wsdl:operation> </wsdl:porttype> </definitions> The porttype element defines the interface to the Hello World service. This interface 42
43 consists of a single operation that has both an input and an expected output. The input is a message of type sayhello_in, consisting of a single part called name of type string. WSDL porttypes do not support inheritance. It would be nice to be able to do something along the lines of Example 4-3, but it is not supported yet. Example 4-3. Attempting inheritance with WSDL <wsdl:definitions> <wsdl:porttype name="helloworldinterface"> <wsdl:operation name="sayhello" /> </wsdl:porttype> <wsdl:porttype name="helloworldinterfaceex" extends="helloworldinterface"> <wsdl:operation name="saygoodbye" /> </wsdl:porttype> </wsdl:definitions> The goal would be to have SayHelloInterfaceEx inherit the sayhello operation defined in HelloWorldInterface. 4.5 Describing the Web Service Implementation WSDL can also describe the implementation of a given port type. This description is generally divided into two parts: the binding, which describes how an interface is bound to specific transport and messaging protocols (such as SOAP and HTTP), and the service, which describes the specific network location (or locations) where an interface has been implemented.[10,19] Binding Web Service Interfaces 43
44 Just as in Java, COM, or any object-oriented language, interfaces must be implemented in order to be useful. In WSDL, the word for implementation is binding: the interfaces are bound to specific network and messaging protocols. In WSDL, this is represented by the binding element, shown in Example 4-4. Example 4-4. Binding an interface to specific protocols <wsdl: binding name="helloworldbinding" type="tns:helloworldlnterface"> <soap:binding style="rpc" transport=" <wsdl: operation name="sayhello" > <soap:operation soapaction="urn:hello" /> <wsdl:input> <soap:body use="encoded" namespace="..." encodingstyle="..." /> </wsdl:input> <wsdl:output > <soap:body use="encoded" namespace="..." encodingstyle="..." /> </wsdl:output> </wsdl:operation> </wsdl:binding> This creates a new binding definition, representing a SOAP-over-HTTP implementation of the HelloWorldInterface port type. A SOAP-aware web services platform would use this information and the information contained in the port type and data type definitions to construct the appropriate SOAP envelopes for each operation.[21] 44
45 4.5.2 Describing the Location of a Web Service The final piece of information that a WSDL service implementation description must provide is the network location where the web service is implemented. This is done by linking a specific protocol binding to a specific network address in the WSDL service and port elements, as shown in Example 4-5. Example 4-5. Linking a binding to a network address <wsdl: service name="helloworldservice"> <wsdl:port name="helloworldport" binding="tns:helloworldbinding"> <soap:address location=" /> </wsdl:port> </wsdl:service> In this example, the Hello World service can be invoked through the use of SOAP messages, as defined by the HelloWorldBinding implemented at One interesting aspect of WSDL is that a service may define multiple ports, each of which may implement a different binding at a different network location. It is possible, for example, to create a single WSDL service description for our three HelloWorld services written in Perl, Java, and.net, as shown in Example 4-6. Example 4-6. Multiple instances of the same server <wsdl: service name="helloworldservice"> <wsdl:port name="helloworldport_perl" binding="tns:helloworldbinding "> <soap:address location=" /> 45
46 </wsdl:port> <wsdl:port name="helloworldport_]ava" bindings "tns:helloworldbinding"> <soap:address location=" /> </wsdl:port> <wsdl:port name="helloworldport_net" binding="tns: HelloWorldBinding" > <soap:address location==" /> </wsdl:port> </wsdl:service> At this point the WSDL has described everything that a service consumer needs to know in order to invoke the HelloWorld web service.[21] 4.6 Messaging Patterns A messaging pattern describes the sequence of messages exchanged between the service consumer and the service provider. The web services architecture supports two fundamental types of message patterns: single-message exchange and multiple-message exchange. The definition of each pattern is based on whether the service provider or the service consumer is the first to initiate the exchange of messages, and whether there is an expected response to that initial message. Understanding these messaging patterns is an essential part of understanding how to build effective and useful web services.[13, 21] 46
47 Chapter 5 Discovering SOAP Services Once a WSDL description of a web service has been created, a service consumer must be able to locate it in order to be able to use it. This is known as discovery, the topic of this chapter. In particular, Universal Description, Discovery, and Integration (UDDI) project and the new Web Services Inspection Language will be discussed later on. WSDL provides a service consumer with all the information they need to interact with a service provider. But how can a consumer learn of which services to use? The UDDI project is an industry effort to define a searchable registry of services and their descriptions so that consumers can automatically find the services they need. UDDI has two parts: a registry of all a web service's metadata (including a pointer to the WSDL description of a service), and a set of WSDL port type definitions for manipulating and searching that registry. The latest UDDI specification is Version 2.0. In this thesis, however, Version 1.0 is the point. Version 2.0 has not yet been widely implemented and there is very little support available for it.[13, 21] UDDI is not the only option for service discovery. IBM and Microsoft have recently announced the Web Services Inspection Language (WS-lnspection), an XML-based language that provides an index of all the web services at a given web location. The first part of this chapter will focus primarily on UDDI. The last half will briefly 47
48 introduce WS-lnspection and demonstrate its role in Service Discovery. 5.1 The UDDI Registry The UDDI registry allows a business to publicly list a description of itself and the services it provides. Potential consumers of those services can locate them based on taxonomical information, such as what the service does or what industry the service targets. The registry itself is defined as a hierarchy of business, service, and binding descriptions expressed in XML. Business Entity The business entity structure represents the provider of web services. Within the UDDI registry, this structure contains information about the company itself, including contact information, industry categories, business identifiers, and a list of services provided.[3] Business Services The business service structure represents an individual web service provided by the business entity. Its description includes information on how to bind to the web service, what type of web service it is, and what taxonomical categories it belongs to. Notice the use of the Universally Unique Identifiers (UUIDs) in the businesskey and servicekey attributes. Every business entity and business service is uniquely identified in 48
49 all UDDI registries through the UUID assigned by the registry when the information is first entered. Binding templates are the technical descriptions of the web services represented by the business service structure. A single business service may have multiple binding templates. The binding template represents the actual implementation of the web service (it is roughly equivalent to the service element seen in WSDL). Because a business service may have multiple binding templates, the service may specify different implementations of the same service, each bound to a different set of protocols or a different network address Private UDDI Registries As an alternative to using the public federated network of UDDI registries available on the Internet, companies or industry groups may choose to implement their own private UDDI registries. These exclusive services would be designed for the sole purpose of allowing members of the company or of the industry group to share and advertise services amongst themselves. The key to this, however, is that whether the UDDI registry is part of the global federated network or a privately owned and operated registry, the one thing that ties it all together is a common web services API for publishing and locating businesses and services 49
50 advertised within the UDDI registry. 5.2 The UDDI Interfaces A registry is no use without some way to access it. The UDDI standard specifies two SOAP interfaces for service consumers and service providers to interact with the registry. Service consumers use InquireSOAP to find a service, and service providers use PublishSOAP to list a service. These services are described with WSDL. The following explanation of the SOAP APIs refers to the WSDL, but abbreviates some of the repetitive parts. The full WSDL specification of the UDDI API is given in [13,21]. The core of the UDDI interfaces is the UDDI XML Schema definitions. These define the fundamental UDDI data types, for instance, the businessdetail, which communicates detailed information about registered business entities. The UDDI XML Schema must be imported into the WSDL description from its network location at as shown in Example 5-1. Example 5-1. Importing the WSDL description < import namespace="urn:uddi-org:api" locatlon="http: //MWW. uddi.org/scheiiia/200l/uddi_vl.xsd"/> The Publisher Interface The Publisher interface defines sixteen operations for a service provider managing its 50
51 entries in the UDDI registry: get_authtoken Retrieves an authorization token. It works exactly like the authorization token used in the Publisher example. All of the Publisher interface operations require that a valid authorization token be submitted with the request. discard_authtoken Tells the UDDI registry to no longer accept a given authorization token. This step is equivalent to logging out of the system. save_business Creates or updates a business entity's information contained in the UDDI registry. save_service Creates or updates information about the web services that a business entity provides. save_binding Creates or updates the technical information about a web service's implementation. save_tmodel Creates or updates the registration of abstract concepts managed by the UDDI registry. delete_business Removes the given business entities from the UDDI registry completely. delete_service 51
52 Removes the given web services from the UDDI registry completely. delete_binding Removes the given web service technical details from the UDDI registry. delete_tmodel Removes the specified THodels from the UDDI registry. get_registeredlnfo Returns a summary of everything the UDDI registry is currently keeping track of for the user, including all businesses, all services, and all TModels. In the WSDL, these methods correspond to messages based on the underlying UDDI data types, as in Example 5-2 Example 5-2. UDDI method definition message name="bindingdetail"> <part name="body" element="uddi: bindingdetail" /> </message> <message name="businessdetail"> <part name="body" element="uddi: businessdetail" /> </message> The other standard messages are similarly defined. Finally, define the port type itself, creating the interface through which modifications can be made to the UDDI registry. Again, only a few definitions have been shown in full 52
53 detail in Example 5-3, as they all follow the same pattern. Example 5-3. Representative Publisher operation definitions <porttype name="publishsoap"> <operation name="delete_binding"> <input message="tns:delete_binding" /> <output message="tns:dispositionreport" /> <fault name="error" message="tns:dispositionreport" /> </operation> <operation name="delete_business"> <input message="tns:delete:e_business" /> <output message="tns:dispositionreport" /> <fault name="error" message= "tns: dispositionreport" /> </operation> <operation name="delete_service"> <input inessage="tns:delete_service" /> <output message="tns:dispositionreport" /> <fault name="error" inessage="tns:dispositionreport" /> </operation> <operation nanie="delete_tmodel">... <operation name="discard_authtoken">... <operation name="get_authtoken">... <operation name="get_registeredlnfo">... <operation name="save_binding">... <operation name="save_business">... <operation name="save_service">... <operation name="save_tmodel">... <operation name="validate_categorization">... </porttype> </definitions> The Inquiry Interface 53
54 The inquiry interface defines ten operations for searching the UDDI registry and retrieving details about specific registrations: find_binding Returns a list of web services that match a particular set of criteria based on the technical binding information. find_business Returns a list of business entities that match a particular set of criteria. find_ltservice Returns a list of web services that match a particular set of criteria. find_tmodel Returns a list of TModels that match a particular set of criteria. get_bindingdetail Returns the complete registration information for a particular web service binding template. get_businessdetail Returns the registration information for a business entity, including all services that entity provides. get_businessdetailext Returns the complete registration information for a business entity. 54
55 get_servicedetail Returns the complete registration information for a web service. get_tmodeldetail Returns the complete registration information for a TModel. InquireSOAP defines the web service interface for searching the UDDI registry. Example 5-4 shows the method definitions for find_binding, find_business, and find_service. Example 5-4 InquireSOAP <porttype name="lnquiresoap"> operation name="find_binding"> <input message="tns:find_binding" /> <output message="tns:bindingdetail" /> <fault name="error" message="tns:dispositionreport" /> </operation> <operation name=="find_business"> <input message="tns:find_business" /> <output message="tns:businesslist" /> <fault name="error" message= "tns :dispositionreport" /> </operation> <operation name="find_service"> <input message="tns:find_service" /> <output message="tns:servicelist" /> <fault name="error" message="tns :dispositionreport" /> </operation> 55
56 The message definitions are as straightforward as in the Publisher interface. Example 5-5 shows the first three. Consult Appendix C for the full list. Example 5-5. Inquiry message definitions <message name="authtoken"> <part name="body" element="uddi:authtoken" /> </message> <itiessage name="bindingdetail"> <part name="body" element=" uddi:bindingdetail" /> </message> <message name="businessdetail"> <part naame="body" element= "uddi:businessdetail" /> </message> 5.3 Using UDDI to Publish Services There are several toolkits, both open and closed source, that provide an implementation of the UDDI Publish and Inquiry interfaces. Use an open source package from IBM called UDDI4J (UDDI for Java). This package can be downloaded from The steps for using UDDI4J to publish web services are: 1. Register the service provider as a UDDI business entity. 2. Specify the categories and identifiers that apply to the business entity entry. 3. Register the web service as a UDDI business service. 56
57 4. Specify the categories that apply to the business service entry, 5. Register the implementation details of the web service, including the network location where the service is deployed. The UDDI data model facilitates all these steps in a single operation.[20] Registration Program UDDI4J through a proxy object is used, which handles the underlying SOAP encoding and decoding. The proxy to the UDDI registry should be initialized as shown in Example 5-6 Example 5-6.Initializing the UDDI Proxy UDDIProxy proxy = new UDDIProxy(); proxy.setpublishurl(" UDDI4J defines classes for the UDDI data types. They have straightforward accessors, so the business entity record is prepared as in Example 5-7 Example 5-7. Specifying the business entity BusinessEntity business = new BusinessEntity(); business.setname("richard Huang's"); The categories and identifiers can be specified for this business entity. In Example 5-8, A North American Industry Classification System (NAICS) category code of is used. 57
58 Example 5-8. Specifying categories and identifiers for the business entity CategoryBag cbag = new CategoryBag(); KeyedReference cat = new KeyedReference(); cat.setthodelkey("uuid:cob9fel3-179f-413d-8a5b-5004db8e5bb2"); cat.setkeyname("naics"); cat.setkeyvalue("11194"); cbag.getkeyedreferencevector().add(cat); business.setcategorybag(cbag); In Example 5-9, the identifiers for the business entity are prepared. A Dun and Bradstreet number is specified to be used to identify the business entity. Because more than one identifier for a business can be had, UDDI4J defines an IdentifierBag class that holds the individual identifiers. Example 5-9. Business entity identifiers IdentifierBag ibag = new IdentifierBagO; KeyedRe-ference id = new KeyedReference(); id.settmodelkey("uuid:8609c8le-eelf-4d5a-b202-3eb13adol823"); id.setkeyname("d-u-n-s"); id.setkeyvalue(" "); ibag.getkeyedreferencevector().add(id); business.setidentifierbag(ibag); Prepare the business service record as in Example 5-10 Example Initializing the business service record BusinessServices services = new BusinessServices(); BusinessService service = new BusinessService(); service.setname("hello World Service"); services. getbusinessservicevector().add(service); business. setbusinessservices(services); 58
59 Example 5-11 shows the initialization of the binding templates. The binding template specifies the protocols implemented by a service and the network location. It is the UDDI equivalent to the WSDL binding and service port definition. Example Initializing the binding templates bindingtemplates bindings = new BindingTemplates(); bindingtemplate binding = new BindingTemplate(); accesspoint accesspoint = new AccessPoint(); accesspoint.settext(" ); accesspoint.seturltype("http"); binding.setaccesspoint(accesspoint); bindings.getbindingtemplatevector().add(binding); service.setbindingteinplates(bindings); Example 5-12 logs onto the UDDI registry and registers the business entity. Example Registering the business entity AuthToken token = proxy.get_authtoken("richard","huang"); Vector businesses = new Vector(); businesses.add(business); proxy.save_business(token.getauthlnfo().gettext(), businesses); How to Register Two things are needed before using the registration program: 1. A valid user account with the UDDI registry chosen must exist. Acquire one by registering through the HTML-form interface provided by the specific UDDI registry 59
60 provider. 2. An Apache SOAP Version 2.1 or higher in Java classpath (UDDI4J uses Apache SOAP). To meet this requirement, make sure that soap.jar, mail.jar, and activation.jar are all in the classpath. There are three common situations that cause an error when registering a service: 1. A company may already exist with the specified name. 2. There may be some problem with the information defined. 3. The proper permissions to perform the requested action might not exist. The SOAP Envelope for the Registration The SOAP envelope sent to the UDDI registry includes all of the registration information for the business entity, as seen in Example Example SOAP envelope for the registration <SOAP-ENV: Envelope xmlns:soap-env=" xmlns:xsi=" xmlns:xsd=" <SOAP-ENV:Body> <save_business generic="1.0" xmlns="urn:uddi-org:api"> <authlnfo>test</authlnfo> <businessentity> <name>richard Huang's</name> <businessservices> <businessservice> <name>hello World Service</name> <bindingtemplates> <bindingtemplate> <accesspoint 60
61 urltype="http"> </bindingtemplate> </bindingtemplates> </businessservice> </businessservices> <identifierbag> <keyedreference keyname="d-u-n-s" keyvallie="l " TModelKey="UUID:8609C8lE-EElF-4D5A-B202-3EBl3ADOl823"/> </identifierbag> <categorybag> <keyedre-ference keyname="naics" keyvalue= 11194" THodelKey="UUID:COB9FE13-179F-413D-8A5B-5004DB8E5BB2"/> </categorybag> </businessentity> </save_business> </SOAP-ENV:Body> </SOAP-ENV: Envelope 5.4 Using UDDI to Locate Services UDD14J can also be used to locate services that have been published within a UDDI registry. The process involves the use of several find operations such as find_ business, find_service, and find_binding. FindQualifiers modifies the search operations by indicating whether case-sensitive searching is required, whether the results should be sorted ascending or descending, and whether exact name matching is required. The last argument in all of the find operations is the maximum number of results to return. Passing in the number zero indicates that all matching results should be returned. Example 5-14 sets up FindQualifiers to look for the 61
62 IBM business.[20] Example FindQualifiers to look for IBM FindQualifiers fqs = new FindQualifiers(); FindQualifier fq = new FindQualifier(); fq.settext ( FindQualifier.sortByNameAsc); BusinessList list = proxy.find_business("ibm", fqs, 0); Matching business entities are returned along with a listing of the services offered. The listing includes the name and unique identifier of the service. Use the UUID to drill down and get more information about the service, as in Example Example Fetching more information about the service Businessinfos infos = list.getbusinesslnfos(); for (Iterator i = infos.getbusinesslnfovector().iterator(); i.hasnext();) { Businessinfo info = (Businesslnfo)i.next(); System.out.println("Business name: " + info.getname())) for (Iterator j = info. getservicelnfos().getservicelnfovector().iterator(); j.hasnext();) { Serviceinfo sinfo = (Servicelnfo)j.next(); System.out.println("\tService name: " + sinfo.getname()); } } To retrieve more specific information about a given service, use the get_servicedetail operation and pass in the unique identifier of the service that is being requested: ServiceDetail detail = proxy.get_servicedetail(servicekey); Using the information contained in the service detail, a client can connect to and invoke 62
63 the web service. 5.5 Generating UDDI from WSDL Because there are some variances and overlapping in how WSDL and UDDI support the description of web services, the industry coalition that is driving UDDI has released a document describing the best practices to follow when using UDDI and WSDL together to enable dynamic discovery of web service descriptions. It basically defines how to use a WSDL description to generate the UDDI registration for a service. First, divide the WSDL description into two parts (two separate WSDL files). The first file becomes the interface description. It includes the data types, messages, port types, and bindings. The second file is known as the implementation description. It includes only the service definition. The implementation description imports the interface description using the <wsdl: import /> mechanism.[21] 5.6 Using UDDI and WSDL Together By following these guidelines, WSDL and UDDI can be made to work very well together. Once the WSDL-defined web service is published into a UDDI registry, it is possible to build highly dynamic service proxies. The IBM Web Services ToolKit, for example, provides built-in support for locating services in UDDI and invoking those services 63
64 through a dynamically configured WSDL-based proxy. To show more of what is going on behind use UDDI4J and WSIF together to implement the same type of functionality. The steps are simple: 1. Locate the Hello World service in the UDDI registry. 2. Access the WSDL description for the Hello World service. 3. Invoke the Hello World service. All this is done on the client side. Nothing has to be done on the server for this to work. First, write the code to locate the Hello World service in UDDI. Example 5-16 searches with FindQualifiers and takes the first result offered by the UDDI server. Example Locating a Hello World service UDDIProxy proxy s new UDDIProxy(); FindQualifiers fq = new FindQualifiers(); ServiceList list = proxy.find_service(businesskey, "HelloWorldService") fq, 0); Serviceinfos infos = list.getserviceinfos(); Serviceinfo info = (ServiceInfo)infos.getServiceInfoVector().elementAt(0); String servicekey = info.getservicekey(); With the unique identifier of the matching service, Example 5-17 goes to the UDDI registry to retrieve the business service. The binding template for that service then identifies the implementation to use. Example Locating an implementation ServiceDetail detail = proxy.get_servicedetail(servicekey); 64
65 BusinessService service = (BusinessService)detail.getBusinessServiceVector().elementAt(0); BindingTemplate template = (BindingTemplate)service. getbindingtemplates().getbindingtemplatevector().elementat(0); TModellnstanceDetails details = template. gettmodellnstancedetails(); THodellnstanceInfo instance = details.gettmodellnstancelnfovector().elementat(0); InstanceDetails instancedetails = instance.getlnstancedetails(); OverviewDoc odoc = instancedetails.getoverviewdoc(); String wsdlpath = odoc.getoverviewurlstring(); WSDL in hand, Example 5-18 uses WSIF to invoke the web service. Example Invoking the web service with WSIF Definition def = WSIFUtils.readWSDL(null, wsdlpath); Service service = WSIFUtils.selectService(def, null) "HelloWorldService"); PortType porttype = WSIFUtils.selectPortType(def, null, "HelloWorldInterface"); WSIFDynamicPortFactory dpf = new HSIFDynamicPortFactory(def, service, porttype); WSIFPort port = dpf.getport(); Typically, message creation is done behind the scenes, out of the sight of the programmer. Example 5-19 shows this. Example Creating messages with WSIF WSlFMessage input = port.createlnputmessage(); WSlFMessage output = port.createoutputmessage(); WSlFMessage Fault = port.createfaultmessage(); Example 5-20 calls the Hello World service. Example Invoking Hello World WSlFPart namepart = new WSIF]avaPart(String.class, args[0]); input. setpart ("name", namepart); System.out.println("Calling the SOAP Server to say hello!\n"); 65
66 System.out.print("The SOAP Server says: "); port.executerequestresponseoperation("sayhello", input, output, fault); WSlFPart greetingpart = output.getpart("greeting"); String greeting = (String)greetingPart.getJavaValue(); System.out.print(greeting + "\n"); 66
67 Chapter 6 The Future of Web Services 6.1 The Future of Web Development With web services, how to find information and move it across the Web is the most important concern. Issues that used to be important, such as the programming language in which the code was written, the operating system on which the code is running, the object model on which the code is based, or the vendor of the underlying database system, do not matter that much anymore. Now that is a strong statement. Some may even say that it is too strong. Here's the reasoning. First, prior to web services, the vast majority of enterprise-scale development platforms were rather inbred. Java applications worked best with Java applications; COM applications worked best with COM applications; CORBA applications worked best with CORBA applications, and so on. To make the most of each environment, standardization and focus on the technology platform itself was needed. Java and COM can work together, but it is painful. Web services, however, opened an integration channel between Java and COM, and COM and CORBA, etc., that did not exist before. Because this channel is built with open standards that any platform can implement, a situation occurs where one can easily invoke functionality written in one programming language on one platform from any other programming language on any other platform. This allows us to look beyond 67
68 programming languages and focus on the applications themselves.[13] This point was demonstrated in the Hello World example in Chapter 3. The same type of web service with two different programming languages was created. Barring minor interoperability bugs that exist in the web services tools, switching between the two service implementations without paying attention to how they were actually written is easy. In just looking for a Hello World service somewhere out on the Internet, it would be of no importance to whether it is written in Java, Perl,.NET, or even COBOL or ADA. (There is an implementation of SOAP for ADA, by the way. And Microsoft's Visual Studio.NET will support writing assemblies with COBOL.)[12, 13] Web Services and Existing Technologies A critical insight is that web services do not replace existing technology infrastructures. Rather, they help to integrate existing technologies. In other words, if A J2EE application to talk to a COM application is needed, web services makes it easier. Web services will not completely replace that 30-year-old mainframe system in the back closet that nobody ever thinks about anymore. But web services might provide cross-platform automated access to the mainframe's applications, thus opening new channels of business.[12] 68
69 6.2 The Future of SOAP The SOAP protocol is already a couple of years old. One of the original versions became what is now called XML-RPC, a simple, popular alternative to SOAP championed by Userland Software. (Userland's CEO, Dave Winer, is one of the coauthors of the original SOAP specification.) To learn more about XML-RPC, read Programming Web Services with XML-RPC.[3, 7] XML-RPC split from SOAP in The first version of the SOAP protocol was announced in 1999, and since then there have been four revisions with a fifth now being worked on by the W3C. The two versions which were discussed in this thesis (Version 1.1 and Version 1.2) are those currently being used in production environments, even though they are not official W3C standards. In the not-too-distant future, the SOAP 1.2 working draft specification will evolve into the W3C XML Protocol Version 1.0 recommendation, which will be the first standardized version of the protocol. [13] There should not be many changes between SOAP 1.2 and XML Protocol Version 1.0, because the W3C working group has committed to using SOAP as the basis for their work and to ensuring that backwards compatibility is maintained at least on a fundamental level. Unfortunately, it is still far too early in the process to know about any differences between the XML Protocol and SOAP 1.2. [13, 21] 69
70 6.3 The Future of WSDL Like SOAP, the Web Service Description Language is not yet an official Internet standard, but it is well on the road to becoming one. It has been submitted to the W3C and a working group is being formed to manage it. Unlike SOAP, which has a fairly stable direction within the W3C, standardized WSDL may be different from the version being widely used in web services today. It is too early to know how different, or when the W3C-based standard will be released.[3, 21] Missing Pieces There are several important things missing from WSDL that will have to be addressed by the W3C working group. For example, there is no standardized mechanism for extending the WSDL description to include information about security requirements, quality of service attributes, sequencing of operations, and so on. While not a strict requirement when WSDL is used to describe simple, basic RPC-style services, such standard extensions become critical when applying web services technology to enterprise e-business scenarios.[5, 10] An Alternative to WSDL 70
71 Another key issue that the WSDL working group will need to address is the reconciliation of WSDL to other, alternative service description mechanisms, such as the DARPA Agent Markup Language (DAML) based DAML-S (S stands for "services"). DAML-S is focused on the task of building a formal semantic data model for web services. In other words, they're formalizing the language to describe web services. While DAML-S has no solid corporate backing, much of the work being done will have an impact on the future direction of WSDL standardization. The concepts involved in DAML-S are really not all that different from WSDL, but the syntax is much more complex. DAML-S is based on the Resource Description Framework (RDF) standard. This tends to make it more complex, verbose, and difficult to use than WSDL. That said, there are several lessons WSDL can learn from DAML-S: 1. DAML-S naturally supports the ability to extend service descriptions to include a wide variety of semantic and functional information such as security, quality of service, etc. 2. DAML-S naturally supports inheritance throughout the entire description. 3. DAML-S provides a rich mechanism for describing web service processes (logical sequences of operations). WSDL does not support sequencing operations at all. 4. DAML-S allows a service to implement multiple processes (the DAML-S equivalent 71
72 to a WSDL port type). 5. DAML-S supports a rich service advertisement description that provides information about who is providing the service, what the provider's capabilities are, and so on. WSDL does not include any advertisement information at all. These features of DAML-S are likely to be a part of the next generation WSDL.[7,21] Standard Extensions One key component of the success of web services will be the ability to describe not only the service itself, but also all of the services' capabilities, requirements, assumptions, and processes in a standard, consistent way. There is no way to declare the type of authentication a service supports in WSDL. For that matter, there is no way to declare that a service supports any type of authentication. How might the WSDL of the future express what type of authentication mechanism is used? One way would be to define a standard extension to the WSDL binding element. WSDL-enabled web services tools that understand the authentication extension would then know that SAML could be used for authentication. Currently, though, there are no standard extensions to WSDL, nor is there a broad industry effort to define them. This also may become part of the W3C-standardized WSDL. 72
73 6.4 The Future of UDDI Chapter 4 introduced UDDI as a web service for discovering other web services. Through the definition of a standardized registry format and port type interface, UDDI allows service providers and service consumers to dynamically discover and integrate with one another. UDDI was originally developed by Microsoft, IBM, and Ariba, and is now managed by a broad industry consortium of companies. The plan is to submit UDDI for standardization once Version 3.0 of the specification is finished (the current version is.0). One of the key requirements for future versions of UDDI is a security infrastructure that would allow service consumers to validate the identity of service providers publishing their services-allowing for a much more robust trust relationship to be established.[21] Problems with UDDI There are some problems with UDDI that will need to be addressed in future versions of the specification. Weak security is one of the most significant issues. Currently, it is possible for anybody to create an entry in a UDDI registry, pretending to be somebody else. For example, I can easily create an entry in a UDDI registry pretending to be Microsoft. Needless to say, this is not good. 73
74 Another major problem is the proliferation of "bad links" in public UDDI registries. These links point to companies or services that do not exist or are no longer available. There is a lack of understanding in companies about what UDDI is for and how it may be useful. This might hamper its adoption in future. Even among companies who understand it, there have been some doubts raised about whether public UDDI registries will be useful in the long term.[13] 74
75 Chapter 7 Implementation This implementation is able to query real-time stock quotes from Yahoo! Finance website applying SOAP services on two different programming platforms (ASP in Microsoft Windows, and JSP in Java Virtual Machine). The system requirements, installation and setup procedure are also discussed in the following. 7.1 Systems and Requirements The following are used in this thesis: a. MS Windows 2000 Professional platform. b. MS IIS 5.0 c. Apache SOAP server d. A website which affords SOAP (components) services (Yahoo! Finance service is used here). Requirements listed from the Apache SOAP Documentation.[20] a. Java 1.1 or higher, and a servlet engine supporting version 2.1 or higher of the Java Servlet API b. A JAXP compatible, namespace aware XML parser (e.g. Xerces) c. JavaMail (mail.jar) and the JavaBeans Activation Framework (activation.jar) 75
76 d. XMI encoding requires use of Java and XML4J The classpath must have xerces.jar first and then xml4j.jar next in that order. e. Implementing services in scripting languages requires the use of Bean Scripting Framework. f. SSL (HTTPS) support requires Java or later and the Java Secure g. Socket Extension h. The SMTP transport requires the SMTP and POP3 Bean Suites. 7.2 Installation and Setup Apache SOAP How to build Apache SOAP Step 1: Make sure Apache Ant is properly installed on the system. a. Download Apache Ant from b. Set ANT_HOME to the location where Ant has been installed c. On Windows platform, add %ANT_HOME%\bin to the system Path Step 2: Download mail.jar, activation.jar, xerces.jar a. mail.jar < b. activation.jar < 76
77 c. xerces.jar < Step 3: Add mail.jar, activation.jar, xerces.jar, and servlet.jar (from Tomcat) or j2ee.jar (from Sun) to the classpath. Step 4: From the xml-soap\java directory, run "ant dist". Windows Example: d:\set ANT_HOME=d:\java\ant d:\set PATH=%PATH%;%ANT_HOME%\bin d:\cd java\xml-soap\java d:\java\xml-soap\javaset CLASSPATH=%CLASSPATH%;d:\java\mail\mail.jar;d:\java\activation\activation.jar;d:\ java\xerces\xerces.jar;d:\java\tomcat\common\lib\servlet.jar;d:\java\xml-soap\javaant dist To enable optional support for BSF, POP3, SMTP, EJB, SSL, and JUnit, add the appropriate packages to the classpath prior to running Ant to build to the package. How to install Apache SOAP The Apache SOAP documentation provides all of the information needed to get Apache SOAP up and running on a variety of application servers. < 77
78 These instructions tell exactly how to set up the classpath for each server environment.[20] At runtime, the application must also be installed into the Server or SOAP classpaths. The classes must be visible to the SOAP Webapp so it is necessary to either add the application jar to the server s classpath (how to do this is specific to each application server so follow the instructions provided by the server) or add the application jar to the SOAP Web application by adding the Jar to the soap/web-inf/lib directory or adding the classes to the soap/web-inf/classes directory. Example: An Apache SOAP installed as an Apache Tomcat Webapp: d:\tomcat\webapps\soap Any specific Web service will be added to Apache SOAP by copying myapp.jar to d:\tomcat\webapps\soap\web-inf\lib and then use the Apache SOAP deployment tool to deploy the Web service (see the Apache SOAP documentation for information on how to deploy services) An alternative approach is to embed Apache SOAP into the Web application. To do so, 78
79 simply add soap.jar, mail.jar and activation.jar (plus any additional optional features that are being used) to the Web applications web-inf\lib directory and copy the soap.xml configuration file to web-inf. (soap.xml is used to configure the Apache SOAP runtime). Note: when reading through the installation instructions provided by Apache SOAP, pay special attention to the details about how to install Xerces.jar if that is the XML parser that are being used. Many Web Application Servers ship an XML parser that gets in the way of any others that may want to be used unless specific changes are made to the application server s configuration. The Apache SOAP installation instructions will go through those changes. To run Apache SOAP on the client side, it must have, at a minimum, soap.jar, mail.jar and activation.jar in the classpath. If any of the optional features are being used (e.g. BSF, XMI, POP3 etc) then it must also have the corresponding JAR files in the classpath (see the build instructions above). Step 5: Deploy the stocks.jsp, include.jsp and stylesheet.css to the webapp path. Example: d:\tomcat\webapps\root\ MS IIS 5 79
80 a. Start up Internet Information Services. Then create the virtual directory called ASPSOAP which contains these files using SOAP under the Default Web site as the following. 80
81 b. Select the ASPSOAP virtual directory, and right click to open its properties window. Choose the Configuration button from either the Virtual Directory or Home Directory tabs (depending upon whether you have created a virtual directory or a virtual site). The Application Configuration will open as shown below: 81
82 7.3 Program The Implementations Using ASP include.inc = False %> <% Sub Title(str, ctl) crlf = Chr(13) & Chr(10) Response.Write "<HEAD>" & crlf Response.Write "<TITLE>SOAP Implementation Using ASP - " & str & "</TITLE>" & crlf Response.Write "<LINK REL=stylesheet TYPE=text/css HREF=stylesheet.css>" & crlf Response.Write "</HEAD>" & crlf Response.Write "<H3>SOAP Implementation Using ASP</h1>" & crlf If ctl <> "" Then Response.Write "<h2>" & str & "</h2>" & crlf Set fs = CreateObject("Scripting.FileSystemObject") file = fs.getfilename(request.servervariables("path_translated")) Set fs = Nothing Else Response.Write "<h2>" & "Source Code For ""<A HREF=" & str & ">" & str & "</A>""" & "</h2>" End If Response.Write "<HR SIZE=1>" & crlf End Sub Function TrimQ(s) s = Trim(s) While Left(s, 1) = """": s = Mid(s, 2): Wend While Right(s, 1) = """": s = Left(s, Len(s)-1): Wend TrimQ = s End Function %> Stocks.ASP <!--#include file="include.inc" --> <% Title "Stock Data From Yahoo", "WebForm" %> 82
83 <form method=post> <p><dd>ticker Symbols: <input type=text name=ticker value="ibm INTC MSFT ORCL SUNW" size=35> <input type=submit value=" Get Data "> </form> <br> <% If Request("REQUEST_METHOD") = "POST" Then Set webform = Server.CreateObject("IPWorksASP.WebForm") webform.addformvar "s", Request.Form("ticker") webform.addformvar "e", ".csv" webform.addformvar "f", "sl1d1t1c1ohgv" webform.encoding = 2 'Query String webform.submitto " rows = Split(webform.TransferredData, Chr(10)) %> <center> <table width="90%"> <tr> <th>ticker</th> <th>last Value</th> <th>time</th> <th>open</th> <th>high</th> <th>low</th> <th>volume</th> </tr> <% For Each row In rows values = Split(row, ",") If UBound(values) >= 8 Then ticker = TrimQ(values(0)) last = values(1) qdate = TrimQ(values(2)) qtime = TrimQ(values(3)) change = values(4) open = values(5) high = values(6) low = values(7) 83
84 volume = values(8) %> <tr> <td><% =ticker %></td> <td><% =last %></td> <td><% =qtime %></td> <td><% =open %></td> <td><% =high %></td> <td><% =low %></td> <td><% =volume %></td> </tr> <% End If Next %> </table> </center> <% End If %> exchange.asp <!--#include file="include.inc" --> <% Title "Use SOAP to get Exchange Rate", "SOAP" %> <% Dim strvalue If Request("REQUEST_METHOD") = "POST" Then Set soap = Server.CreateObject("IPWorksASP.SOAP") soap.addparam "country1", Request.Form("country1") soap.addparam "country2", Request.Form("country2") soap.methoduri = "urn:xmethods-currencyexchange" soap.method = "getrate" soap.url = " soap.sendrequest strvalue = soap.returnvalue * Request.Form("exchange") Set soap = Nothing 84
85 End If %> <br> <FORM method='post'> <B>Convert: </B> <INPUT name='exchange' size=7 value=1> <SELECT name='country1'> <OPTION value='us'>us Dollars <OPTION value='taiwan'>taiwan Dollars <OPTION value='china'>chinese Yuan <OPTION value='france'>french Franc <OPTION value='england'>english Pound <OPTION value='italy'>italian Lira <OPTION value='japan'>japanese Yen <OPTION value='germany'>german Mark <OPTION value='mexico'>mexican Peso <OPTION value='brazil'>brazilian Real <OPTION value='netherlands'>dutch Guilder <OPTION value='singapor'>singapor Dollars <OPTION value='greece'>greek Drachma </SELECT> <B>into</B> <SELECT name='country2'> <OPTION value='us'>us Dollars <OPTION value='taiwan' SELECTED>Taiwan Dollars <OPTION value='china'>chinese Yuan <OPTION value='france'>french Franc <OPTION value='england'>english Pound <OPTION value='italy'>italian Lira <OPTION value='japan'>japanese Yen <OPTION value='germany'>german Mark <OPTION value='mexico'>mexican Peso <OPTION value='brazil'>brazilian Real <OPTION value='netherlands'>dutch Guilder <OPTION value='singapor'>singapor Dollars <OPTION value='greece'>greek Drachma </SELECT> <B>=</B> <INPUT name='value' size=7 value='<% =strvalue %>'> 85
86 </FORM> <INPUT type=submit value=convert> nasdaq.asp <!--#include file="include.inc" --> <% Title "Use Webform and XMLp To Retrieve Nasdaq Stock Information", "XMLp" %> <% dim strquery strquery = Request.QueryString("symbol") if strquery = "" then strquery = "MSFT" %> Displays extended stock information about the Ticker you specify: <form method="post" id=form1 name=form1> Stock Symbol: <input type="text" name="symbol" value="<% =strquery %>" size="10"> <input type="submit" value="get Stock Info"> </form> <br> <% If Request("REQUEST_METHOD") = "POST" Then Set WebForm1 = Server.CreateObject("IPWorksASP.WebForm") WebForm1.AddFormVar "page", "xml" WebForm1.AddFormVar "mode", "stock" WebForm1.AddFormVar "symbol", Request.Form("symbol") WebForm1.Encoding = 2 'Query String WebForm1.SubmitTo " Set XMLp1 = Server.CreateObject("IPWorksASP.XMLp") XMLp1.Reset XMLp1.Input WebForm1.TransferredData XMLp1.XPath = "/nasdaqamex-dot-com/[1]" Response.Write "<TABLE>" For i = 1 To XMLp1.XChildren XMLp1.XPath = "/nasdaqamex-dot-com/[1]/[" & i & "]" Response.Write "<TR><TD>" & XMLp1.XElement & "</TD>" Response.Write "<TD>" & XMLp1.XText & "</TD></TR>" Next Response.Write "</TABLE>" End If %> 86
87 <p class='small'> The Implementations Using JSP include.jsp page contenttype="text/html;charset=windows-1252"%> page session="false" %> <%! String selectoptions(string variable, String item) { return selectoptions(variable, item, item); } String selectoptions(string variable, String value, String item) { return "<option " + (variable.equalsignorecase(value)? "selected " : "") + "value=" + value + " >" + item + "</option>"; } String urlencode(stringbuffer data) { for (int i = 0; i < data.length(); i++) { if (data.charat(i) == '<') data.replace(i, i + 1, "<"); else if (data.charat(i) == '>') data.replace(i, i + 1, ">"); } return data.tostring(); } void title(jspwriter out, String str, String ctl, String file) throws java.io.ioexception { String crlf = "\r\n"; out.write("<head>" + crlf); out.write("<title>soap Implementation Using JSP - " + str + "</TITLE>" + crlf); out.write("<link REL=stylesheet TYPE=text/css HREF=stylesheet.css>" + crlf); out.write("<meta NAME=\"description\" CONTENT=\"SOAP Implementation Using JSP - " + str + "\">" + crlf); out.write("<meta NAME=\"keywords\" CONTENT=\"SOAP; " + str + "\">" + crlf); out.write("</head>" + crlf); out.write("<h3>soap Implementation Using JSP</h1>" + crlf); if(!ctl.equals("")) { out.write("<h2>" + str + "</h2>" + crlf); } else { 87
88 out.write("<h2>source Code For \"<A HREF=" + str + ">" + str + "</A>\"</h2>"); } out.write("<hr SIZE=1>" + crlf); } String trimq(string s) { s.trim(); int i; for (i = 0; i < s.length() && s.charat(i) == '"'; i++); int j = s.indexof("\"", i); return s.substring(i, j); } void trailer(jspwriter out) throws java.io.ioexception { } %> Stocks.jsp <%@ include file="include.jsp" %> <%@ page import="ipworks.*, java.util.stringtokenizer"%> <% title(out, "Stock Data From Yahoo", "WebForm", "stocks.jsp"); %> <form method=post> <p><dd>ticker Symbols: <input type=text name=ticker value="ibm INTC MSFT ORCL SUNW" size=35> <input type=submit value=" Get Data "> </form> <br> <% if (request.getmethod().equalsignorecase("post")) { Webform webform = new Webform(); webform.setguiavailable(false); webform.addformvar("s", request.getparameter("ticker")); webform.addformvar("e", ".csv"); webform.addformvar("f", "sl1d1t1c1ohgv"); webform.setencoding(webform.encquerystring); webform.submitto(" String data = new String(webform.getTransferredData()); StringTokenizer rows = new StringTokenizer(data, "\n"); %> 88
89 <center> <table width="90%"> <tr> <th>ticker</th> <th>last Value</th> <th>time</th> <th>open</th> <th>high</th> <th>low</th> <th>volume</th> </tr> <% String row, ticker, last, qdate, qtime, change, open, high, low, volume; while (rows.hasmoretokens()) { row = rows.nexttoken(); StringTokenizer values = new StringTokenizer(row, ","); if (values.counttokens() > 8) { ticker = trimq(values.nexttoken()); last = values.nexttoken(); qdate = trimq(values.nexttoken()); qtime = trimq(values.nexttoken()); change = values.nexttoken(); open = values.nexttoken(); high = values.nexttoken(); low = values.nexttoken(); volume = values.nexttoken(); %> <tr> <td><%= ticker %></td> <td><%= last %></td> <td><%= qtime %></td> <td><%= open %></td> <td><%= high %></td> <td><%= low %></td> <td><%= volume %></td> </tr> <% } } 89
90 %> </table> </center> <% } %> exchange.jsp <%@ include file="include.jsp" %> <%@ page import="ipworks.*" %> <% title(out, "Use SOAP to get Exchange Rate", "SOAP", "soap.jsp"); %> <% String strvalue = ""; String country1 = request.getparameter("country1")!= null? request.getparameter("country1") : "US"; String country2 = request.getparameter("country2")!= null? request.getparameter("country2") : "France"; if (request.getmethod().equalsignorecase("post")) { Soap soap = new Soap(); soap.setguiavailable(false);//required in environments with no UI soap.addparam("country1", country1); soap.addparam("country2", country2); soap.setmethoduri("urn:xmethods-currencyexchange"); soap.setmethod("getrate"); soap.seturl(" soap.sendrequest(); strvalue = String.valueOf(Float.parseFloat(soap.getReturnValue()) * Float.parseFloat(request.getParameter("exchange"))); } %> <br> <FORM method='post'> <B>Convert: </B> <INPUT name='exchange' size=7 value=1> <SELECT name='country1'> <%= selectoptions(country1, "US", "US Dollars") %> <%= selectoptions(country1, "China", "Chinese Yuan") %> 90
91 <%= selectoptions(country1, "France", "French Franc") %> <%= selectoptions(country1, "England", "English Pound") %> <%= selectoptions(country1, "Italy", "Italian Lira") %> <%= selectoptions(country1, "Japan", "Japanese Yen") %> <%= selectoptions(country1, "Germany", "German Mark") %> <%= selectoptions(country1, "Mexico", "Mexican Peso") %> <%= selectoptions(country1, "Brazil", "Brazilian Real") %> <%= selectoptions(country1, "Netherlands", "Dutch Guilder") %> <%= selectoptions(country1, "Singapor", "Singapor Dollars") %> <%= selectoptions(country1, "Greece", "Greek Drachma") %> <%= selectoptions(country1, "Taiwan", "Taiwan Dollars") %> </SELECT> <B>into</B> <SELECT name='country2'> <%= selectoptions(country2, "US", "US Dollars") %> <%= selectoptions(country2, "China", "Chinese Yuan") %> <%= selectoptions(country2, "France", "French Franc") %> <%= selectoptions(country2, "England", "English Pound") %> <%= selectoptions(country2, "Italy", "Italian Lira") %> <%= selectoptions(country2, "Japan", "Japanese Yen") %> <%= selectoptions(country2, "Germany", "German Mark") %> <%= selectoptions(country2, "Mexico", "Mexican Peso") %> <%= selectoptions(country2, "Brazil", "Brazilian Real") %> <%= selectoptions(country2, "Netherlands", "Dutch Guilder") %> <%= selectoptions(country2, "Singapor", "Singapor Dollars") %> <%= selectoptions(country2, "Greece", "Greek Drachma") %> <%= selectoptions(country2, "Taiwan", "Taiwan Dollars") %> </SELECT> <B>=</B> <INPUT name='value' size=7 value='<%= strvalue %>'> <INPUT type=submit value=convert> </FORM> <% trailer(out); %> nasdaq.jsp include file="include.jsp" %> 91
92 page import="ipworks.*"%> <% title(out, "Use SOAP To Retrieve Nasdaq Stock Information", "XMLp", "nasdaq.jsp"); %> <% String strquery = request.getparameter("symbol"); if (strquery == null) strquery = "SUNW"; %> Displays extended stock information about the Ticker you specify: <form method="post" id=form1 name=form1> Stock Symbol: <input type="text" name="symbol" value="<%= strquery %>" size="10"> <input type="submit" value="get Stock Info"> </form> <br> <% if (request.getmethod().equalsignorecase("post")) { Webform webform = new Webform(); webform.setguiavailable(false); webform.addformvar("page", "xml"); webform.addformvar("mode", "stock"); webform.addformvar("symbol", request.getparameter("symbol")); webform.setencoding(webform.encquerystring); webform.setmaxtransferreddata(0); webform.submitto(" Xmlp xmlp = new Xmlp(); xmlp.reset(); xmlp.input(new String(webform.getTransferredData())); xmlp.setxpath("/nasdaqamex-dot-com/[1]"); out.write("<table>"); int xchildren = xmlp.getxchildren(); for(int i = 1; i <= xchildren; i++) { xmlp.setxpath("/nasdaqamex-dot-com/[1]/[" + i + "]"); out.write("<tr><td>" + xmlp.getxelement() + "</TD>"); out.write("<td>" + xmlp.getxtext() + "</TD></TR>"); } out.write("</table>"); } %> <p class='small'> 92
93 7.4 Input, Output and Snapshot Note: Sometimes the stock quotes acquired using the implementation has some difference between the stock quotes queried from Yahoo! Finance web service directly because the SOAP component requires a short delay to generate XML formatted data A SOAP implementation using ASP to get stock data from the Yahoo Finance website providing SOAP service. a. Start up IIS 5.0 b. Enter the URL in the address field of the web browser to run the program. c. Enter the stock tickler symbols that are to be queried from Yahoo! Finance into the field Tickler Symbols. d. Click the button Get Data, then wait for a while for the PC to display the information as the following: 93
94 94
95 7.4.2 A SOAP implementation using JSP to get stock data from the Yahoo Finance website providing SOAP service. a. Start up Tomcat 4.0 There are two techniques by which Tomcat 4.0 can be started. Execute the following shell commands: Windows: cd %CATALINA_HOME%\bin startup Unix: cd $CATALINA_HOME/bin./startup.sh b. After startup, the default web applications included with Tomcat 4.0 will be available by browsing: c. Enter the URL in the address field of the web browser to run the program. d. Enter the stock tickler symbols that are to be queried from Yahoo! Finance into the field Tickler Symbols. e. Click the button Get Data, then wait for a while for the PC to display the information as the following: 95
96 96
97 7.4.3 The snapshots gotten from Yahoo! Finance to prove the data acquired were real time and the same as the implementations. a. Go on to and enter the stock tickler symbols into the field "Enter symbol(s). 97
98 b. Click the button Get to query the stock quotes information as follows: 98
99 Chapter 8 Conclusion With the recent submission of the Version 1.1 Specification of the Simple Object Access Protocol (SOAP) to the W3C, the fledgling new XML-messaging/rpc protocol has been getting a lot of attention - mostly from developers wanting to know how exactly to use it in their enterprise applications. Not wanting to disappoint, the two largest supporters of SOAP, IBM and Microsoft, have both recently released two vastly different (and unfortunately, incompatible) reference implementations of SOAP.[7] 8.1 The Contenders There are two contenders in the SOAP standard: a. IBM/Apache SOAP Project Version 1.2 (Apache XML Project Release Version) b. Microsoft SOAP Toolkit For Microsoft.Net (beta). 8.2 SOAP Version 1.1 Conformance IBM wins overall regarding SOAP Version 1.1 conformance. The areas include the formatting of the SOAP Envelope, namespace usage, data type support, and fault response structure SOAP Envelope & Namespace Usage 99
100 The SOAP specification uses XML namespaces to uniquely identify the various elements of the SOAP envelope. The IBM tools appropriately reference the proper SOAP namespaces and whereas the Microsoft tools append a " " to the end of the namespace references, causing problems with other SOAP implementations. Additionally, in the MS SOAP Envelope, the encodingstyle attribute improperly references the instead of the It is an easy fix, but one that lessens the overall quality of the code.[5] Data Type Support Both packages seem to do well when it comes to supporting the basic SOAP datatypes, although both do not handle Arrays and Structs very nicely at all. IBM scores a few additional points, however, with its facility to allow developers to specifically create type mappings between the Java datatypes and SOAP standard data types. Additionally, IBM SOAP encodes the datatypes directly into the SOAP envelope whereas the MS SOAP package relies on the External SDL file to provide type specific information. While legal according to the SOAP v1.1 specification, that is disputable. For completeness, datatype information should be passed along with the request. 100
101 For example: IBM's output: <nsl:getquote> <symbol xsd:type='xsi:string'>ibm</symbol> </nsl:getquote> Versus Microsoft's output: <getquote> <symbol>ibm</symbol> </getquote> Specific to the Microsoft implementation, when using the ASP-based SOAP listener, developers are forced to rely a great deal on the VARIANT datatype for ByRef (IN/OUT) parameters, causing the SOAP envelope to lose valuable type specific information Fault Response Structure The MS SOAP package fails miserably here. Whereas the documentation details fault responses that correlate with the version 1.1 specification, the ASP listener appears to use a limited combination of SOAP version 1.0 and version 1.1 fault codes. This turns into a big problem for Non-MS SOAP client applications trying to parse detailed error information from the SOAP server. 101
102 MS loses twice here, once for improper support, and once for invalid documentation. IBM, on the other hand, properly supports the full Version 1.1 fault code specification. To illustrate the problems with the Microsoft ASP Listener, the response looks like the following: <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:soap-env=" encodingstyle=" <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>300</faultcode> <faultstring>nothing was posted</faultstring> <faultactor>300</faultactor> <detail>nothing was posted</detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Notice the faultcode which uses a SOAP Version 1.0 value; and the faultactor which, according to the SOAP v1.1 spec, if used at all, should be set equal to the URI of the listener where the error occurred.[2, 9] 8.3 Ease of Use Microsoft wins for overall ease of use. The areas include ease of installation, implementation code complexity, and debugging. 102
103 8.3.1 Installation The CLASSPATH architecture for locating Java packages, and much prefered GUI based tools for installing applications has to be set. That being said, the "installation" procedures for both packages are equal. Once all of the classpath information were appropriately added to the Apache Jakarta Tomcat webserver, then it can be restarted to run. The IBM web-based SOAP web service deployment tool is nice, if not stylish. The server also comes with a java command line tool for deploying new services which also happens to use SOAP. On the Microsoft side of things, the installation was a tad easier: 1. Register the Rope.dll (the component containing all of the SOAP implementation code). 2. Create a SOAP virtual directory. 3. Run the SDL wizard to generate the server code. The client side of the installation tells the same story. For IBM, make sure the SOAP classes are in the classpath. For Microsoft, register the Rope.dll and it is all set to run Implementation Code Microsoft definitely wins here with its Proxy component. Whereas the IBM "SOAP for Java" package requires hand coding of the SOAP envelope package, the Microsoft Proxy 103
104 component whittles down the process so that all of the SOAP envelope construction is occuring behind the scenes -- effectively reducing the amount of code a developer has to write for most processes down to 3 lines of code: 1. Dim Proxy As New Proxy 2. Proxy.LoadServiceDescription Proxy.SomeMethod Param1, Param2,... The downside of the proxy component is that it currently does not support Payload headers, so if any custom SOAP header in the request has to be included, some hand coding for Envelope using the SOAPPackager component is required Debugging Unfortunately, there was one experience that needed quite a bit of debugging when the Microsoft SOAP SDK went through it. The upshot is that it is a fairly straightforward process. Anybody who is familiar with debugging ASP and COM applications should have no problem locating and solving various issues with the code. The biggest challenge found was in how the ASP listener handles errors that occur within the COM objects it is exposing as services. Take the following code for example: 1. Public Function SomeMethod() As String 2. Err.Raise 1000, "Test Error" 104
105 3. End Function When the above method is called, the Proxy component errors with a "Bad SOAP Return" message that does not tell anything about what the real error is. In fact, when investigating further, the error is never properly handled and packaged as a SOAP fault on the server side. The only debugging to be done with the IBM implementation is making sure that the right version of the Apache Xerces-J XML parser is being used.[7, 13] 8.4 Stability IBM wins. Bugs found in the package and the way those errors were handled are discussed here. The MS SOAP package appears to be very unstable. Not only are there bugs in the XML encoding (try setting the method namespace using the SOAPPackager component), but there are many overlooked exceptions that cause pretty nasty results. Below is a list of just a few of the bugs that were found: 1. Improper encodingstyle attribute. 2. Improper Namespace usage. 3. LoadServiceDescription/ValidateDataAsType/IsMethodAvailable methods return BOOL instead of VARIANT_BOOL. 4. Fault Codes not parsed properly in the SOAPPackager.setPayload method. 105
106 5. Multiple host ports not supported ( would not work. The WireTransfer object would still use the default Port The WireTransfer.Port property does not do anything and is undocumented. 7. WireTransfer.getPageByURI method does not compile HTTP headers. 8. Invalid XML is generated by the SOAPPackager.getPayload method if a MethodNamespace is set using the SOAPPackager.SetPayloadData method (the namespace prefix is missing). 9. XML passed to the SOAPPackager.setPayload method must contain <?xml version='1.0'?> or an unhandled exception will occur. As mentioned earlier, the IBM package is wonderfully stable. 8.5 Compatibility IBM wins. The interoperability of each package with other SOAP v1.1 implementations was examined. As a quick experiment, try using an MS SOAP Client application to hit an IBM SOAP For the Java server, it will not work unless the SOAP envelope XML is manually coded and it is passed through using nothing but the WireTransfer object included in the Rope.dll. The problem lies with the improper and inconsistent SOAP version 1.1 conformance, and the bugs, within the Microsoft SOAPPackager component. Because the 106
107 SOAP Packaging is incorrect, it takes a lot of messaging to get the Microsoft toolkit to work with other, more compliant SOAP v1.1 implementations. The reverse is also true - IBM SOAP for Java clients do not work "out of the box" with an MS implemented SOAP server. IBM's SOAP for Java, on the other hand, works beautifully with clients and servers designed tightly around the SOAP v1.1 specification. 8.6 Summary When all is said and done, the Microsoft toolkit currently works very well with SOAP implementations designed specifically around its envelope encoding quirks and errors. However, this does not make the Microsoft toolkit very useful for developers wanting to integrate with existing SOAP implementations on other platforms. However, remain optimistic that the situation will get better. Microsoft has put a lot of time and energy into SOAP and has committed a good deal of resources to the task. The MS SOAP toolkit will be improved over time. On the IBM side of things, the recent news that the Apache Software Foundation has taken over the SOAP for Java project means there is no doubt that the package will only get better with time. 107
108 References [1] Anthony Bruno, Jacqueline Kim, CCDA Exam Certification Guide, 2000 Cisco Press Indianapolis, IN. [2] Barbara White, PURE JSP Java Server Pages A code-intensive Premium Reference, 2000, SAMS Indianapolis, IN. [3] Brian E. Travis, XML and SOAP Programming for Biztalk Servers, September 2000, Microsoft Press. [4] Dave Mercer, ASP 3.0: A Beginner's Guide, September 2000, McGraw-Hill [5] Dave Mercer, XML: A Beginner's Guide, May 2001, McGraw-Hill [6] David Chappell, Understanding.Net : A Tutorial and Analysis, 2002 [7] Doug Tidwell, Ken MacLeod, Pavel Kulchenko, Programming Web Services with SOAP, December 2001, O'Reilly & Associates, Incorporated [8] IDG Books WorldWide, Inc., Active Server Pages 3.0, 2000, IDG Books WorldWide, Inc. Foster City, CA. [9] IDG Books WorldWide, Inc., Java Server Pages, 2001, IDG Books WorldWide, Inc. Foster City, CA. [10] IDG Books WorldWide Inc, XML, 2001, IDG Books WorldWide Inc. Foster City, CA. [11] Jalal Feghhi, Web Developer's Guide to Java Beans: A Hands-On Guide to 108
109 Developing Reusable Software Using the Software Component Model Java Beans, November 2001, Sams [12] James Whatley, Building E-Commerce Sites in the.net Framework, September 2001, Sams [13] Kennard Scribner, Understanding SOAP : Simple Object Access Protocol, July 2000, Sams [14] Kevin C. Spencer, John Kauffmann, John Kauffman, Thearon Willis, Beginning ASP Databases, August 1999, Wrox Press Limited. [15] Matthew Reynolds, Beginning E-Commerce : With VB, ASP, ADO & MTS, March 2000, Wrox Press Limited. [16] Microsoft Press, MCSE Training Kit - Microsoft Windows 2000 Server, 2000, Microsoft Press, Redmond, Washington. [17] Patrick Dengler, Introducing.NET, 2001, Wrox Author Team [18] Paul J. Deitel, Harvey Deitel, Java How to Program 2001 Deitel Associates Inc. [19] Rebecca M. Riordan, SOAP Platform Web Service Development Using XML [20] Robert Englander, Java and SOAP, May 2002, O'Reilly & Associates, Incorporated. [21] Steve Graham, Building Web Services with Java: Making Sense of XML, SOAP, WSDL and UDDI, May 2002, Sams. 109
WEB SERVICES. Revised 9/29/2015
WEB SERVICES Revised 9/29/2015 This Page Intentionally Left Blank Table of Contents Web Services using WebLogic... 1 Developing Web Services on WebSphere... 2 Developing RESTful Services in Java v1.1...
What is a Web service?
What is a Web service? Many people and companies have debated the exact definition of Web services. At a minimum, however, a Web service is any piece of software that makes itself available over the Internet
Middleware and the Internet
Middleware and the Internet Middleware today Designed for special purposes (e.g. DCOM) or with overloaded specification (e.g. CORBA) Specifying own protocols integration in real world network? Non-performant
Web Services. Distributed Object Systems 11. Web Services, SOAP and NET. Web Applications. Web Services. Web services vs Distributed Objects
Distributed Object Systems 11 Web Services, SOAP and NET Piet van Oostrum Web Services Some Definitions A Web Service is a software system designed to support interoperable machine-to-machine interaction
How To Create A C++ Web Service
A Guide to Creating C++ Web Services WHITE PAPER Abstract This whitepaper provides an introduction to creating C++ Web services and focuses on:» Challenges involved in integrating C++ applications with
T-110.5140 Network Application Frameworks and XML Web Services and WSDL 15.2.2010 Tancred Lindholm
T-110.5140 Network Application Frameworks and XML Web Services and WSDL 15.2.2010 Tancred Lindholm Based on slides by Sasu Tarkoma and Pekka Nikander 1 of 20 Contents Short review of XML & related specs
Developing Java Web Services
Page 1 of 5 Developing Java Web Services Hands On 35 Hours Online 5 Days In-Classroom A comprehensive look at the state of the art in developing interoperable web services on the Java EE platform. Students
IBM SPSS Collaboration and Deployment Services Version 6 Release 0. Single Sign-On Services Developer's Guide
IBM SPSS Collaboration and Deployment Services Version 6 Release 0 Single Sign-On Services Developer's Guide Note Before using this information and the product it supports, read the information in Notices
Middleware and the Internet. Example: Shopping Service. What could be possible? Service Oriented Architecture
Middleware and the Internet Example: Shopping Middleware today Designed for special purposes (e.g. DCOM) or with overloaded specification (e.g. CORBA) Specifying own protocols integration in real world
T320 E-business technologies: foundations and practice
T320 E-business technologies: foundations and practice Block 3 Part 1 Activity 5: Implementing a simple web service Prepared for the course team by Neil Simpkins Introduction 1 Components of a web service
Introduction to Testing Webservices
Introduction to Testing Webservices Author: Vinod R Patil Abstract Internet revolutionized the way information/data is made available to general public or business partners. Web services complement this
XML Processing and Web Services. Chapter 17
XML Processing and Web Services Chapter 17 Textbook to be published by Pearson Ed 2015 in early Pearson 2014 Fundamentals of http://www.funwebdev.com Web Development Objectives 1 XML Overview 2 XML Processing
Introduction into Web Services (WS)
(WS) Adomas Svirskas Agenda Background and the need for WS SOAP the first Internet-ready RPC Basic Web Services Advanced Web Services Case Studies The ebxml framework How do I use/develop Web Services?
ITS. Java WebService. ITS Data-Solutions Pvt Ltd BENEFITS OF ATTENDANCE:
Java WebService BENEFITS OF ATTENDANCE: PREREQUISITES: Upon completion of this course, students will be able to: Describe the interoperable web services architecture, including the roles of SOAP and WSDL.
Author: Gennaro Frazzingaro Universidad Rey Juan Carlos campus de Mostòles (Madrid) GIA Grupo de Inteligencia Artificial
Simple Implementation of a WebService using Eclipse Author: Gennaro Frazzingaro Universidad Rey Juan Carlos campus de Mostòles (Madrid) GIA Grupo de Inteligencia Artificial Contents Web Services introduction
http://msdn.microsoft.com/en-us/library/4w3ex9c2.aspx
ASP.NET Overview.NET Framework 4 ASP.NET is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. ASP.NET is
Internationalization and Web Services
Internationalization and Web Services 25 th Internationalization and Unicode Conference Presented by Addison P. Phillips Director, Globalization Architecture webmethods, Inc. 25 th Internationalization
Efficiency of Web Based SAX XML Distributed Processing
Efficiency of Web Based SAX XML Distributed Processing R. Eggen Computer and Information Sciences Department University of North Florida Jacksonville, FL, USA A. Basic Computer and Information Sciences
Web-Service Example. Service Oriented Architecture
Web-Service Example Service Oriented Architecture 1 Roles Service provider Service Consumer Registry Operations Publish (by provider) Find (by requester) Bind (by requester or invoker) Fundamentals Web
Grid Computing. Web Services. Explanation (2) Explanation. Grid Computing Fall 2006 Paul A. Farrell 9/12/2006
Grid Computing Web s Fall 2006 The Grid: Core Technologies Maozhen Li, Mark Baker John Wiley & Sons; 2005, ISBN 0-470-09417-6 Web s Based on Oriented Architecture (SOA) Clients : requestors Servers : s
Oracle9i Application Server: Options for Running Active Server Pages. An Oracle White Paper July 2001
Oracle9i Application Server: Options for Running Active Server Pages An Oracle White Paper July 2001 Oracle9i Application Server: Options for Running Active Server Pages PROBLEM SUMMARY...3 INTRODUCTION...3
Web services can convert your existing applications into web applications.
i About the Tutorial Web services are open standard (XML, SOAP, HTTP, etc.) based web applications that interact with other web applications for the purpose of exchanging data Web services can convert
Lesson 4 Web Service Interface Definition (Part I)
Lesson 4 Web Service Interface Definition (Part I) Service Oriented Architectures Module 1 - Basic technologies Unit 3 WSDL Ernesto Damiani Università di Milano Interface Definition Languages (1) IDLs
Oracle Service Bus Examples and Tutorials
March 2011 Contents 1 Oracle Service Bus Examples... 2 2 Introduction to the Oracle Service Bus Tutorials... 5 3 Getting Started with the Oracle Service Bus Tutorials... 12 4 Tutorial 1. Routing a Loan
JBoss SOAP Web Services User Guide. Version: 3.3.0.M5
JBoss SOAP Web Services User Guide Version: 3.3.0.M5 1. JBoss SOAP Web Services Runtime and Tools support Overview... 1 1.1. Key Features of JBossWS... 1 2. Creating a Simple Web Service... 3 2.1. Generation...
Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture #3 2008 3 Apache.
JSP, and JSP, and JSP, and 1 2 Lecture #3 2008 3 JSP, and JSP, and Markup & presentation (HTML, XHTML, CSS etc) Data storage & access (JDBC, XML etc) Network & application protocols (, etc) Programming
Virtual Credit Card Processing System
The ITB Journal Volume 3 Issue 2 Article 2 2002 Virtual Credit Card Processing System Geraldine Gray Karen Church Tony Ayres Follow this and additional works at: http://arrow.dit.ie/itbj Part of the E-Commerce
Web Services for Management Perl Library VMware ESX Server 3.5, VMware ESX Server 3i version 3.5, and VMware VirtualCenter 2.5
Technical Note Web Services for Management Perl Library VMware ESX Server 3.5, VMware ESX Server 3i version 3.5, and VMware VirtualCenter 2.5 In the VMware Infrastructure (VI) Perl Toolkit 1.5, VMware
Introduction. Tom Dinkelaker, Ericsson Guido Salvaneschi, Mira Mezini, TUD
Introduction Tom Dinkelaker, Ericsson Guido Salvaneschi, Mira Mezini, TUD Agenda of KICK-OFF MEETING Introduction Organization of Course Topics Questions & Answers Ericsson Telekommunikation GmbH & Co.
The presentation explains how to create and access the web services using the user interface. WebServices.ppt. Page 1 of 14
The presentation explains how to create and access the web services using the user interface. Page 1 of 14 The aim of this presentation is to familiarize you with the processes of creating and accessing
Concept, implementation and performance testing of a mobile Web Service provider for Smart Phones
Ome Srirama Chair of Information Systems LuFG Cooperation Systems Aachen University of Technology Prof. Dr. Wolfgang Prinz Master Thesis Concept, implementation and performance testing of a mobile Web
Introduction to Service Oriented Architectures (SOA)
Introduction to Service Oriented Architectures (SOA) Responsible Institutions: ETHZ (Concept) ETHZ (Overall) ETHZ (Revision) http://www.eu-orchestra.org - Version from: 26.10.2007 1 Content 1. Introduction
Web Services Technologies
Web Services Technologies XML and SOAP WSDL and UDDI Version 16 1 Web Services Technologies WSTech-2 A collection of XML technology standards that work together to provide Web Services capabilities We
Programming Web Services with SOAP
Doug Tidwell James Snell Pavel Kulchenko Publisher: O'Reilly First Edition December 2001 ISBN: 0-596-00095-2, 216 pages Programming Web Services with SOAP introduces you to building distributed Wb-based
Introduction to Web Services
Department of Computer Science Imperial College London CERN School of Computing (icsc), 2005 Geneva, Switzerland 1 Fundamental Concepts Architectures & escience example 2 Distributed Computing Technologies
IBM Rational Rapid Developer Components & Web Services
A Technical How-to Guide for Creating Components and Web Services in Rational Rapid Developer June, 2003 Rev. 1.00 IBM Rational Rapid Developer Glenn A. Webster Staff Technical Writer Executive Summary
IBM WebSphere Adapter for Email 7.0.0.0. Quick Start Tutorials
IBM WebSphere Adapter for Email 7.0.0.0 Quick Start Tutorials Note: Before using this information and the product it supports, read the information in "Notices" on page 182. This edition applies to version
Examining the InDesign Server Solution
Examining the InDesign Server Solution This is an online bonus article for Chapter 13 of Paperless: Real-World Solutions with Adobe Technology. This article details the tools and techniques that were used
Firewall Builder Architecture Overview
Firewall Builder Architecture Overview Vadim Zaliva Vadim Kurland Abstract This document gives brief, high level overview of existing Firewall Builder architecture.
ISM/ISC Middleware Module
ISM/ISC Middleware Module Lecture 14: Web Services and Service Oriented Architecture Dr Geoff Sharman Visiting Professor in Computer Science Birkbeck College Geoff Sharman Sept 07 Lecture 14 Aims to: Introduce
Web services with WebSphere Studio: Deploy and publish
Web services with WebSphere Studio: Deploy and publish Table of Contents If you're viewing this document online, you can click any of the topics below to link directly to that section. 1. Introduction...
Integration of Hotel Property Management Systems (HPMS) with Global Internet Reservation Systems
Integration of Hotel Property Management Systems (HPMS) with Global Internet Reservation Systems If company want to be competitive on global market nowadays, it have to be persistent on Internet. If we
Web Services Developer s Guide
Web Services Developer s Guide VERSION 8 Borland JBuilder Borland Software Corporation 100 Enterprise Way, Scotts Valley, CA 95066-3249 www.borland.com Refer to the file deploy.html located in the redist
JVA-561. Developing SOAP Web Services in Java
JVA-561. Developing SOAP Web Services in Java Version 2.2 A comprehensive look at the state of the art in developing interoperable web services on the Java EE 6 platform. Students learn the key standards
Forward proxy server vs reverse proxy server
Using a reverse proxy server for TAD4D/LMT Intended audience The intended recipient of this document is a TAD4D/LMT administrator and the staff responsible for the configuration of TAD4D/LMT agents. Purpose
XIII. Service Oriented Computing. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini
XIII. Service Oriented Computing Laurea Triennale in Informatica Corso di Outline Enterprise Application Integration (EAI) and B2B applications Service Oriented Architecture Web Services WS technologies
Dynamic Web Programming BUILDING WEB APPLICATIONS USING ASP.NET, AJAX AND JAVASCRIPT
Dynamic Web Programming BUILDING WEB APPLICATIONS USING ASP.NET, AJAX AND JAVASCRIPT AGENDA 1. Introduction to Web Applications and ASP.net 1.1 History of Web Development 1.2 Basic ASP.net processing (ASP
Web Services Servizio Telematico Doganale
Web Services Servizio Telematico Doganale USER MANUAL Pagina 1 di 20 Contents 1 Introduction... 3 2 Functional testing of web services... 6 3 Creating the client... 10 3.1 Open Source solutions... 10 3.2
Unit IV: SOAP protocol, XML-RPC, HTTP, SOAP faults and SOAP attachments, Web services, UDDI, XML security
Unit IV: SOAP protocol, XML-RPC, HTTP, SOAP faults and SOAP attachments, Web services, UDDI, XML security 1. RPC (Remote Procedure Call) It is often necessary to design distributed systems, where the code
T320 E-business technologies: foundations and practice
T320 E-business technologies: foundations and practice Block 3 Part 2 Activity 2: Generating a client from WSDL Prepared for the course team by Neil Simpkins Introduction 1 WSDL for client access 2 Static
4.2 Understand Microsoft ASP.NET Web Application Development
L E S S O N 4 4.1 Understand Web Page Development 4.2 Understand Microsoft ASP.NET Web Application Development 4.3 Understand Web Hosting 4.4 Understand Web Services MTA Software Fundamentals 4 Test L
AXL Troubleshooting. Overview. Architecture
AXL Troubleshooting This chapter contains the following topics: Overview, page 35 Architecture, page 35 Postinstallation Checklist, page 36 Troubleshooting Tools, page 39 Error Codes, page 43 Overview
Getting started with OWASP WebGoat 4.0 and SOAPUI.
Getting started with OWASP WebGoat 4.0 and SOAPUI. Hacking web services, an introduction. Version 1.0 by Philippe Bogaerts [email protected] www.radarhack.com Reviewed by Erwin Geirnaert
Universal Event Monitor for SOA 5.2.0 Reference Guide
Universal Event Monitor for SOA 5.2.0 Reference Guide 2015 by Stonebranch, Inc. All Rights Reserved. 1. Universal Event Monitor for SOA 5.2.0 Reference Guide.............................................................
Single Sign-On Implementation Guide
Salesforce.com: Salesforce Winter '09 Single Sign-On Implementation Guide Copyright 2000-2008 salesforce.com, inc. All rights reserved. Salesforce.com and the no software logo are registered trademarks,
PASS4TEST 専 門 IT 認 証 試 験 問 題 集 提 供 者
PASS4TEST 専 門 IT 認 証 試 験 問 題 集 提 供 者 http://www.pass4test.jp 1 年 で 無 料 進 級 することに 提 供 する Exam : C2090-420 Title : IBM InfoSphere MDM Server v9.0 Vendors : IBM Version : DEMO NO.1 Which two reasons would
Integrating SharePoint Sites within WebSphere Portal
Integrating SharePoint Sites within WebSphere Portal November 2007 Contents Executive Summary 2 Proliferation of SharePoint Sites 2 Silos of Information 2 Security and Compliance 3 Overview: Mainsoft SharePoint
BarTender Integration Methods. Integrating BarTender s Printing and Design Functionality with Your Custom Application WHITE PAPER
BarTender Integration Methods Integrating BarTender s Printing and Design Functionality with Your Custom Application WHITE PAPER Contents Introduction 3 Integrating with External Data 4 Importing Data
WhitePaper. Web services: Benefits, challenges, and a unique, visual development solution
WhitePaper Web services: Benefits, challenges, and a unique, visual development solution Altova, Inc. l 900 Cummings Center, Suite 314-T l Beverly, MA, 01915-6181, USA l Tel: 978-816-1600 l Fax: 978-816-1606
OpenScape Voice V8 Application Developers Manual. Programming Guide A31003-H8080-R100-2-7620
OpenScape Voice V8 Application Developers Manual Programming Guide A31003-H8080-R100-2-7620 Our Quality and Environmental Management Systems are implemented according to the requirements of the ISO9001
Spectrum Technology Platform
Spectrum Technology Platform Version 8.0.0 SP2 RIA Getting Started Guide Information in this document is subject to change without notice and does not represent a commitment on the part of the vendor or
4. Concepts and Technologies for B2C, B2E, and B2B Transaction
4. Concepts and Technologies for B2C, B2E, and B2B Transaction 4.4 Exchanging Information within Open Business Communities 4.4.1 Pre-Internet B2B standards: EDI, Interactive EDI, Universal EDI, OpenEDI
Developing Web Services Applications
Redpaper Martin Keen Rafael Coutinho Sylvi Lippmann Salvatore Sollami Sundaragopal Venkatraman Steve Baber Henry Cui Craig Fleming Developing Web Services Applications This IBM Redpaper publication introduces
SW5706 Application deployment problems
SW5706 This presentation will focus on application deployment problem determination on WebSphere Application Server V6. SW5706G11_AppDeployProblems.ppt Page 1 of 20 Unit objectives After completing this
Writing Grid Service Using GT3 Core. Dec, 2003. Abstract
Writing Grid Service Using GT3 Core Dec, 2003 Long Wang [email protected] Department of Electrical & Computer Engineering The University of Texas at Austin James C. Browne [email protected] Department
Installation and configuration guide
Installation and Configuration Guide Installation and configuration guide Adding X-Forwarded-For support to Forward and Reverse Proxy TMG Servers Published: May 2010 Applies to: Winfrasoft X-Forwarded-For
IBM Rational Web Developer for WebSphere Software Version 6.0
Rapidly build, test and deploy Web, Web services and Java applications with an IDE that is easy to learn and use IBM Rational Web Developer for WebSphere Software Version 6.0 Highlights Accelerate Web,
Emerging Technologies Shaping the Future of Data Warehouses & Business Intelligence
Emerging Technologies Shaping the Future of Data Warehouses & Business Intelligence Service Oriented Architecture SOA and Web Services John O Brien President and Executive Architect Zukeran Technologies
Classic Grid Architecture
Peer-to to-peer Grids Classic Grid Architecture Resources Database Database Netsolve Collaboration Composition Content Access Computing Security Middle Tier Brokers Service Providers Middle Tier becomes
Joke Server example. with Java and Axis. Web services with Axis SOAP, WSDL, UDDI. Joke Metaservice Joke Server Joke Client.
Joke Server example SOAP and WSDL with Java and Axis Interactive web services, Course, Fall 2003 Henning Niss Joke Metaservice Joke Server Joke Client 3 meta service 2 IT University of Copenhagen client
Accessing Data with ADOBE FLEX 4.6
Accessing Data with ADOBE FLEX 4.6 Legal notices Legal notices For legal notices, see http://help.adobe.com/en_us/legalnotices/index.html. iii Contents Chapter 1: Accessing data services overview Data
EVALUATION. WA1844 WebSphere Process Server 7.0 Programming Using WebSphere Integration COPY. Developer
WA1844 WebSphere Process Server 7.0 Programming Using WebSphere Integration Developer Web Age Solutions Inc. USA: 1-877-517-6540 Canada: 1-866-206-4644 Web: http://www.webagesolutions.com Chapter 6 - Introduction
Creating XML Report Web Services
5 Creating XML Report Web Services In the previous chapters, we had a look at how to integrate reports into Windows and Web-based applications, but now we need to learn how to leverage those skills and
A standards-based approach to application integration
A standards-based approach to application integration An introduction to IBM s WebSphere ESB product Jim MacNair Senior Consulting IT Specialist [email protected] Copyright IBM Corporation 2005. All rights
DataDirect XQuery Technical Overview
DataDirect XQuery Technical Overview Table of Contents 1. Feature Overview... 2 2. Relational Database Support... 3 3. Performance and Scalability for Relational Data... 3 4. XML Input and Output... 4
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material,
Creating Web Services in NetBeans
Creating Web Services in NetBeans Fulvio Frati [email protected] Sesar Lab http://ra.crema.unimi.it 1 Outline Web Services Overview Creation of a Web Services Server Creation of different Web Services
SmartTV User Interface Development for SmartTV using Web technology and CEA2014. George Sarosi [email protected]
SmartTV User Interface Development for SmartTV using Web technology and CEA2014. George Sarosi [email protected] Abstract Time Warner Cable is the second largest Cable TV operator in North America
FUSE ESB. Getting Started with FUSE ESB. Version 4.1 April 2009
FUSE ESB Getting Started with FUSE ESB Version 4.1 April 2009 Getting Started with FUSE ESB Version 4.1 Publication date 22 Jul 2009 Copyright 2001-2009 Progress Software Corporation and/or its subsidiaries
Instant Chime for IBM Sametime Installation Guide for Apache Tomcat and Microsoft SQL
Instant Chime for IBM Sametime Installation Guide for Apache Tomcat and Microsoft SQL Spring 2015 Copyright and Disclaimer This document, as well as the software described in it, is furnished under license
1 What Are Web Services?
Oracle Fusion Middleware Introducing Web Services 11g Release 1 (11.1.1) E14294-04 January 2011 This document provides an overview of Web services in Oracle Fusion Middleware 11g. Sections include: What
Combining SAWSDL, OWL DL and UDDI for Semantically Enhanced Web Service Discovery
Combining SAWSDL, OWL DL and UDDI for Semantically Enhanced Web Service Discovery Dimitrios Kourtesis, Iraklis Paraskakis SEERC South East European Research Centre, Greece Research centre of the University
Distributed Embedded Systems
Distributed Embedded Systems Computer Architecture and Operating Systems 2 Content 1. Motivation 2. An Overview of Distributed Software Architecture Approaches 2.1 Pro & Contra Middleware 2.2 Message-Based
Programming IoT Gateways With macchina.io
Programming IoT Gateways With macchina.io Günter Obiltschnig Applied Informatics Software Engineering GmbH Maria Elend 143 9182 Maria Elend Austria [email protected] This article shows how
Service Oriented Architecture
Service Oriented Architecture Charlie Abela Department of Artificial Intelligence [email protected] Last Lecture Web Ontology Language Problems? CSA 3210 Service Oriented Architecture 2 Lecture Outline
UDDI Executive White Paper November 14, 2001
UDDI Executive White Paper November 14, 2001 ! " #$! " % With the advent of service-centric computing, the Internet presents incredible value and reach for businesses of all sizes, providing opportunities
Enterprise Application Designs In Relation to ERP and SOA
Enterprise Application Designs In Relation to ERP and SOA DESIGNING ENTERPRICE APPLICATIONS HASITH D. YAGGAHAVITA 20 th MAY 2009 Table of Content 1 Introduction... 3 2 Patterns for Service Integration...
Introducing the.net Framework 4.0
01_0672331004_ch01.qxp 5/3/10 5:40 PM Page 1 CHAPTER 1 Introducing the.net Framework 4.0 As a Visual Basic 2010 developer, you need to understand the concepts and technology that empower your applications:
Enterprise Service Bus
We tested: Talend ESB 5.2.1 Enterprise Service Bus Dr. Götz Güttich Talend Enterprise Service Bus 5.2.1 is an open source, modular solution that allows enterprises to integrate existing or new applications
Web services with WebSphere Studio: Build and test
Web services with WebSphere Studio: Build and test www7b.software.ibm.com/wsdd/ Table of Contents If you're viewing this document online, you can click any of the topics below to link directly to that
What Is the Java TM 2 Platform, Enterprise Edition?
Page 1 de 9 What Is the Java TM 2 Platform, Enterprise Edition? This document provides an introduction to the features and benefits of the Java 2 platform, Enterprise Edition. Overview Enterprises today
Developing Java Web Services to Expose the WorkTrak RMI Server to the Web and XML-Based Clients
Developing Ja Web Services to Expose the WorkTrak RMI Server to the Web and XML-Based Clients Roochi Sahni Abstract-- One development on the Internet involves a group of open standard technologies referred
Siena Web Services. A Solution To Personal Computing With Established Desktop Programs Exploiting Web Technologies
A Solution To Personal Computing With Established Desktop Programs Exploiting Web Technologies (c) 2002 Siena Technology Ltd. UK, [email protected] : Overview Reference Potential for YOU? Requirements
Deploying Microsoft Operations Manager with the BIG-IP system and icontrol
Deployment Guide Deploying Microsoft Operations Manager with the BIG-IP system and icontrol Deploying Microsoft Operations Manager with the BIG-IP system and icontrol Welcome to the BIG-IP LTM system -
Enhanced Connector Applications SupportPac VP01 for IBM WebSphere Business Events 3.0.0
Enhanced Connector Applications SupportPac VP01 for IBM WebSphere Business Events 3.0.0 Third edition (May 2012). Copyright International Business Machines Corporation 2012. US Government Users Restricted
