none
Multiple Headers with name 'RelatesTo' in response RRS feed

  • Question

  • I am invoking a 3rd party web service which happens to be built in Java/AXIS.  I am using WCF by way of BizTalk Server.  Generally speaking, it works.  Successful requests are handled just fine.  However when the service throws a Fault, WCF doesn't seem to like it because in the header of the fault, there are two 'RelatesTo' headers like so:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
          <wsa:Action>urn:getStudentTranscriptOCASExportServiceException</wsa:Action>
          <wsa:RelatesTo>urn:uuid:7275c97e-45e3-4f9c-9a0e-2a1d7cccd163</wsa:RelatesTo>
          <wsa:MessageID>urn:uuid:7275c97e-45e3-4f9c-9a0e-2a1d7cccd163</wsa:MessageID>
          <wsa:RelatesTo>urn:uuid:7275c97e-45e3-4f9c-9a0e-2a1d7cccd163</wsa:RelatesTo>
       </soapenv:Header>
       <soapenv:Body>
          <soapenv:Fault xmlns:axis2ns492="http://schemas.xmlsoap.org/soap/envelope/">
             <faultcode>axis2ns492:err.student_not_found</faultcode>
             <faultstring>Student record not found.</faultstring>
             <detail/>
          </soapenv:Fault>
       </soapenv:Body>
    </soapenv:Envelope>

    When the fault is received and handled, I get the following exception:
    System.ServiceModel.MessageHeaderException: Multiple headers with name 'RelatesTo' and namespace 'http://www.w3.org/2005/08/addressing' found.


    According to the provider of the service, this is valid, and they reference the below link at w3.org

    http://www.w3.org/Submission/ws-addressing/


    1) Is this actually valid?

    2) Does WCF handle this in some way? 

    If there is a way to handle this, I would like to know if it is possible without writing some exotic code.  Currently I am using a basic binding with the native WCF adapter in BizTalk and would prefer not to do anything else. 

     

    Thursday, May 16, 2013 1:21 PM

Answers

All replies

  • Hi, from the document you need set the RelationshipType, these two cannot be exatcly the same.
    Friday, May 17, 2013 8:33 AM
  • Thank you Nico_He.  From my reading of the document it does not seem to specify that the RelationshipType needs to be explicitly set or that the two RelatesTo fields cannot be identical, simply that more than one is allowed and the RelationshipType can be specified if the default value is not desired. 

    I have been trying to find examples or other documentation which expands on this, however it does appear to be open to interpretation.  I agree that it is silly that the service provider has implemented it in this way, but strictly speaking I don't think they have violated the rules of the spec.  The xml soap response also is valid according to the schemas for SOAP envelope and ws-addressing.

    In the interest of interoperability, it seems to me that WCF should handle this case, unless I can find evidence that this goes against the SOAP spec.

    Friday, May 17, 2013 5:33 PM
  • Hi, for this issue, you would post a feature request at http://aspnet.uservoice.com/forums/147206-wcf-web-services-
    Monday, May 20, 2013 2:47 AM