Topic
  • 4 replies
  • Latest Post - ‏2013-06-25T18:56:56Z by new haven ILL
new haven ILL
new haven ILL
26 Posts

Pinned topic Convert http Content_Type from text/xml to application/soap+xml; for soap12 Error response

‏2013-06-24T16:32:45Z |

Convert http Content_Type from text/xml to application/soap+xml; for soap12 Error response

When soap12 request is rejected (schema validation error, etc.) by datapower,
datapower (I believe Results) sets the http content-type from soap12 request http content-type:application/soap+xml to text/mll.
even though I set the correct soap12 content type as below.

<dp:set-response-header name="'Content-Type'" value="$originalContentType" />

The originalContentType is obtained from datapower service variable, and the value is correct soap12 content type.
Becasue of it, the client gets the error:
Trasport info does not match with the soap request namespace URI.
How can I set the correct soap12 content type?

  • new haven ILL
    new haven ILL
    26 Posts
    ACCEPTED ANSWER

    Re: Convert http Content_Type from text/xml to application/soap+xml; for soap12 Error response

    ‏2013-06-25T18:56:56Z  
    • HermannSW
    • ‏2013-06-25T17:37:02Z

    Hi Akiko,

    you need to do these two changes:

    1. remove Results action in error rule, set output context of xform action to OUTPUT
    2. disable Probe

    Reason for (1) is, that the XML gets serialized into PIPE context and then processed from Results action again,
    That affects Content-type.
    General rule of thumb in case of Content-type problems: try to output to OUTPUT context directly, without Results action.

    Reason for (2) is the added artificial actions to do the capturing needed when Probe is enabled.
    PIPE context becomes a real context with Probe enabled, and Content-Type handling cannot always be correct.
    Since behavior is correct with Probe disabled and Probe should never be enabled in production, above solution should be good.

    $ curl --data-binary @heaven.xml -H 'Content-Type: application/soap+xml; charset=UTF-8; action="http://www.filenet.com/ns/fnce/2006/11/ws/SOAP#GetObjects"' http://dp8-13.boeblingen.de.ibm.com:8123/cews?ait=21139 -v ; echo
    * About to connect() to dp8-13.boeblingen.de.ibm.com port 8123 (#0)
    *   Trying 9.152.92.80... connected
    * Connected to dp8-13.boeblingen.de.ibm.com (9.152.92.80) port 8123 (#0)
    > POST /cews?ait=21139 HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: dp8-13.boeblingen.de.ibm.com:8123
    > Accept: */*
    > Content-Type: application/soap+xml; charset=UTF-8; action="http://www.filenet.com/ns/fnce/2006/11/ws/SOAP#GetObjects"
    > Content-Length: 2422
    > Expect: 100-continue
    >
    < HTTP/1.1 100 Continue
    < X-Note: Gateway Ack
    < HTTP/1.1 500 Internal Server Error
    < Content-Type: application/soap+xml; charset=UTF-8; action="http://www.filenet.com/ns/fnce/2006/11/ws/SOAP#GetObjects"
    < User-Agent: IBM FileNet P8 CE Java API (5.1.0.2 / dap501.002.1002.001)
    < X-Backside-Transport: FAIL FAIL
    < Connection: close
    <
    <?xml version="1.0" encoding="UTF-8"?>

    <e:Envelope xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:fn35d="http://www.filenet.com/ns/fnce/2005/02/ws/DIME/schema" xmlns:fn35="http://www.filenet.com/ns/fnce/2005/02/ws/schema" xmlns:fn40d="http://www.filenet.com/ns/fnce/2006/11/ws/DIME/schema" xmlns:fn40m="http://www.filenet.com/ns/fnce/2006/11/ws/MTOM/schema" xmlns:fn40="http://www.filenet.com/ns/fnce/2006/11/ws/schema" xmlns:dime="http://schemas.xmlsoap.org/ws/2002/04/reference/" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:e="http://www.w3.org/2003/05/soap-envelope" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <e:Body>
    <e:Fault>
    <e:Code>
    <e:Value>e:Receiver</e:Value></e:Code>
    <e:Reason>
    <e:Text xml:lang="en-US">Results will change soap12 contentType test</e:Text></e:Reason>
    <e:Detail>
    <fn40:ErrorStack>
    <fn40:ErrorName>Results will change soap12 contentType test</fn40:ErrorName>
    <fn40:ErrorRecord>
    <fn40:Source>com.filenet.api.exception.EngineRuntimeException</fn40:Source>
    <fn40:Description>Results will change soap12 contentType test</fn40:Description>
    <fn40:Diagnostic diagnosticType="exceptionCode">0x00d30003</fn40:Diagnostic>
    <fn40:Diagnostic diagnosticType="stackTrace">HTTP/1.1 500 Internal Server Error&#13;
    Content-Type: text/xml&#13;
    X-Backside-Transport: FAIL FAIL&#13;
    Connection: close&#13;
    &#13;
    * Closing connection #0
    </fn40:Diagnostic></fn40:ErrorRecord></fn40:ErrorStack></e:Detail></e:Fault></e:Body></e:Envelope>
    $

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

    Thanks Hermann,

    I verified it. As you mentioned, I need both (1) and (2). (2) is easily missed..  now it works!

  • HermannSW
    HermannSW
    4740 Posts

    Re: Convert http Content_Type from text/xml to application/soap+xml; for soap12 Error response

    ‏2013-06-25T10:24:50Z  

    Please attach a small demonstration service export and provide a sample request.
    This will give the details missing in description above.
     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

  • new haven ILL
    new haven ILL
    26 Posts

    Re: Convert http Content_Type from text/xml to application/soap+xml; for soap12 Error response

    ‏2013-06-25T15:36:28Z  
    • HermannSW
    • ‏2013-06-25T10:24:50Z

    Please attach a small demonstration service export and provide a sample request.
    This will give the details missing in description above.
     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

    Hi Herman,

    I uploaded two files, one for tcp monitor output file and the other is mpg export zip.

    Please note that out of four rules, only the 1st and the last rules are used.

    Thanks

     

  • HermannSW
    HermannSW
    4740 Posts

    Re: Convert http Content_Type from text/xml to application/soap+xml; for soap12 Error response

    ‏2013-06-25T17:37:02Z  

    Hi Herman,

    I uploaded two files, one for tcp monitor output file and the other is mpg export zip.

    Please note that out of four rules, only the 1st and the last rules are used.

    Thanks

     

    Hi Akiko,

    you need to do these two changes:

    1. remove Results action in error rule, set output context of xform action to OUTPUT
    2. disable Probe

    Reason for (1) is, that the XML gets serialized into PIPE context and then processed from Results action again,
    That affects Content-type.
    General rule of thumb in case of Content-type problems: try to output to OUTPUT context directly, without Results action.

    Reason for (2) is the added artificial actions to do the capturing needed when Probe is enabled.
    PIPE context becomes a real context with Probe enabled, and Content-Type handling cannot always be correct.
    Since behavior is correct with Probe disabled and Probe should never be enabled in production, above solution should be good.

    $ curl --data-binary @heaven.xml -H 'Content-Type: application/soap+xml; charset=UTF-8; action="http://www.filenet.com/ns/fnce/2006/11/ws/SOAP#GetObjects"' http://dp8-13.boeblingen.de.ibm.com:8123/cews?ait=21139 -v ; echo
    * About to connect() to dp8-13.boeblingen.de.ibm.com port 8123 (#0)
    *   Trying 9.152.92.80... connected
    * Connected to dp8-13.boeblingen.de.ibm.com (9.152.92.80) port 8123 (#0)
    > POST /cews?ait=21139 HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: dp8-13.boeblingen.de.ibm.com:8123
    > Accept: */*
    > Content-Type: application/soap+xml; charset=UTF-8; action="http://www.filenet.com/ns/fnce/2006/11/ws/SOAP#GetObjects"
    > Content-Length: 2422
    > Expect: 100-continue
    >
    < HTTP/1.1 100 Continue
    < X-Note: Gateway Ack
    < HTTP/1.1 500 Internal Server Error
    < Content-Type: application/soap+xml; charset=UTF-8; action="http://www.filenet.com/ns/fnce/2006/11/ws/SOAP#GetObjects"
    < User-Agent: IBM FileNet P8 CE Java API (5.1.0.2 / dap501.002.1002.001)
    < X-Backside-Transport: FAIL FAIL
    < Connection: close
    <
    <?xml version="1.0" encoding="UTF-8"?>

    <e:Envelope xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:fn35d="http://www.filenet.com/ns/fnce/2005/02/ws/DIME/schema" xmlns:fn35="http://www.filenet.com/ns/fnce/2005/02/ws/schema" xmlns:fn40d="http://www.filenet.com/ns/fnce/2006/11/ws/DIME/schema" xmlns:fn40m="http://www.filenet.com/ns/fnce/2006/11/ws/MTOM/schema" xmlns:fn40="http://www.filenet.com/ns/fnce/2006/11/ws/schema" xmlns:dime="http://schemas.xmlsoap.org/ws/2002/04/reference/" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:e="http://www.w3.org/2003/05/soap-envelope" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <e:Body>
    <e:Fault>
    <e:Code>
    <e:Value>e:Receiver</e:Value></e:Code>
    <e:Reason>
    <e:Text xml:lang="en-US">Results will change soap12 contentType test</e:Text></e:Reason>
    <e:Detail>
    <fn40:ErrorStack>
    <fn40:ErrorName>Results will change soap12 contentType test</fn40:ErrorName>
    <fn40:ErrorRecord>
    <fn40:Source>com.filenet.api.exception.EngineRuntimeException</fn40:Source>
    <fn40:Description>Results will change soap12 contentType test</fn40:Description>
    <fn40:Diagnostic diagnosticType="exceptionCode">0x00d30003</fn40:Diagnostic>
    <fn40:Diagnostic diagnosticType="stackTrace">HTTP/1.1 500 Internal Server Error&#13;
    Content-Type: text/xml&#13;
    X-Backside-Transport: FAIL FAIL&#13;
    Connection: close&#13;
    &#13;
    * Closing connection #0
    </fn40:Diagnostic></fn40:ErrorRecord></fn40:ErrorStack></e:Detail></e:Fault></e:Body></e:Envelope>
    $

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

  • new haven ILL
    new haven ILL
    26 Posts

    Re: Convert http Content_Type from text/xml to application/soap+xml; for soap12 Error response

    ‏2013-06-25T18:56:56Z  
    • HermannSW
    • ‏2013-06-25T17:37:02Z

    Hi Akiko,

    you need to do these two changes:

    1. remove Results action in error rule, set output context of xform action to OUTPUT
    2. disable Probe

    Reason for (1) is, that the XML gets serialized into PIPE context and then processed from Results action again,
    That affects Content-type.
    General rule of thumb in case of Content-type problems: try to output to OUTPUT context directly, without Results action.

    Reason for (2) is the added artificial actions to do the capturing needed when Probe is enabled.
    PIPE context becomes a real context with Probe enabled, and Content-Type handling cannot always be correct.
    Since behavior is correct with Probe disabled and Probe should never be enabled in production, above solution should be good.

    $ curl --data-binary @heaven.xml -H 'Content-Type: application/soap+xml; charset=UTF-8; action="http://www.filenet.com/ns/fnce/2006/11/ws/SOAP#GetObjects"' http://dp8-13.boeblingen.de.ibm.com:8123/cews?ait=21139 -v ; echo
    * About to connect() to dp8-13.boeblingen.de.ibm.com port 8123 (#0)
    *   Trying 9.152.92.80... connected
    * Connected to dp8-13.boeblingen.de.ibm.com (9.152.92.80) port 8123 (#0)
    > POST /cews?ait=21139 HTTP/1.1
    > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    > Host: dp8-13.boeblingen.de.ibm.com:8123
    > Accept: */*
    > Content-Type: application/soap+xml; charset=UTF-8; action="http://www.filenet.com/ns/fnce/2006/11/ws/SOAP#GetObjects"
    > Content-Length: 2422
    > Expect: 100-continue
    >
    < HTTP/1.1 100 Continue
    < X-Note: Gateway Ack
    < HTTP/1.1 500 Internal Server Error
    < Content-Type: application/soap+xml; charset=UTF-8; action="http://www.filenet.com/ns/fnce/2006/11/ws/SOAP#GetObjects"
    < User-Agent: IBM FileNet P8 CE Java API (5.1.0.2 / dap501.002.1002.001)
    < X-Backside-Transport: FAIL FAIL
    < Connection: close
    <
    <?xml version="1.0" encoding="UTF-8"?>

    <e:Envelope xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:fn35d="http://www.filenet.com/ns/fnce/2005/02/ws/DIME/schema" xmlns:fn35="http://www.filenet.com/ns/fnce/2005/02/ws/schema" xmlns:fn40d="http://www.filenet.com/ns/fnce/2006/11/ws/DIME/schema" xmlns:fn40m="http://www.filenet.com/ns/fnce/2006/11/ws/MTOM/schema" xmlns:fn40="http://www.filenet.com/ns/fnce/2006/11/ws/schema" xmlns:dime="http://schemas.xmlsoap.org/ws/2002/04/reference/" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:e="http://www.w3.org/2003/05/soap-envelope" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <e:Body>
    <e:Fault>
    <e:Code>
    <e:Value>e:Receiver</e:Value></e:Code>
    <e:Reason>
    <e:Text xml:lang="en-US">Results will change soap12 contentType test</e:Text></e:Reason>
    <e:Detail>
    <fn40:ErrorStack>
    <fn40:ErrorName>Results will change soap12 contentType test</fn40:ErrorName>
    <fn40:ErrorRecord>
    <fn40:Source>com.filenet.api.exception.EngineRuntimeException</fn40:Source>
    <fn40:Description>Results will change soap12 contentType test</fn40:Description>
    <fn40:Diagnostic diagnosticType="exceptionCode">0x00d30003</fn40:Diagnostic>
    <fn40:Diagnostic diagnosticType="stackTrace">HTTP/1.1 500 Internal Server Error&#13;
    Content-Type: text/xml&#13;
    X-Backside-Transport: FAIL FAIL&#13;
    Connection: close&#13;
    &#13;
    * Closing connection #0
    </fn40:Diagnostic></fn40:ErrorRecord></fn40:ErrorStack></e:Detail></e:Fault></e:Body></e:Envelope>
    $

     

    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

    Thanks Hermann,

    I verified it. As you mentioned, I need both (1) and (2). (2) is easily missed..  now it works!