Why SOAP header is optional

Tthe Header element is optional in a SOAP message. If the Header element is present in a SOAP message, it should be the first child element of the Envelope element.

To understand why a SOAP header element is optional, consider a scenario in which you want to invoke a Web method of a Web service by using the SOAP protocol. The Web method might expect three parameters. However, to ensure that the call to the Web method is secure, you might have to encrypt the request that is sent to the Web service.

The Web method is not concerned with the encrypted information. Instead, the Web method only expects three parameters to process business logic. To have the call to the Web method decrypted before the method is executed, you can add the necessary encoded information in the Header element.

However, if the request to the Web method is sent in an unencrypted form, you might not need the Header element.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: