axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roshan Weerasuriya <ros...@opensource.lk>
Subject Re: Prefixing Soap Headers
Date Wed, 05 Jan 2005 10:53:15 GMT
hi Rinsad,

The API's are added now.

Added the API methods: 

You could use a code similar to the following in a Handler: 

IHandlerSoapSerializer* pISZ; 
                pIMsg->getSoapSerializer(&pISZ); 
                                                                                         
                                                                                         
         pISZ->addNamespaceToEnvelope("http://wsaddressing.com","wsa"); 

IHeaderBlock* pIHeaderBlock= pISZ->createHeaderBlock();
                                                                                         
                                                                                         
                                                                                     pIHeaderBlock->setLocalName("echoMeString");
                            pIHeaderBlock->setUri("http://wsaddressing.com");



you will get a out come like: 

<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsa="http://wsaddressing.com">
<SOAP-ENV:Header><wsa:echoMeString>test Header
Val</wsa:echoMeString></SOAP-ENV:Header>
<SOAP-ENV:Body>
......

Roshan

On Wed, 2005-01-05 at 16:33, Rinsad Ahmed wrote:
> I require to specify the namespace, in the Envelope level and use the 
> corresponding prefix in HeaderBlocks. What I need is, when I specify the 
> namespace uri for a HeaderBlock on creation, it should search for the uri in 
> the Envelope level and put the corresponding prefix for the headerblock. 
> Currently it is not possible.
> eg:-
> <S:Envelope
>   xmlns:S="http://www.w3.org/2003/05/soap-envelope" 
>   xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
>   xmlns:f123="http://www.fabrikam123.example/svc53">
>   <S:Header>
>     <wsa:MessageID>
>       uuid:aaaabbbb-cccc-dddd-eeee-wwwwwwwwwww
>     </wsa:MessageID>
> 
> Regards
> Rinsad
> 
> 


Mime
View raw message