Announcement Announcement Module
Collapse
No announcement yet.
Content-Type header Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Content-Type header

    Hi All,
    Just wondering if someone can point me n the direction of some documentation which may relate to why I am not seeing any Content-Type header being set in successful responses? (I have confirmed this using tcpdump as well - everything else looks fine).

    In addition I am seeing a Content-Type of text/html going back when getting faults.

    Both of these issues are effecting connectivity to .NET clients which throw exceptions for bad header types, in my current project cross language/platform support for Java, .NET and even C is very important.

    Current version of spring-ws in use is spring-ws-core-1.0-m2-SNAPSHOT from spring-ws-release-1.0-m2-20060803.010008-8-release.zip

    I am using the Jaxb2 Marshaller if that is of importance and my endpoint resolver config is:

    <bean id="endpointExceptionResolver" class="org.springframework.ws.soap.endpoint.SoapFa ultMappingExceptionResolver">
    <description>
    This exception resolver maps exceptions to SOAP Faults. Both UnmarshallingException and ValidationFailureException are mapped to a SOAP Fault with a "Sender" fault code.
    All other exceptions are mapped to a "Receiver" error code, the default.
    </description>
    <property name="defaultFault">
    <value>RECEIVER,Server error</value>
    </property>
    <property name="exceptionMappings">
    <props>
    <prop key="org.springframework.oxm.UnmarshallingFailureE xception">SENDER,Invalid request</prop>
    <prop key="org.springframework.oxm.ValidationFailureExce ption">SENDER,Invalid request</prop>
    </props>
    </property>
    </bean>

  • #2
    Additionally my logging is showing null being returned for ModelandView which will be my problem.
    2006-08-15 13:51:02,833 DEBUG [org.apache.axis.i18n.ProjectResourceBundle] - org.apache.axis.i18n.resource::handleGetObject(cur rForm)
    2006-08-15 13:51:02,833 DEBUG [org.apache.axis.SOAPPart] - current form is FORM_SOAPENVELOPE
    2006-08-15 13:51:02,918 DEBUG [org.springframework.ws.soap.SoapMessageDispatcher] - MessageDispatcher with name 'messageDispatcher' sends response [org.springframework.ws.soap.saaj.SaajSoapMessage@1 e55d39]
    2006-08-15 13:51:02,918 DEBUG [org.apache.axis.SOAPPart] - Enter: SOAPPart::saveChanges
    2006-08-15 13:51:02,992 DEBUG [org.apache.axis.i18n.ProjectResourceBundle] - org.apache.axis.i18n.resource::handleGetObject(reg ister00)
    2006-08-15 13:51:02,992 DEBUG [org.apache.axis.encoding.SerializationContext] - register 'soapenv' - 'http://schemas.xmlsoap.org/soap/envelope/'
    2006-08-15 13:51:02,992 DEBUG [org.apache.axis.i18n.ProjectResourceBundle] - org.apache.axis.i18n.resource::handleGetObject(reg ister00)
    2006-08-15 13:51:02,992 DEBUG [org.apache.axis.encoding.SerializationContext] - register 'soapenv' - 'http://schemas.xmlsoap.org/soap/envelope/'
    2006-08-15 13:51:02,992 DEBUG [org.apache.axis.i18n.ProjectResourceBundle] - org.apache.axis.i18n.resource::handleGetObject(reg ister00)
    2006-08-15 13:51:02,993 DEBUG [org.apache.axis.encoding.SerializationContext] - register 'xsd' - 'http://www.w3.org/2001/XMLSchema'
    <snip>
    2006-08-15 13:51:03,029 DEBUG [org.apache.axis.SOAPPart] - Setting current message form to: FORM_OPTIMIZED (currentMessage is now org.apache.axis.utils.ByteArray)
    2006-08-15 13:51:03,029 DEBUG [org.apache.axis.SOAPPart] - Exit: SOAPPart::saveChanges(): org.apache.axis.utils.ByteArray@14b525c
    2006-08-15 13:51:03,029 DEBUG [org.apache.axis.SOAPPart] - Enter: SOAPPart::saveChanges
    2006-08-15 13:51:03,029 DEBUG [org.apache.axis.SOAPPart] - Enter: SOAPPart::saveChanges
    2006-08-15 13:51:03,029 DEBUG [org.springframework.web.servlet.DispatcherServlet] - Null ModelAndView returned to DispatcherServlet with name 'ws': assuming HandlerAdapter completed request handling
    2006-08-15 13:51:03,032 DEBUG [org.springframework.web.servlet.DispatcherServlet] - Cleared thread-bound request context: org.apache.coyote.tomcat5.CoyoteRequestFacade@fde0 50
    2006-08-15 13:51:03,032 DEBUG [org.springframework.web.servlet.DispatcherServlet] - Successfully completed request
    2006-08-15 13:51:03,034 DEBUG [org.springframework.web.context.support.XmlWebAppl icationContext] - Publishing event in context [WebApplicationContext for namespace 'ws-servlet']: ServletRequestHandledEvent: url=[/ws]; client=[192.168.0.2]; method=[POST]; servlet=[ws]; session=[null]; user=[null]; time=[964ms]; status=[OK]
    2006-08-15 13:51:03,034 DEBUG [org.springframework.web.context.support.XmlWebAppl icationContext] - Publishing event in context [Root WebApplicationContext]: ServletRequestHandledEvent: url=[/ws]; client=[192.168.0.2]; method=[POST]; servlet=[ws]; session=[null]; user=[null]; time=[964ms]; status=[OK]

    Here is a typical request/response from soapUI:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.somewhere.edu.au/iam/sessionValidation/schemas">
    <soapenv:Body>
    <sch:sessionValidationRequest>
    <sch:sessionIdentifier>12345</sch:sessionIdentifier>
    <schepIPv4Address>12345</schepIPv4Address>
    <schepIPv6Address>12345</schepIPv6Address>
    </sch:sessionValidationRequest>
    </soapenv:Body>
    </soapenv:Envelope>

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <ns2:sessionValidationResponse xmlns="http://www.somewhere.edu.au/iam/schemas/standardIdentity" xmlns:ns2="http://www.somewhere.edu.au/iam/sessionValidation/schemas" xmlns:ns3="http://www.somewhere.edu.au/iam/schemas/eduPerson" xmlns:ns4="http://www.somewhere.edu.au/iam/schemas/qutEduAuPerson">
    <ns2:standardIdentity>
    <ns1:mail xmlns:ns1="http://www.somewhere.edu.au/iam/schemas/standardIdentity">[email protected]</ns1:mail>
    <ns3:uid xmlns:ns3="http://www.somewhere.edu.au/iam/schemas/standardIdentity">someone</ns3:uid>
    </ns2:standardIdentity>
    <ns2:eduPerson/>
    <ns2:qutEduAuPerson/>
    </ns2:sessionValidationResponse>
    </soapenv:Body>
    </soapenv:Envelope>

    The WSDL looks like:
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="esoe"
    targetNamespace="http://www.somewhere.edu.au/iam/esoe/definitions"
    xmlns:tns="http://www.somewhere.edu.au/iam/esoe/definitions"
    xmlns:types="http://www.somewhere.edu.au/iam/sessionValidation/schemas"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

    <types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
    <xsd:import namespace="http://www.somewhere.edu.au/iam/sessionValidation/schemas" schemaLocation="sessionValidation.xsd" />
    </xsd:schema>
    </types>

    <message name="SessionValidationRequest">
    <part element="types:sessionValidationRequest" name="body" />
    </message>
    <message name="SessionValidationResponse">
    <part element="types:sessionValidationResponse" name="body" />
    </message>

    <portType name="esoe-client">
    <operation name="sessionValidation">
    <input message="tns:SessionValidationRequest" />
    <output message="tns:SessionValidationResponse" />
    </operation>
    </portType>

    <binding name="sessionValidationSOAP" type="tns:esoe-client">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="sessionValidation">
    <soap:operation soapAction="http://www.somewhere.edu.au/iam/ws/sessionValidation" />
    <input>
    <soap:body use="literal" />
    </input>
    <output>
    <soap:body use="literal" />
    </output>
    </operation>
    </binding>

    <service name="iam">
    <port binding="tns:sessionValidationSOAP" name="iamSOAP">
    <soap:address location="http://dev.somewhere.edu.au:8080/ws" />
    </port>
    </service>

    </definitions>

    Comment


    • #3
      It might be due to the fact that you are using the Axis 1 version of SAAJ. You could try to use the reference implementation, and see if that solves that.

      That null is returned as a ModelAndView is not a problem, it just means that the response is directly written to the HttpServletResponse.

      Comment


      • #4
        Hi,
        The reference implementation did fix this particular issue.

        I realise you ship this with spring-ws but as you probably well know Spring ships with the axis version of saaj which is what I was using to get this error.

        It seems weird to me that a sub project is redistributing dependancies which are 'solved' by the main project, is there any possibility of having the reference saaj impl ship with Spring 2.0 instead of the axis version?

        Comment


        • #5
          Welcome to the Java dependencies hell! ;-)

          Spring itself uses Axis because it depends on JAX-RPC (which SWS does not). SWS depends of the reference implementation because that it the only SAAJ implementation that implements SAAJ 1.3. So neither can Spring depend on the reference impl, nor SWS depend on Axis.

          I will add a check, though, to see whether the Content/Type is set.

          Comment


          • #6

            I am already well aware of dependancies hell trust me on that.

            Not being intimately aware of the differences between the specs/versions of saaj I guess I was hoping that the 1.3 version was backwards compatible such that the axis 1 code that the main spring implementation is reliant upon for JAX-RPC could consume it without problem.

            Comment


            • #7
              I've created an issue, which has been fixed in SVN.

              Comment

              Working...
              X