Results 1 to 3 of 3

Thread: For Arjen/Spring Team : Reading Nested Headers

  1. #1
    Join Date
    May 2007
    Posts
    19

    Default For Arjen/Spring Team : Reading Nested Headers

    I ran into a problem while reading nested headers with Spring WS

    My header looked like

    HTML Code:
    <SOAP-ENV:Header>
    <tns:testHeader xmlns:tns="http://mycompany.com/schema/definitions/" >
    <tns:businessTransaction> 
           <tns:Transaction> 
              <tns:TransactionName> </tns:TransactionName> 
              <tns:StartTime> </tns:StartTime>
              <tns:stopTime> </tns:stopTime>
           </tns:Transaction>
     </tns:businessTransaction>  
    </tns:testHeader>
    </SOAP-ENV:Header>
    I do not find a standard way of retrieving the nested header elements using Spring SOAP API's. Well, i can get the source and unmarshal it. But i think i will be going a step back (since the message factory took the XML and converted it into SOAP Objects already and now i choose to go back to using the XML).

    Is this a limiation of Spring Soap API's that it can't deal with nested headers or am i missing something here? I noticed that XWSSSecurityInterceptor of spring ws takes in nested headers - how does this interceptor handle it? I checked the source code for XWSSSecurityInterceptor but i am unable to find this particular logic for nested headers.

    Any inputs from the Spring experts would be nice
    Last edited by Rahul Mishra; Apr 29th, 2008 at 01:03 AM.

  2. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Spring-WS provides an abstraction over SOAP messages, making it easier to switch from SAAJ to Axiom. That abstraction results in some things being relatively hard to do, compared to the native APIs.

    What you can do, is either get the native message (cast it to SaajSoapMessage, and call getSaajMessage() or cast it to AxiomMessage, and call getAxiomMessage()), or you can transform the header Source into a DOMResult, and manipulate that.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3
    Join Date
    May 2007
    Posts
    19

    Default Nested Headers

    Thanks Arjen,

    Just wanted to know that i wasn't missing something. Your reply confirmed that.

    Will use one of the options as recommended

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •