ASP.NET
  Home arrow ASP.NET arrow Page 9 - ASP.NET and Web Services, Part 1
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

ASP.NET and Web Services, Part 1
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 9
    2004-03-08

    Table of Contents:
  • ASP.NET and Web Services, Part 1
  • What Is a Web Service?
  • Creating a Web Service
  • Defining a Service-Oriented Architecture (SOA)
  • SOA Web Services
  • Primary Web Services Technologies
  • SOAP's Messaging Architecture
  • Other SOAP Attributes
  • More SOAP Attributes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    ASP.NET and Web Services, Part 1 - More SOAP Attributes


    (Page 9 of 9 )

    The Actor Attribute

    The Actor attribute provides a mechanism for annotating SOAP headers. For example, a document can be routed to an intermediary that will create a transaction, specifying the URI for the intermediary for which a portion of the message is intended.
    If the header is destined for processing by the next recipient of a SOAP message, set both the mustUnderstand attribute and the Actor attribute. Listing 4 demonstrates how to do this.

    Listing 4 Setting the next recipient


    <?xml version="1.0" encoding="utf-8"? >
    <soap:Envelope xmlns:soap="http:////schemas.xmlsoap.org/soap/envelope/">
      
    <soap:Header>
        
    <TransactionID soap:mustUnderstand="1"
    actor
    ="urn:TransactionCoordinator>19.90</TransactionID>
      </soapHeader>
      <soap:Body>
        <UpdateStockQuote>
          <Source>102420484096</Source>
          <Destination>102420484096</Destination>
          <Price>12.95></Price>
        </AddNewClient>
      </soap:Body>
    </soap:Envelope>

    If the TransactionCoordinator does not know how to interpret this message, it raises an error. The directive does not belong in this message. This is evidenced by lack of a corresponding opening tag. Before the message is passed on, all foreign elements must be removed. However, the intermediary can add header elements before forwarding the message to the next intermediary or final recipient.

    The Body Element

    All SOAP messages must have exactly one element. The body element contains the payload. There are some constraints on how the body is encoded. The payload can consist of a string of ASCII characters, a byte array, or XML text. However, the contents may not contain any characters that would invalidate the embedded XML document. XML messages can be placed in two categories: document-oriented messages and procedure-oriented messages. For example, a document that provides a stock quote to a client can be encoded within the body of a SOAP message and specify a particular
    routing for an intended recipient. The procedure-oriented messages offer two-way communications and are frequently referred to as RPC messages.

    The Fault Element

    SOAP messages fail for a number of reasons. It is important to use the Fault attribute and generate an error message back to a client. SOAP specifies a format for handling errors. Listing 5 demonstrates this.

    Listing 5 Web services error handling


    <?xml version="1.0" encoding="utf-8"? >
    <soap:Envelope xmlns:soap="http:////schemas.xmlsoap.org/soap/envelope/">
      
    <soap:Body>
        
    <soap:Fault>
          
    <soap:FaultCode>Client.Security</soap:faultcode>
          
    <soap:faultstring>Access denied</soap:faultstring>
          
    <soap:faultactor>http://dps.com</soap:faultactor>
          <soap:detail>
            <myError>
              <Originator>File System></Originator>
              <Resource>My File.txt></Resource>
            </myError>
          </soap:detail>
        </soap:Fault>
      </soap:Body>
    </soap:Envelope>



    The Faultcode contains a value to determine the kind of error it encounters. Several fault codes are available for use:

    • Version Mismatch This specifies an invalid namespace declared for the SOAP envelope.

    • MustUnderstand A child element residing within the SOAP header contains a mustUnderstand attribute. If the attribute is set to 1, it indicates the attribute was not understood.

    • Client Content located within the message body was found to be faulty.

    • Server The server determines that the error lies with the inability to obtain resources or the inability to process the message.

    The SOAP features presented here must be adhered to when processing SOAP messages. The next major web services technology, Web Services Description Language (WSDL), describes what a SOAP payload contains.

    Remember: This is part one of chapter 7 .NET & J2EE Interoperability, by Dwight Peltzer (McGraw-Hill/Osborne, ISBN 0-07-223054-1, 2004). If you like what you see, feel free to click on the following link to get your own copy!
    Buy this book now.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    ASP.NET ARTICLES

    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT