Programming Web Services with XML-RPC

( 4 )

Overview

Have you ever needed to share processing between two or more computers running programs written in different languages on different operating systems? Or have you ever wanted to publish information on the Web so that programs other than browsers could work with it? XML-RPC, a system for remote procedure calls built on XML and the ubiquitous HTTP protocol, is the solution you've been looking for.Programming Web Services with XML-RPC introduces the simple but powerful capabilities of XML-RPC, which lets you connect...

See more details below
Paperback (First Edition)
$26.57
BN.com price
(Save 24%)$34.99 List Price
Other sellers (Paperback)
  • All (32) from $1.99   
  • New (9) from $3.49   
  • Used (23) from $1.99   
Programming Web Services with XML-RPC

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK
  • NOOK HD/HD+ Tablet
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$15.49
BN.com price
(Save 44%)$27.99 List Price

Overview

Have you ever needed to share processing between two or more computers running programs written in different languages on different operating systems? Or have you ever wanted to publish information on the Web so that programs other than browsers could work with it? XML-RPC, a system for remote procedure calls built on XML and the ubiquitous HTTP protocol, is the solution you've been looking for.Programming Web Services with XML-RPC introduces the simple but powerful capabilities of XML-RPC, which lets you connect programs running on different computers with a minimum of fuss, by wrapping procedure calls in XML and establishing simple pathways for calling functions. With XML-RPC, Java programs can talk to Perl scripts, which can talk to Python programs, ASP applications, and so on. You can provide access to procedure calls without having to worry about the system on the other end, so it's easy to create services that are available on the Web.XML-RPC isn't the only solution for web services; the Simple Object Access Protocol (SOAP) is another much-hyped protocol for implementing web services. While XML-RPC provides fewer capabilities than SOAP, it also has far fewer interoperability problems and its capabilities and limitations are much better understood. XML-RPC is also stable, with over 30 implementations on a wide variety of platforms, so you can start doing real work with it immediately.Programming Web Services with XML-RPC covers the details of five XML-RPC implementations, so you can get started developing distributed applications in Java, Perl, Python, ASP, or PHP. The chapters on these implementations contain code examples that you can use as the basis for your own work. This book also provides in-depth coverage of the XML-RPC specification, which is helpful for low-level debugging of XML-RPC clients and servers. And if you want to build your own XML-RPC implementation for another environment, the detailed explanations in this book will serve as a foundation for that work.

Read More Show Less

Product Details

  • ISBN-13: 9780596001193
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 8/31/2001
  • Edition description: First Edition
  • Edition number: 1
  • Pages: 236
  • Product dimensions: 7.04 (w) x 9.22 (h) x 0.60 (d)

Meet the Author

Simon St. Laurent is a web developer, network administrator, computer book author, and XML troublemaker living in Ithaca, NY. His books include XML: A Primer, XML Elements of Style, Building XML Applications, Cookies, and Sharing Bandwidth. He is a contributing editor to XMLhack.com and an occasional contributor to XML.com.

Joe Johnston is a graduate of the University of Massachusetts in Boston with a B.A. in computer science, he is a teacher, web designer, and author of articles for Perl Journal, Perl.com, and IBM's DeveloperWorks. Joe helps maintain the ASP XML-RPC library and wrote the Perl module Frontier::Responder.pm.

Edd is Managing Editor of XML.com. He also writes free software, and packages Bluetooth-related software for the Debian GNU/Linux distribution. Edd is the creator of XMLhack and WriteTheWeb, and has a weblog called Behind the Times.

Read More Show Less

Read an Excerpt

Chapter 3: Client-Server Communication: XML-RPC in Java

Java was built from the ground up as a network-centric development environment. As a Java developer, XML-RPC offers you an opportunity to extend that foundation in a structured way. Adding XML-RPC to your toolkit makes it easier to integrate a Java application with an application built using another environment or simply to establish lightweight point-to-point communication between Java programs running on different computers. Although XML-RPC goes against the grain of much Java network programming (and even against some of the fundamental principles of object-oriented development), its alternative approach can be useful in many relatively common scenarios.

You already have a wide variety of Java-based XML and HTTP tools to choose from, but you can also take advantage of a prepackaged set of XML-RPC tools. Although understanding the foundations of XML-RPC is very useful for debugging and for establishing connections between systems in different environments, you can treat XML-RPC much like you do any other Java feature. There's some setup work to do, especially for XML-RPC servers, but most of this work is simple and needs to be done only once in the course of a program.

This chapter looks at how XML-RPC fits into Java's many network options. It demonstrates how to build a variety of different XML-RPC clients, servers, and handlers. Some of these examples take advantage of built-in functionality for setting up simple XML-RPC servers and handlers; others explore the possibilities opened up by handling more of the processing directly. The examples cover different styles of XML-RPC programming, from simple library function calls to more complex calls that manipulate information on the server.

Why XML-RPC for Java?

Java is already an extremely network-aware environment, complete with its own mechanisms for remote communication and coordination of objects on multiple systems. Remote Method Invocation (RMI) and RMI's support for the broader world of CORBA-based systems provide built-in support for distributing applications across multiple systems.1 In many ways, Java is well ahead of its competitors, and its network support extends far beyond the simple request-response cycle of XML-RPC.

Despite Java's built-in network computing prowess, XML-RPC offers a few kinds of functionality that Java can't match. XML-RPC is far more lightweight than Java's built in RMI support, passing only parameters rather than objects. Java programs can use XML-RPC to connect directly to any other system supporting XML-RPC, rather than limiting connections to fellow RMI systems or having to use complex (and expensive) CORBA object request brokers.

As illustrated in Figure 3-1, XML-RPC can bring the direct connections RMI makes possible for strictly Java applications to applications that integrate multiple environmentsXML-RPC's use of HTTP as a transport substrate makes it relatively simple to integrate XML-RPC with the web-enabled applications that are already spreading across the computing landscape. At the same time, XML-RPC uses such a tiny subset of HTTP that Java applications can easily avoid the overhead of full-scale HTTP processing, working with a more minimal--and more efficient--driver that takes advantage of Java's built-in understanding of TCP/IP.

XML-RPC also offers you a shorter compilation and testing cycle. Unlike RMI, which requires recompilation of interfaces to register method signatures, XML-RPC allows the client to specify which method it wants to use and then looks for a handler. Because the reference is done by name, there aren't any stubs to manage or include, and changes can be made much more easily at runtime.

On the other hand, XML-RPC is definitely not appropriate in plenty of Java application situations. Much of the Enterprise JavaBeans (EJB) work already relies on RMI, and rewriting it to use XML-RPC would be a remarkable waste of time. Although a snippet of XML-RPC code might be useful as a simple bridge between an EJB-based application and code written for other environments, XML-RPC isn't designed explicitly to support the many demands of complex enterprise-scale design. Similarly, if you need to pass objects, rather than parameters, betweensystems, you should look into a more sophisticated set of tools than XML-RPC. XML-RPC lets you pass sets of parameters, not complex nested structures with associated method information, back and forth. As explained later in this chapter, XML-RPC's approach doesn't match cleanly with JavaBeans, either.

Figure 3-1. XML-RPC makes it possible to connect a wide array of programming environments...

...Although most Java programs aren't designed for use in the procedural framework that XML-RPC uses, an enormous amount of code in the typical Java program could conceivably be exposed as an XML-RPC procedure, with or without some degree of modification. Although Java is very object-focused, it retains enough links with procedural environments for developers to take advantage of "traditional" features, such as function calls, in the midst of complex object interactions. Although some of XML-RPC's rules, like its lack of support for void return values, make integrating XML-RPC with Java difficult, most of the integration process is pretty simple, limited only by the narrow range of data types and structures XML-RPC supports.

The XML-RPC library for Java does not require the methods it uses be static, but in some ways static methods fit the basic architecture of XML-RPC very well. Static methods are the closest things Java offers to procedural function calls, commonly used for utility functions (such as those in the Math class) for which the function itself is important, but there may not be any surrounding context. If you've built libraries of these kinds of methods, implementing key algorithms for processing arguments, you may find it especially easy to convert your old work to XML-RPC handlers.

You can also use XML-RPC servers in a larger Java framework to answer client requests while using those requests to modify their own information set. Rather than thinking about XML-RPC handlers as "mere" procedures, you can treat XML-RPC handlers as regular Java methods, limited only by difficulties in transferring objects between the routine making the method call and the routine performing processing. In every other way, XML-RPC can become a natural part of Java programming, providing yet another way to get information into and out of Java environments. Using XML-RPC can make connecting Java programs to programs written in other environments much simpler, and may be appropriate for some simple Java-to-Java cases, as well.

The XML-RPC Java Library

Although you could use the wide variety of XML resources available in Java to create your own XML-RPC package, Hannes Wallnöfer has already built a set of classes that provide XML-RPC capabilities for both clients and servers, including a small XML-RPC server that lets you work without the overhead of a full-scale Web server. Most examples in this chapter rely on his package.

As of this writing, the XML-RPC library for Java in still in beta, at Version 1.0 beta 4. Although it is unlikely that there will be major changes to the API, you should check the index.html file and documentation that come with the library if you encounter problems.

The XML-RPC Library for Java web site is http://classic.helma.at/hannes/xmlrpc/, and additional resources (including a mailing list with archives) are also available there. The examples in the current chapter use the helma.xmlrpc library, which is available at that site....

Read More Show Less

Table of Contents

Foreword

Preface

Chapter 1: Introduction

Chapter 2: The XML-RPC Protocol

Chapter 3: Client-Server Communication: XML-RPC in Java

Chapter 4: XML-RPC and Perl

Chapter 5: Integrating Web Applications: XML-RPC in PHP

Chapter 6: XML-RPC and Python

Chapter 7: Bridging XML-RPC and COM: XML-RPC in ASP

Chapter 8: XML-RPC and the Web Services Landscape

The XML You Need for XML-RPC

The HTTP You Need for XML-RPC

Colophon

Read More Show Less

Customer Reviews

Average Rating 4.5
( 4 )
Rating Distribution

5 Star

(3)

4 Star

(0)

3 Star

(0)

2 Star

(1)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 4 Customer Reviews
  • Anonymous

    Posted March 5, 2014

    Aqua

    I wish l had a relationship like that!

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted March 5, 2014

    Maddie

    KEEP GOING also if u can give me advice abput a boy at advice needed res 1

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted March 5, 2014

    Great!

    Mooshy gooshy.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted March 5, 2014

    Night To Remember- Part Nine (Edd

    ((Nuu the last few chapters! These last few chapters is gonn be Edd from his POV)) I quickly yet quietly closed the door to my house. Swooning over Claire, I went to my room and layed in the same spot I was before. I decided to text Claire. 'Miss ya! ;)' Then, hit send. I got a quick reply. 'Same. Just wondering, are we official?' I thought about it. We did kiss and confess our love for each other. 'I think so.' I texted back. 'Good. Cause after all that from last night and NOT saying we are official would be crazy! Amanda is begging me to walk her to Tom's. Love ya!' I smiled. 'Bye, love ya 2.' I typed. 'Maybe we can hangout later?' I texted. For a while I didn't get a text. 'Sure! At your house.' The doorbell rang and I smiled, racing downstairs. I swung open the door and quickly hugged Claire. I picked her up by the waist from behind and swung her around. She laughed and I let go. "Ready?" I asked. She nodded and we were on our way. "So, what first?" "Candy shop!" She pointed at the local candy shop and I smiled. "Let's go!" She raced to it and I followed. She gazed at all the candy. But one caught her eye. "Gummy bears." She drooled. "Wanna get some?" She nodded like a child and i grabbed a bag and poured some in. I gave it to her and she looked around. "I'm done here." She stated and handed the cashier the gummy bears. I noticed he was glancing up at Claire from time to time. He was a bit nerdy, acne, big thick rimmed glasses, and head gear. I pulled her closer and wrapped an arm around her waist. She didn't pay attention and gazed around our little town. Once he handed us our gummy bears, she tore open the bag. "Thank you!" "Call me?" He asked. She walked off. "Listen, she's in a relationship with me. Back off." I said. He snorted and helped snotty kids. Claire ate the gummy bears and walked around. "He wasn't my type." She said. I smiled and held her hand. "Frozen!" She said, pointing at a movie poster. "I have money." She dragged me inside after I said that. "Two adult tickets to see Frozen." I said. The woman handed us our tickets and we bought popcorn. As we sat down, the movie started. It was actually quite interesting. Claire seemed so into Elsa and Anna. They're bond as sisters. After the movie, we walked home. "Let it go, Let it go." Claire sung quietly. I smiled and spun her around. "Can't hold it back anymore." I sang back to her. We laughed and sung as rain soon greeted us. We laughed more. I stopped laughing to admire Claire. The rain made her blonde hair seem brunette and her eyes looked more green than hazel. "Claire." I said. She stopped and faced me. Being inches apart, I couldn't resist but lean in and kiss her. Not too rough, not too soft. In the middle. I kissed her lips with passion yet with gentleness. As we pulled away, we stayed close to each other. "I fell in love with you like I fall asleep. One bit at a time, then all at once." She whispered. ((If you know what thats from leave a comment saying where!)) I smiled and held her hands. The rain kept pelting us, getting us drenched. We didn't care. "I could hug you all day. In the rain, snow, hail, any weather. I'll protect you." I said, scopping her up bridal style. She blushed and snuggled close. I walked to her house and knocked. Matt opened up and glanced at Claire. He smirked and let me in. I walked up to the guest room and layed her on the bed. She yawned. "Out. I gotta change." She said, shoving me out. I smiled. ((Wrap!))

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 4 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)