Adding a SOAP Header to a SOAP request in LEIF 1.2.x

Article ID: 1178
Last updated: 07 Feb, 2008
Article ID: 1178
Last updated: 07 Feb, 2008
Revision: 1
Views: 1870
Posted: 01 Jan, 2000
by Dean J.
Updated: 07 Feb, 2008
by Dean J.
Problem


In this article we will show you how to add and send SOAP headers in a SOAP request using LEIF 1.2.x.  Extracting the header on the server side is also shown in the attached example code.

 

 




Cause


LEIF 1.2.x does not support SOAP headers.  Full Support for SOAP headers was introduced in LEIF 2.x.




Action


To add the headers into request messages you must derive from the proxy and override the send() method. Fortunately, a single template class exists that will work for all proxies of a given binding.

The attached example uses the SourcePro binding. The SPSecureProxy template overrides the send() method in order to attach a header to the soap message, then it forwards to the base send() method. The template has a new method for setting user and password especially for this soap header. See SPSecureProxy.h for the template and DayOfWeekPortClient.cpp for an example of how it?s used.

On the server side, you can extract a header as shown in DayOfWeekPortTypeImpl.cpp. Note the header entry is extracted as a string. In order to retrieve the data you need to parse it, by generating a Security class from the wsse schema and using it to unmarshal. These files are modified from the DayOfWeek example. soapHeaders.zip

This article was:   Helpful | Not helpful
Report an issue
Article ID: 1178
Last updated: 07 Feb, 2008
Revision: 1
Views: 1870
Posted: 01 Jan, 2000 by Dean J.
Updated: 07 Feb, 2008 by Dean J.
Attached files


Others in this category