Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-982

webServiceTemplate.marshalSendAndReceive() is cleaning up the xmlns attribute

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.0
    • Fix Version/s: None
    • Component/s: Core, OXM
    • Labels:
      None

      Description

      I'm using xstream and setting "xmlns" attribute using @XStreamAsAttribute. It works as expected when using XStreamMarshaller#marshal(...) method. However when using webServiceTemplate.marshalSendAndReceive(...) method the xmlns attributes gets cleared out and results in empty string like: (I found out this with tracing)

      <generate xmlns="" ...
      

      Because the xml namespace changes depending on the envoirnment (dev & prod), and it seems like there's no easy way to achieve that with default jaxb marshaller. With Xstream, setting it on the attribute seems like an easier hack.

      Please help me with this, thanks.

        Activity

        beku Bilguun Bayarmagnai created issue -
        beku Bilguun Bayarmagnai made changes -
        Field Original Value New Value
        Description I'm using xstream and setting "xmlns" attribute using "@XStreamAsAttribute". It works as expected when using XStreamMarshaller#marshal(...) method. However when using webServiceTemplate.marshalSendAndReceive(...) method the xmlns attributes gets cleared out and results in empty string like: (I found out this with tracing)
        <generate xmlns="" ...

        Because the xml namespace of changes depending on the envoirnment (dev & prod), and it seems like there's no easy way to achieve that with default jaxb marshaller. With Xstream, setting it on the attribute seems like an easier hack.

        Please help me with this, thanks.
        I'm using xstream and setting "xmlns" attribute using [email protected]_. It works as expected when using _XStreamMarshaller#marshal(...)_ method. However when using _webServiceTemplate.marshalSendAndReceive(...)_ method the _xmlns_ attributes gets cleared out and results in empty string like: (I found out this with tracing)
        {code:xml}
        <generate xmlns="" ...
        {code}
        Because the xml namespace of changes depending on the envoirnment (dev & prod), and it seems like there's no easy way to achieve that with default jaxb marshaller. With Xstream, setting it on the attribute seems like an easier hack.

        Please help me with this, thanks.
        beku Bilguun Bayarmagnai made changes -
        Description I'm using xstream and setting "xmlns" attribute using [email protected]_. It works as expected when using _XStreamMarshaller#marshal(...)_ method. However when using _webServiceTemplate.marshalSendAndReceive(...)_ method the _xmlns_ attributes gets cleared out and results in empty string like: (I found out this with tracing)
        {code:xml}
        <generate xmlns="" ...
        {code}
        Because the xml namespace of changes depending on the envoirnment (dev & prod), and it seems like there's no easy way to achieve that with default jaxb marshaller. With Xstream, setting it on the attribute seems like an easier hack.

        Please help me with this, thanks.
        I'm using xstream and setting "xmlns" attribute using [email protected]_. It works as expected when using _XStreamMarshaller#marshal(...)_ method. However when using _webServiceTemplate.marshalSendAndReceive(...)_ method the _xmlns_ attributes gets cleared out and results in empty string like: (I found out this with tracing)
        {code:xml}
        <generate xmlns="" ...
        {code}
        Because the xml namespace changes depending on the envoirnment (dev & prod), and it seems like there's no easy way to achieve that with default jaxb marshaller. With Xstream, setting it on the attribute seems like an easier hack.

        Please help me with this, thanks.

          People

          • Assignee:
            Unassigned
            Reporter:
            beku Bilguun Bayarmagnai
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: