Home > SAP software/management Tips > SAP ABAP/Java developer tips > SAP and Web services, part 3
SAP Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

SAP ABAP/JAVA DEVELOPER TIPS

SAP and Web services, part 3


Jeff Marin
06.10.2002
Rating: -3.44- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


The first two articles in this series have described what Web services are, how they relate to SAP, and a first look at some of the technologies needed to create Web services. One of Web services greatest assets is that it is reusable by both internal and external applications and business partners. It achieves this by using marked up text or XML. However, XML by itself does not solve every communication problem nor does it provide a vocabulary for exchanging information. It is merely a foundation on which to build vocabularies.

The need for a common vocabulary
XML provides markup tags to signify the meaning or the context of the contained data. However, parties interested in communicating by exchanging XML have to agree on which tags to use and what their meanings are. Our Web service clients will send XML to us indicating the name of the Web service and parameters to pass to that Web service. They expect to receive a XML response containing the result of the Web service.

The name and syntax of the markup tags that enclose the name of the Web service, parameters, and the result of the Web service need to be universal so that clients can access our Web service regardless of the hardware, operating system, and applications they are currently running.
Enter SOAP
Agreeing on communication standards is usually a political catastrophe but the computing industry has just experienced one of the greatest exceptions to this rule. SOAP (Simple Object Access Protocol) is a lightweight distributed computing protocol that has received industry backing by every major software and hardware vendor. SOAP is build on top of XML and dictates how Web service clients and servers exchange information through the use of XML tags.

Because SOAP is a published standard, SOAP messages must have a specific structure. A SOAP message consists of an envelope, an optional header and a mandatory body. The envelope describes the contents of the message and how to handle the information. The body contains the name of the Web service, parameters, and responses from Web services. Here is an example SOAP message:
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<gamma:getCompanyList xmlns: gamma="urn:CompanyListService">
<stateabbrev >CA</stateabbrev>
</gamma:getCompanyList>
<SOAP-ENV:Body>

This SOAP message has an envelope and a body. There is a Web service named CompanyListService with a function (or method) named getCompanyList. This method takes one parameter, a state abbreviation. In this case we are passing in California. The rest of the information has to do with the syntax and definition of SOAP itself.

Can someone help with the heavy lifting?
So, in order to create Web service servers and clients, we need to create and process SOAP messages. This involves a lot of code that has nothing to do with our actual business logic. All we are doing here is taking a client request and creating a SOAP message from it. Thankfully, there are toolkits that automate this process.

One such toolkit is Apache SOAP and comes from The Apache XML Project. One of the great things about Apache SOAP is that it is open-source, or in economic terms, free. If you remember from our architecture diagram, we are going to need a J2EE Application Server Apache to communicate with SAP through JCo and to service our clients. Apache SOAP is able to run on most J2EE Application Servers. In our case, we are going to use an open-source Application Server named Tomcat. Tomcat is a product of The Jakarta Project. With this in mind, let's update our architecture diagram.



In the next article, we will discuss how to set up Tomcat and Apache SOAP. In the meantime, for more information please look at http://xml.apache.org/soap/index.html for more information on Apache SOAP and http://jakarta.apache.org/tomcat/index.html for more information on Tomcat.


Rate this Tip
To rate tips, you must be a member of SearchSAP.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
SAP ABAP/Java developer tips
How to do additional dialog processing after SAP COMMIT WORK statement
How to find a piece of SAP ABAP code without debugging
How to read an SAP transaction in an ABAP code
How to provide an SAP R/3 4.5B application server with a Web service interface
How to find owners and transports of deleted ABAP programs
Fixing a common OPEN_FORM and START_FORM error in SAPscript
Select Text fields: Case-insensitive
Is this the quickest way to find a BADI?
Easily debug error messages in SAP processes
Accessing private attributes in ABAP Objects

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



NetWeaver SAP White Papers
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
SearchSAP.com is a search service provided by TechTarget and is completely
independent of and not affiliated with SAP AG.
  TechTarget - The IT Media ROI Experts