Announcement Announcement Module
Collapse
No announcement yet.
Change namespace of SOAP messages Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change namespace of SOAP messages

    Hi!
    Right now, the namespace of my SOAP messages is http://schemas.xmlsoap.org/soap/envelope/.
    However, I need to use http://www.w3.org./2003/05/soap-envelope instead.
    Is there an easy way to set this?

  • #2
    I've now managed to get the service to reply with the http://www.w3.org./2003/05/soap-envelope namespace using the following configuration:
    Code:
        <bean class="org.springframework.jms.listener.DefaultMessageListenerContainer">
            <property name="messageListener">
                <bean class="org.springframework.ws.transport.jms.WebServiceMessageListener">
                    <property name="messageFactory" ref="messageFactory"/>
                    <property name="messageReceiver" ref="messageDispatcher"/>
                </bean>
            </property>
        </bean>
    
        <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
            <property name="messageFactory">
                <bean class="com.sun.xml.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl"/>
            </property>
            <property name="soapVersion">
                <util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_12"/>
            </property>
        </bean>
    
        <bean id="messageDispatcher" class="org.springframework.ws.soap.server.SoapMessageDispatcher">
        <property name="endpointMappings">
          <list>
            <ref  bean="endpointMapping"/>
          </list>
        </property>
        <property name="endpointExceptionResolvers">
          <list>
            <ref local="simpleSoapExceptionResolver"/>
          </list>
        </property>
      </bean>
    However, it will still only accept messages in the http://schemas.xmlsoap.org/soap/envelope/ namespace. If I use the other I get an error stating "Could not access envelope: Unable to create envelope from given source because the namespace was not recognized; nested exception is com.sun.xml.messaging.saaj.soap.SOAPVersionMismatc hException: Unable to create envelope from given source because the namespace was not recognized".

    I guess I have to configure the messageDispatcher like I did with the messageFactory? I can't figure out how, though.
    Please help!

    Comment


    • #3
      Bah. After a full day of debugging and searching the net for clues, it turns out an extra dot had snuck into the SOAP namespace of my test message :P

      Comment

      Working...
      X