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


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


      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"

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

      <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"/>

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


        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        7d 6h 35m 1 Arjen Poutsma 02/Jun/09 1:08 AM
        In Progress In Progress Resolved Resolved
        20m 56s 1 Arjen Poutsma 02/Jun/09 1:29 AM
        Resolved Resolved Closed Closed
        1067d 5h 34m 1 Arjen Poutsma 04/May/12 7:03 AM


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


            • Created: