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

HTTP Accept header field contains invalid type, and omits text/xml

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.7
    • Fix Version/s: 1.5.8
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Spring/WS client,

      Description

      The Spring-WS client sends an HTTP Accept request-header field that is invalid according to the HTTP 1.1 spec.

      The header that the Spring-WS client sends is:

      Accept: text/html, image/gif, image/jpeg, ; q=.2, */; q=.2

      The fourth media-range in this field does not include the mandatory "/" and subtype.

      The definition of the Accept header in the HTTP 1.1 spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html) is:

      Accept = "Accept" ":"
      #( media-range [ accept-params ] )

      media-range = ( "/"

      ( type "/" "*" )
      ( type "/" subtype )
      ) *( ";" parameter )

      I would have also expected the Accept header field to contain "text/xml" explicitly (for SOAP 1.1), and not to Accept "text/html", "image/gif" or "image/jpeg".

      My spring-client-context.xml is:

      <?xml version="1.0" encoding="UTF-8"?>

      <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans.xsd">

      <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
      <property name="payloadCaching" value="false" />
      </bean>

      <bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate">
      <property name="marshaller" ref="marshaller" />
      <property name="unmarshaller" ref="marshaller" />
      <property name="defaultUri" value="http://localhost:8079/jibx-ws-seismic/soap/quake-service" />
      <property name="messageFactory" ref="messageFactory"/>
      </bean>

      <!-- A JiBX-based payload marshaller/unmarshaller. -->
      <bean id="marshaller" class="org.springframework.oxm.jibx.JibxMarshaller">
      <property name="targetClass" value="com.sosnoski.seismic.common.Query" />
      </bean>
      </beans>

        Activity

        nigel.charman Nigel Charman created issue -
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Fix Version/s 1.5.8 [ 11236 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        arjen.poutsma Arjen Poutsma made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Resolved [ 5 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            nigel.charman Nigel Charman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: