SOAP Headers

As you might recall from Chapter 6, your Web Service might require the client to process SOAP Headers. Perhaps the client needs to create the Header and provide your Web Service with the appropriate information. Just as likely, your Web Service will be sending the client information in addition to the result of the remote method invocation.

Listing 7.6 consumes the Visual Basic .NET Web Service from the previous chapter, which required the client to complete a Header. The value placed in the Header itself would be returned as a string to prove that the Web Service actually did read and understand the Header. Listing 7.7 shows you the equivalent C# code.

Listing 7.6. Visual Basic .NET Client SOAP Header Processing
 Imports System ...

Get Applied SOAP: Implementing .NET XML Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.