BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
WCF, WS, SOAP
Receiving an RPC message
Marshalling RPC With a Proxy
ISoapMessage (RPC) Interface
RPC using the NET SoapFormatter
SoapFormatter vs XmlSerializer
A Serialized SOAP Message
Retrieving Message Headers
SOAP Headers
Deserializing an Object Graph
Serializing an Object Graph
The SoapFormatter
Runtime Object Serialization
Importance of a UDDI based Service Registry
BizTalk and WCF: Part V, Publishing Operations Patterns
BizTalk and WCF: Part IV, Attachment Patterns
BizTalk and WCF: Part III, Transaction Patterns
BizTalk and WCF: Part II, Security Patterns
BizTalk and WCF: Part I, Operation Patterns
Accessing UDDI using Apache Scout APIs
Storing state in an XML property bag
<< Uncategorized
XALAN >>

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :285

 

Using the .NET SoapFormatter

SOAP RPC messages can carry message headers, just like regular messages do. We learned how to add headers to document-style message in section 13.3.4 and we saw how complicated it is to extract them out of the message later on. With RPC-style messages adding headers is just as easy as it was with document-style messages, but retrieving them is a lot easier.

Adding Headers to an RPC Message

To add headers to an RPC message we have to assign an array of Header objects to the Headers property of the ISoapMessage object we are serializing. These are the same Header objects from the System.Runtime.Remoting.Messaging namespace we used to add header entries in section 13.3.4.1. However, when we serialize an ISoapMessage object the SoapFormatter ignores any Header object passed to the Serialize() method. Only the headers in the array assigned to the Headers property of the ISoapMessage are written to the generated message. The formatter will not even add Headers passed to Serialize() when the Headers property on the interface is empty or set to null.

In our sender class we take the same approach we took previously to add a transaction ID header entry. We add it inside the Send() method like in the listing below.

Listing A Send() method to send RPC messages with headers

public void Send( ISoapMessage msg, long transactionId )

{

  msg.Headers = new Header[] { new Header("TransactionId",

      transactionId) };

  _Sender.SendObject( msg );

}


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

Software Developers Needed in Charl
Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C
Immediate ASP.NET/C# Openings for C

View all Jobs (Add yours)
View all CV (Add yours)



online faxing
swimming pool builder
online fax
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP