Topic
  • 36 replies
  • Latest Post - ‏2013-10-04T09:57:13Z by DPUser77
DPUser77
DPUser77
70 Posts

Pinned topic How to add Proxy Policy attribute to dp : url-open()

‏2013-04-25T10:25:02Z |

Hi,

We are trying to add a scheduled processing rule to test the connectivity to the backend (as we have a specific operation in wsdl for that).

I am trying to use dp : url open()  for making a side call to test the connectivity every 30 minutes .But as we are connecting to the backend using a proxy policy, I am not able to use the same while accessing the Baceknd url.

Please let me know if we can use a proxy policy in dp: url -open ().

 

Updated on 2013-04-25T10:28:14Z at 2013-04-25T10:28:14Z by DPUser77
  • swlinn
    swlinn
    1348 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-04-25T12:55:09Z  

    In your service's user agent (attached to your xml manager) you can specify the proxy information associated with a url.  In your url-open, the url of that request will be matched.  The user agent will redirect the request to your proxy and will place your desired url in the HTTP header so the proxy can forward your request.

    Regards,

    Steve

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-04-25T13:11:28Z  
    • swlinn
    • ‏2013-04-25T12:55:09Z

    In your service's user agent (attached to your xml manager) you can specify the proxy information associated with a url.  In your url-open, the url of that request will be matched.  The user agent will redirect the request to your proxy and will place your desired url in the HTTP header so the proxy can forward your request.

    Regards,

    Steve

    Thanks Steve for a quick reply.

    "In your url-open, the url of that request will be matched" ~ We already have a matching action of the URL in user agent  to connect to the backend along with the Port and Host.

    But  how i can do this in dp:url-open (). As i cannot find any attribute to do that.

    And also does dp:url open uses an xml manager mentioned in the service ?

    Please correct me if i am wrong.

  • swlinn
    swlinn
    1348 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-04-25T13:32:13Z  
    • DPUser77
    • ‏2013-04-25T13:11:28Z

    Thanks Steve for a quick reply.

    "In your url-open, the url of that request will be matched" ~ We already have a matching action of the URL in user agent  to connect to the backend along with the Port and Host.

    But  how i can do this in dp:url-open (). As i cannot find any attribute to do that.

    And also does dp:url open uses an xml manager mentioned in the service ?

    Please correct me if i am wrong.

    You don't need to do anything in the url-open.  The user agent will take care of your backside and url-open requests.  If you have a proxy for say your url-open url but not your backside url, then your match url  expression would need to be specific to your url-open url.

    So when you say you have a user agent matching to connect to the backend with port/host, I'm assuming on the Proxy Policies tab of the user agen has been configured for your backend url which requires a proxy?  If that match does not also include your url-open url, you'll need to add another url to your Proxy Policies tab.  If my assumption isn't correct, please attach a screen shot to help me understand further.

    Regards,

    Steve

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-04-25T14:50:57Z  
    • swlinn
    • ‏2013-04-25T13:32:13Z

    You don't need to do anything in the url-open.  The user agent will take care of your backside and url-open requests.  If you have a proxy for say your url-open url but not your backside url, then your match url  expression would need to be specific to your url-open url.

    So when you say you have a user agent matching to connect to the backend with port/host, I'm assuming on the Proxy Policies tab of the user agen has been configured for your backend url which requires a proxy?  If that match does not also include your url-open url, you'll need to add another url to your Proxy Policies tab.  If my assumption isn't correct, please attach a screen shot to help me understand further.

    Regards,

    Steve

    Steve,

    You are correct. But as i mentioned earlier my backend url and side call url are same. And we are able to get a proper response and connect  via backend url. so URL Matching expression will be same as backend call

    But now an additional thing came up that we need to  keep checking the connectivity for that url in every 10 minutes and raise a ticket in case of Backend down to avoid any issue during actual transaction.

    So i thought of implmenting a scheduled policy rule to check that.

    Please corect me , if i am using a wrong approach.

    And thanks for replying quickly.

  • swlinn
    swlinn
    1348 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-04-25T16:22:49Z  
    • DPUser77
    • ‏2013-04-25T14:50:57Z

    Steve,

    You are correct. But as i mentioned earlier my backend url and side call url are same. And we are able to get a proper response and connect  via backend url. so URL Matching expression will be same as backend call

    But now an additional thing came up that we need to  keep checking the connectivity for that url in every 10 minutes and raise a ticket in case of Backend down to avoid any issue during actual transaction.

    So i thought of implmenting a scheduled policy rule to check that.

    Please corect me , if i am using a wrong approach.

    And thanks for replying quickly.

    Ok, I'd missed that the same url is working as your backend but failing when you're using the url-open from a transformation of a scheduled rule.  What is different is what is in the HTTP header for your backend call versus your url-open call, so are you attempting in your url-open to recreate the HTTP headers you would normally send to the backend?  I would think the user agent should be working the same regardless of backend or url-open with respect to the proxy policies settings.  What are you seeing as a cause of the failure from the url-open?  Is the request not getting to the proxy?  or is the request getting to the proxy and failing for another reason? Perhaps a packet capture would be in order to get some clues as to why the url-open request is failing.

    Regards,

    Steve

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-04-25T17:40:30Z  
    • swlinn
    • ‏2013-04-25T16:22:49Z

    Ok, I'd missed that the same url is working as your backend but failing when you're using the url-open from a transformation of a scheduled rule.  What is different is what is in the HTTP header for your backend call versus your url-open call, so are you attempting in your url-open to recreate the HTTP headers you would normally send to the backend?  I would think the user agent should be working the same regardless of backend or url-open with respect to the proxy policies settings.  What are you seeing as a cause of the failure from the url-open?  Is the request not getting to the proxy?  or is the request getting to the proxy and failing for another reason? Perhaps a packet capture would be in order to get some clues as to why the url-open request is failing.

    Regards,

    Steve

    Steve,

    We are putting the same headers in the URL open also like a soap action is required for the backend. but getting a null response.

    Packet capture option looks for the request going out of DP right and not out of the server.

    Am i doing the right way or there is any other possible solution for my requirement.

    Thanks again for replying quickly, as i need to provide a report asap on this issue

  • swlinn
    swlinn
    1348 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-04-25T17:58:31Z  
    • DPUser77
    • ‏2013-04-25T17:40:30Z

    Steve,

    We are putting the same headers in the URL open also like a soap action is required for the backend. but getting a null response.

    Packet capture option looks for the request going out of DP right and not out of the server.

    Am i doing the right way or there is any other possible solution for my requirement.

    Thanks again for replying quickly, as i need to provide a report asap on this issue

    The packet capture will show traffic going to and from the appliance.  You can restrict the traffic to just that between your backend by specifying "host x.y.z.w" in the filter.  You should be able to see the HTTP status codes of the response and any data (binary or otherwise) coming from the backend.

    Regards,

    Steve

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-04-25T21:49:02Z  
    • swlinn
    • ‏2013-04-25T17:58:31Z

    The packet capture will show traffic going to and from the appliance.  You can restrict the traffic to just that between your backend by specifying "host x.y.z.w" in the filter.  You should be able to see the HTTP status codes of the response and any data (binary or otherwise) coming from the backend.

    Regards,

    Steve

    Steve,

    You were correct, there seems to be no issue with proxy policy. As i removed one of the required SOAPAction headers and it gave me a Remote error on the url. So i guess i am able to reach the Backend server.

    With correct SOAPAction header, when i made the response as "responsecode" in url open. It gave 

     response code - 500  ,error code -196609,

    error string   - illegal character  "-" at offset 2 of "Backend URL"

    i looked  into my request again , it was fine. Google says that some issue related to mime boundary http://www-01.ibm.com/support/docview.wss?uid=swg21328662 . but i am not able to figure that out.

    Do you have any idea on this.

  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-04-26T02:05:44Z  
    • DPUser77
    • ‏2013-04-25T21:49:02Z

    Steve,

    You were correct, there seems to be no issue with proxy policy. As i removed one of the required SOAPAction headers and it gave me a Remote error on the url. So i guess i am able to reach the Backend server.

    With correct SOAPAction header, when i made the response as "responsecode" in url open. It gave 

     response code - 500  ,error code -196609,

    error string   - illegal character  "-" at offset 2 of "Backend URL"

    i looked  into my request again , it was fine. Google says that some issue related to mime boundary http://www-01.ibm.com/support/docview.wss?uid=swg21328662 . but i am not able to figure that out.

    Do you have any idea on this.

    Hi,

    it seems that the returned response is a MIME message.
    Failing at offset 2 may indicate that these are the first bytes, please confirm:
    0x0D 0x0A 0x2D ...

    DataPower allows you to process MIME messages from client as well as from backend.

    There is no built in support for processing MIME messages by <dp:url-open>.

    But you can at least process it with  response="binaryNode".
    You have to do processing of the binaryNode yourself then, see these two related WSTE webcasts:
    http://www-01.ibm.com/support/docview.wss?uid=swg27022977
    http://www-01.ibm.com/support/docview.wss?uid=swg27022979

    Alternatively you can access the backend by <dp:url-open> through a chained service that is able to deal with MIME responses.
     

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

    Updated on 2013-04-26T02:08:31Z at 2013-04-26T02:08:31Z by HermannSW
  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-04-26T11:41:19Z  
    • HermannSW
    • ‏2013-04-26T02:05:44Z

    Hi,

    it seems that the returned response is a MIME message.
    Failing at offset 2 may indicate that these are the first bytes, please confirm:
    0x0D 0x0A 0x2D ...

    DataPower allows you to process MIME messages from client as well as from backend.

    There is no built in support for processing MIME messages by <dp:url-open>.

    But you can at least process it with  response="binaryNode".
    You have to do processing of the binaryNode yourself then, see these two related WSTE webcasts:
    http://www-01.ibm.com/support/docview.wss?uid=swg27022977
    http://www-01.ibm.com/support/docview.wss?uid=swg27022979

    Alternatively you can access the backend by <dp:url-open> through a chained service that is able to deal with MIME responses.
     

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

    Hermann,

    Thanks for replying.

    It checked for that it is 0x30001, which says that A function that operates on the current message (e.g., vcePlay) was called when there was no current message. 

    But I am confused like when we are using a static backend at that URL it is giving proper soap response.

    I am getting a similar error which is mentioned in the below discussion.

    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014297074

    I am not able to understand the binaryNode handle part you suggested.

  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-04-26T15:10:42Z  
    • DPUser77
    • ‏2013-04-26T11:41:19Z

    Hermann,

    Thanks for replying.

    It checked for that it is 0x30001, which says that A function that operates on the current message (e.g., vcePlay) was called when there was no current message. 

    But I am confused like when we are using a static backend at that URL it is giving proper soap response.

    I am getting a similar error which is mentioned in the below discussion.

    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014297074

    I am not able to understand the binaryNode handle part you suggested.

    To get this further, please attach packet captures

    • with static backend
    • with using dp:url-open

    These captures will allow to help you.

    If you cannot attach here, please create a PMR and Level2 support will collect the needed data from you.
     

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

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-06T10:03:27Z  
    • HermannSW
    • ‏2013-04-26T15:10:42Z

    To get this further, please attach packet captures

    • with static backend
    • with using dp:url-open

    These captures will allow to help you.

    If you cannot attach here, please create a PMR and Level2 support will collect the needed data from you.
     

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

    Hi Herman,

    I was not able to do a packet capture even though   did a small testing with the Backend team and they confirmed that there was no difference in the request recieved and its getting processed similar to the backend call.

    So Inorder to test only connectivity  for a scheduled rule by the side call , i went ahead by checking the response code of the binary node. and its wrkinhg fine.

    But we also need to do a retry also on the same url. I tried with results action , but as the response is binary its getting rejected.

    I tried to do it usind dp:url-open  by decoding the response in the way suggested by you in the below url https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014626866

    But the problem is after decoding i m not getting a proper xml ie  '>' are getting replaced by  &gt;  and so on and also the repsonse headers are also getting added.

    Is there any way that we can get a proper response xml after decoding binary response. so that i can see that in probe and process it further.

    Thanks again for all your expertise and posts on DP.

  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-06T10:40:51Z  
    • DPUser77
    • ‏2013-05-06T10:03:27Z

    Hi Herman,

    I was not able to do a packet capture even though   did a small testing with the Backend team and they confirmed that there was no difference in the request recieved and its getting processed similar to the backend call.

    So Inorder to test only connectivity  for a scheduled rule by the side call , i went ahead by checking the response code of the binary node. and its wrkinhg fine.

    But we also need to do a retry also on the same url. I tried with results action , but as the response is binary its getting rejected.

    I tried to do it usind dp:url-open  by decoding the response in the way suggested by you in the below url https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014626866

    But the problem is after decoding i m not getting a proper xml ie  '>' are getting replaced by  &gt;  and so on and also the repsonse headers are also getting added.

    Is there any way that we can get a proper response xml after decoding binary response. so that i can see that in probe and process it further.

    Thanks again for all your expertise and posts on DP.

    Hi,

    it seems that you get serialized XML from backend.

    That will be parsed by XML request type, but since you do "binaryNode" response type you have to parse yourself:

    <xsl:variable name="resp">
      <dp:url-open target="{$yourURI}" response="binaryNode"/>
    </xsl:variable>

    <!-- base64 encode binaryNode data -->
    <xsl:variable name="resp64"
      select="dp:binary-encode($resp/result/binary/node())"
    />

    <!-- do UTF-8 validation, aborts if not UTF-8 encoded -->
    <xsl:variable name="respUTF8" select="dp:decode($resp64,'base-64')"/>

    <!-- parse serialized XML -->
    <xsl:copy-of select="dp:parse($respUTF8)" />

     

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

     

    Updated on 2013-05-06T10:42:14Z at 2013-05-06T10:42:14Z by HermannSW
  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-06T11:33:23Z  
    • HermannSW
    • ‏2013-05-06T10:40:51Z

    Hi,

    it seems that you get serialized XML from backend.

    That will be parsed by XML request type, but since you do "binaryNode" response type you have to parse yourself:

    <xsl:variable name="resp">
      <dp:url-open target="{$yourURI}" response="binaryNode"/>
    </xsl:variable>

    <!-- base64 encode binaryNode data -->
    <xsl:variable name="resp64"
      select="dp:binary-encode($resp/result/binary/node())"
    />

    <!-- do UTF-8 validation, aborts if not UTF-8 encoded -->
    <xsl:variable name="respUTF8" select="dp:decode($resp64,'base-64')"/>

    <!-- parse serialized XML -->
    <xsl:copy-of select="dp:parse($respUTF8)" />

     

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

     

    Thanks Hermann for a quick response.

    But i have already used this dp:parse function as the next step along with the steps you mentioned in other post. but getting an empty output in the probe and no repsonse in the tool which i am using.

    I used to see a  response without using Parse function (only in the tool, but not in dp probe)

    < it seems that you get serialized XML from backend.That will be parsed by XML request type, but since you do "binaryNode" response type you have to parse yourself: >

     ~ I get a parsing error when i put the response type as XML and response code 200 after putting binaryNode. Just mentioned that. Please correct me if i am wrong.

    I am using the <xsl:output method as xml in the xslt.

    Can you please share your views on this. Just confused

     

  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-06T11:51:56Z  
    • DPUser77
    • ‏2013-05-06T11:33:23Z

    Thanks Hermann for a quick response.

    But i have already used this dp:parse function as the next step along with the steps you mentioned in other post. but getting an empty output in the probe and no repsonse in the tool which i am using.

    I used to see a  response without using Parse function (only in the tool, but not in dp probe)

    < it seems that you get serialized XML from backend.That will be parsed by XML request type, but since you do "binaryNode" response type you have to parse yourself: >

     ~ I get a parsing error when i put the response type as XML and response code 200 after putting binaryNode. Just mentioned that. Please correct me if i am wrong.

    I am using the <xsl:output method as xml in the xslt.

    Can you please share your views on this. Just confused

     

    Please show what output you get with just

    <xsl:value-of select="concat('#',$resp64,'#')"/>

     

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

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-06T12:09:12Z  
    • HermannSW
    • ‏2013-05-06T11:51:56Z

    Please show what output you get with just

    <xsl:value-of select="concat('#',$resp64,'#')"/>

     

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

    Hermann,

    It is a big string like  DQaTOERIEP45df78TBNMPW.

     

  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-06T12:44:08Z  
    • DPUser77
    • ‏2013-05-06T12:09:12Z

    Hermann,

    It is a big string like  DQaTOERIEP45df78TBNMPW.

     

    That string is only good to show that the response received is not empty.

    But it is not a valid base64 string.

    To further investigate a valid and complete string is needed.

    If you do not want to attach/post that here, please open a PMR and then Level2 support will collect the data from you.


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

  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-06T13:16:33Z  
    This reply was deleted by DPUser77 2013-05-06T13:20:58Z.

    seen.

  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-06T13:25:49Z  
    • HermannSW
    • ‏2013-05-06T13:16:33Z

    seen.

    Your response (shortened) does not match what you deycribed before.

    It is a single part MIME message. Please confirm that it is this response you want to process.

    --uuid:af87dd0e-184c-4b34-8db1-7740e8ed9261+id=192
    Content-ID: <http://tempuri.org/0>
    Content-Transfer-Encoding: 8bit
    Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">...</s:Envelope>
    --uuid:af87dd0e-184c-4b34-8db1-7740e8ed9261+id=192--

     

    Btw, you can open a PMR if you have a box with support.
    If support is expired, you may renew it.

    If you have a box being out-of-support (9002/9003) a PMR is not possible anymore.

    If you run a firmware not being supported anymore (3.8.1 and previous) you need to upgrade to get support.

     

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

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-06T15:27:19Z  
    • HermannSW
    • ‏2013-05-06T13:25:49Z

    Your response (shortened) does not match what you deycribed before.

    It is a single part MIME message. Please confirm that it is this response you want to process.

    --uuid:af87dd0e-184c-4b34-8db1-7740e8ed9261+id=192
    Content-ID: <http://tempuri.org/0>
    Content-Transfer-Encoding: 8bit
    Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">...</s:Envelope>
    --uuid:af87dd0e-184c-4b34-8db1-7740e8ed9261+id=192--

     

    Btw, you can open a PMR if you have a box with support.
    If support is expired, you may renew it.

    If you have a box being out-of-support (9002/9003) a PMR is not possible anymore.

    If you run a firmware not being supported anymore (3.8.1 and previous) you need to upgrade to get support.

     

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

    <It is a single part MIME message> ~ Sorry if i provided wrong information. But i just said what i was seeing by trying differnt things and seeing then in probe and net tool.

    Yes i want to get that SOAP mesage as the ouput  as i want to apply transformations to that response.

    And i didnot got any email notification for this response and i was trying other things, I just opened this link again and saw your response.

    Sorry for replying late

    Updated on 2013-05-06T15:29:30Z at 2013-05-06T15:29:30Z by DPUser77
  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-07T08:00:01Z  
    • DPUser77
    • ‏2013-05-06T15:27:19Z

    <It is a single part MIME message> ~ Sorry if i provided wrong information. But i just said what i was seeing by trying differnt things and seeing then in probe and net tool.

    Yes i want to get that SOAP mesage as the ouput  as i want to apply transformations to that response.

    And i didnot got any email notification for this response and i was trying other things, I just opened this link again and saw your response.

    Sorry for replying late

    Hi,

    stylesheet getIt.xsl (also attached) does the extraction described:

    $ cat getIt.xsl
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:dp="http://www.datapower.com/extensions"
      extension-element-prefixes="dp"
    >
      <xsl:output omit-xml-declaration="yes" />
       
      <xsl:variable name="yourURI" select="'http://9.152.4.11/Sample.txt'"/>
      <xsl:variable name="CRLF"    select="'&#13;&#10;'"/>

      <xsl:template match="/">

        <xsl:variable name="resp">
         <dp:url-open target="{$yourURI}" response="binaryNode"/>
        </xsl:variable>

        <!-- base64 encode binaryNode data -->
        <xsl:variable name="resp64"
          select="dp:binary-encode($resp/result/binary/node())"
        />

        <!-- do UTF-8 validation, aborts if not UTF-8 encoded -->
        <xsl:variable name="respUTF8" select="dp:decode($resp64,'base-64')"/>
       
        <!-- parse serialized XML, cutted out of single MIME part -->
        <xsl:copy-of
          select="dp:parse(
                    substring-before(
                      substring-after(
                        substring-after(
                          $respUTF8,
                          '--'
                        ),
                        concat($CRLF,$CRLF)
                      ),
                      concat($CRLF,'--')
                    )
                  )"
        />

      </xsl:template>
     
    </xsl:stylesheet>
    $

     

    Here you can see that it works:

    $ coproc2 getIt.xsl ab.xml http://dp2-l3:2223 -s | tidy -q -xml
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
      <s:Header>
        ...
      </s:Header>
      <s:Body>
        ....
      </s:Body>
    </s:Envelope>

    $

     

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

    Attachments

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-07T16:10:46Z  
    • HermannSW
    • ‏2013-05-07T08:00:01Z

    Hi,

    stylesheet getIt.xsl (also attached) does the extraction described:

    $ cat getIt.xsl
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:dp="http://www.datapower.com/extensions"
      extension-element-prefixes="dp"
    >
      <xsl:output omit-xml-declaration="yes" />
       
      <xsl:variable name="yourURI" select="'http://9.152.4.11/Sample.txt'"/>
      <xsl:variable name="CRLF"    select="'&#13;&#10;'"/>

      <xsl:template match="/">

        <xsl:variable name="resp">
         <dp:url-open target="{$yourURI}" response="binaryNode"/>
        </xsl:variable>

        <!-- base64 encode binaryNode data -->
        <xsl:variable name="resp64"
          select="dp:binary-encode($resp/result/binary/node())"
        />

        <!-- do UTF-8 validation, aborts if not UTF-8 encoded -->
        <xsl:variable name="respUTF8" select="dp:decode($resp64,'base-64')"/>
       
        <!-- parse serialized XML, cutted out of single MIME part -->
        <xsl:copy-of
          select="dp:parse(
                    substring-before(
                      substring-after(
                        substring-after(
                          $respUTF8,
                          '--'
                        ),
                        concat($CRLF,$CRLF)
                      ),
                      concat($CRLF,'--')
                    )
                  )"
        />

      </xsl:template>
     
    </xsl:stylesheet>
    $

     

    Here you can see that it works:

    $ coproc2 getIt.xsl ab.xml http://dp2-l3:2223 -s | tidy -q -xml
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
      <s:Header>
        ...
      </s:Header>
      <s:Body>
        ....
      </s:Body>
    </s:Envelope>

    $

     

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

    Herman,

    Thanks a lot !! for your guidance in parsing the binary response through the present and previous posts :)

     

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-18T21:15:02Z  
    • HermannSW
    • ‏2013-05-07T08:00:01Z

    Hi,

    stylesheet getIt.xsl (also attached) does the extraction described:

    $ cat getIt.xsl
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:dp="http://www.datapower.com/extensions"
      extension-element-prefixes="dp"
    >
      <xsl:output omit-xml-declaration="yes" />
       
      <xsl:variable name="yourURI" select="'http://9.152.4.11/Sample.txt'"/>
      <xsl:variable name="CRLF"    select="'&#13;&#10;'"/>

      <xsl:template match="/">

        <xsl:variable name="resp">
         <dp:url-open target="{$yourURI}" response="binaryNode"/>
        </xsl:variable>

        <!-- base64 encode binaryNode data -->
        <xsl:variable name="resp64"
          select="dp:binary-encode($resp/result/binary/node())"
        />

        <!-- do UTF-8 validation, aborts if not UTF-8 encoded -->
        <xsl:variable name="respUTF8" select="dp:decode($resp64,'base-64')"/>
       
        <!-- parse serialized XML, cutted out of single MIME part -->
        <xsl:copy-of
          select="dp:parse(
                    substring-before(
                      substring-after(
                        substring-after(
                          $respUTF8,
                          '--'
                        ),
                        concat($CRLF,$CRLF)
                      ),
                      concat($CRLF,'--')
                    )
                  )"
        />

      </xsl:template>
     
    </xsl:stylesheet>
    $

     

    Here you can see that it works:

    $ coproc2 getIt.xsl ab.xml http://dp2-l3:2223 -s | tidy -q -xml
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
      <s:Header>
        ...
      </s:Header>
      <s:Body>
        ....
      </s:Body>
    </s:Envelope>

    $

     

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

    Hi Hermann,

    I was trying to capture the actual error message  returned by service in case of response code 500, but  at present its giving an empty node set in this case of binaryNode.

    I came across the below post https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014107232

    in which you have quoted

    < "You stepped into a known limitation of dp:url-open() with reponse-type="binaryNode". " >

    Is there any way that we can capture the actual error message.

    Please reply. Thanks in advance.

  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-19T00:58:25Z  
    • DPUser77
    • ‏2013-05-18T21:15:02Z

    Hi Hermann,

    I was trying to capture the actual error message  returned by service in case of response code 500, but  at present its giving an empty node set in this case of binaryNode.

    I came across the below post https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014107232

    in which you have quoted

    < "You stepped into a known limitation of dp:url-open() with reponse-type="binaryNode". " >

    Is there any way that we can capture the actual error message.

    Please reply. Thanks in advance.

    Hi,

    another limitation of "binaryNode" is that only empty node-set gets returned and response code is unavailable.

    Please see this posting on what you can do in this situation:
    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014642664&ps=25

     

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

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-19T06:03:27Z  
    • HermannSW
    • ‏2013-05-19T00:58:25Z

    Hi,

    another limitation of "binaryNode" is that only empty node-set gets returned and response code is unavailable.

    Please see this posting on what you can do in this situation:
    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014642664&ps=25

     

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

    Hermann,

    Thanks for replying. I already referred that link, but response code will not solve my issue.

    As i mentioned earlier, if i make an actual backend   call i get a xml response only , but while making a side call through dp:url-open() we are getting an half MiMe (binary) response.

    Backend team is saying that they do not see any difference in the request in case of side call .

    Please let me know if we can do any thing in DP like an extra setting , so that we can get  an xml response only via side call

     

     

  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-19T10:08:59Z  
    • DPUser77
    • ‏2013-05-19T06:03:27Z

    Hermann,

    Thanks for replying. I already referred that link, but response code will not solve my issue.

    As i mentioned earlier, if i make an actual backend   call i get a xml response only , but while making a side call through dp:url-open() we are getting an half MiMe (binary) response.

    Backend team is saying that they do not see any difference in the request in case of side call .

    Please let me know if we can do any thing in DP like an extra setting , so that we can get  an xml response only via side call

     

     

    OK, now you made the point:

    > but while making a side call through dp:url-open() we are getting an half MiMe (binary) response.
    >
    Your response is a MIME message with XML in the root part -- that is not XML.

    Please attach a sample MIME message and we can see wether just cutting out the XML and parse may work.
    It all depends on encodings if you need to process binaryNode data.
     

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

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-19T10:18:06Z  
    • HermannSW
    • ‏2013-05-19T10:08:59Z

    OK, now you made the point:

    > but while making a side call through dp:url-open() we are getting an half MiMe (binary) response.
    >
    Your response is a MIME message with XML in the root part -- that is not XML.

    Please attach a sample MIME message and we can see wether just cutting out the XML and parse may work.
    It all depends on encodings if you need to process binaryNode data.
     

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

    Hermann,

    Please correct me if i am wrong. We already did the parsing of a good  MIME message with XML in the root part and i was able to do that with your suggestions by doing proper encoding and did further processing on response.

    <Please attach a sample MIME message and we can see wether just cutting out the XML and parse may work. It all depends on encodings if you need to process binaryNode data.>

    But if we get a remote error on url (empty node set) in case of 500 error, how it can be parsed.

    Please correct me if i did not get ur question

     

  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-19T10:36:43Z  
    • DPUser77
    • ‏2013-05-19T10:18:06Z

    Hermann,

    Please correct me if i am wrong. We already did the parsing of a good  MIME message with XML in the root part and i was able to do that with your suggestions by doing proper encoding and did further processing on response.

    <Please attach a sample MIME message and we can see wether just cutting out the XML and parse may work. It all depends on encodings if you need to process binaryNode data.>

    But if we get a remote error on url (empty node set) in case of 500 error, how it can be parsed.

    Please correct me if i did not get ur question

     

    Hi,

    please follow the last link I pointed to.
    If you get an empty nodeset, you need to redo the <dp:url-open> with responsecode.

    In case that response is still bad, then make your backend send valid data.

    In case that response is good, retry with "binaryNode".

    There is no way to process binaryNode data for a bad response, retry loop should help with temporary  issues.


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

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-20T11:57:13Z  
    • HermannSW
    • ‏2013-05-19T10:36:43Z

    Hi,

    please follow the last link I pointed to.
    If you get an empty nodeset, you need to redo the <dp:url-open> with responsecode.

    In case that response is still bad, then make your backend send valid data.

    In case that response is good, retry with "binaryNode".

    There is no way to process binaryNode data for a bad response, retry loop should help with temporary  issues.


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

    Hermann,

    Thnks for replying.

    And pardon for disturbing again

    But I need to capture the actual error message for support team.

    <As i already mentioned, I am getting an MIME message via side call and good xml message via backend call (it might be due to proxy settings  "Response attachment processing mode"). >

    So can we do some thing similar for dp:url open case also. Please share you thoughts

  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-20T12:49:09Z  
    • DPUser77
    • ‏2013-05-20T11:57:13Z

    Hermann,

    Thnks for replying.

    And pardon for disturbing again

    But I need to capture the actual error message for support team.

    <As i already mentioned, I am getting an MIME message via side call and good xml message via backend call (it might be due to proxy settings  "Response attachment processing mode"). >

    So can we do some thing similar for dp:url open case also. Please share you thoughts

    Hi

    > But I need to capture the actual error message for support team.
    >
    the easiest solution for that is to do the <dp:url-open> resulting in empty nodeset.
    And doing a packet capture in parallel.

    You can then provide the packet capture to support.
    In addition you can do "Follow TCP stream" yourself in eg. Wireshark.


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


     

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-20T13:02:19Z  
    • HermannSW
    • ‏2013-05-20T12:49:09Z

    Hi

    > But I need to capture the actual error message for support team.
    >
    the easiest solution for that is to do the <dp:url-open> resulting in empty nodeset.
    And doing a packet capture in parallel.

    You can then provide the packet capture to support.
    In addition you can do "Follow TCP stream" yourself in eg. Wireshark.


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


     

    Hermann,

    Thanks again  for a quick response.

    >the easiest solution for that is to do the <dp:url-open> resulting in empty nodeset.
    And doing a packet capture in parallel

    >

    But doing a packet capture parallely in production will not be a good idea.

    Also can you please share your thoughts on this

    As i already mentioned, I am getting an MIME message via side call and good xml message via backend call (it might be due to proxy settings  "Response attachment processing mode").

  • HermannSW
    HermannSW
    4750 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-05-20T15:26:41Z  
    • DPUser77
    • ‏2013-05-20T13:02:19Z

    Hermann,

    Thanks again  for a quick response.

    >the easiest solution for that is to do the <dp:url-open> resulting in empty nodeset.
    And doing a packet capture in parallel

    >

    But doing a packet capture parallely in production will not be a good idea.

    Also can you please share your thoughts on this

    As i already mentioned, I am getting an MIME message via side call and good xml message via backend call (it might be due to proxy settings  "Response attachment processing mode").

    As I said above, it is not possible to get the error code and the binaryNode response.

    You have to do a packet capture.
    And you can do it once only during the time where you reproduce the problem, eg. timed for 30 seconds (default).

    Wireshark allows not only to display a TCP transaction, but also to extract and store it separately. Therefore you can control what you pass back to support.
     

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

  • rock3111
    rock3111
    8 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-10-03T06:14:33Z  
    • HermannSW
    • ‏2013-05-07T08:00:01Z

    Hi,

    stylesheet getIt.xsl (also attached) does the extraction described:

    $ cat getIt.xsl
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:dp="http://www.datapower.com/extensions"
      extension-element-prefixes="dp"
    >
      <xsl:output omit-xml-declaration="yes" />
       
      <xsl:variable name="yourURI" select="'http://9.152.4.11/Sample.txt'"/>
      <xsl:variable name="CRLF"    select="'&#13;&#10;'"/>

      <xsl:template match="/">

        <xsl:variable name="resp">
         <dp:url-open target="{$yourURI}" response="binaryNode"/>
        </xsl:variable>

        <!-- base64 encode binaryNode data -->
        <xsl:variable name="resp64"
          select="dp:binary-encode($resp/result/binary/node())"
        />

        <!-- do UTF-8 validation, aborts if not UTF-8 encoded -->
        <xsl:variable name="respUTF8" select="dp:decode($resp64,'base-64')"/>
       
        <!-- parse serialized XML, cutted out of single MIME part -->
        <xsl:copy-of
          select="dp:parse(
                    substring-before(
                      substring-after(
                        substring-after(
                          $respUTF8,
                          '--'
                        ),
                        concat($CRLF,$CRLF)
                      ),
                      concat($CRLF,'--')
                    )
                  )"
        />

      </xsl:template>
     
    </xsl:stylesheet>
    $

     

    Here you can see that it works:

    $ coproc2 getIt.xsl ab.xml http://dp2-l3:2223 -s | tidy -q -xml
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
      <s:Header>
        ...
      </s:Header>
      <s:Body>
        ....
      </s:Body>
    </s:Envelope>

    $

     

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

    Herman,

         i have the same issue. when i make a call from mgp to WSP using dp:open-URL() i see the following error msg.

     

    <url-open xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dp="http://www.datapower.com/schemas/management">
    <responsecode>200</responsecode>
    <errorcode>196609</errorcode>
    <errorstring>illegal character '-' at offset 4 of http://localhost:1235/image</errorstring>
    <content-type>multipart/related; boundary="uuid:b8b477f4-c5f9-4907-827d-6c280685182f"; start-info="text/xml"; type="text/xml"; start="<root.message@cxf.apache.org>"</content-type>
    <headers>
    <header name="X-Backside-Transport">OK OK</header>
    <header name="Date">Thu, 03 Oct 2013 06:01:07 GMT</header>
    <header name="Server">Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8j DAV/2</header>
    <header name="Vary">User-Agent</header>
    <header name="Content-Type">multipart/related; boundary="uuid:b8b477f4-c5f9-4907-827d-6c280685182f"; start-info="text/xml"; type="text/xml"; start="<root.message@cxf.apache.org>"</header>
    <header name="Content-Language">en-US</header>
    <header name="X-Client-IP">172.28.186.47</header></headers></url-open>

     

     

       When i directly hit the wsp, i am getting good response with attachment.    i have posted my query here

    https://www.ibm.com/developerworks/community/forums/html/topic?id=305f443d-8e3c-4d13-8b80-173c1940447a&ps=25

       I  apologize for cross posting, but i was looking how this problem can be fixed. I tried with binary node like the above, but in response i am getting like the following

     

    <result xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dp="http://www.datapower.com/schemas/management">
    <binary>***BINARY NODE***</binary>
    <responsecode>200</responsecode>
    <headers>
    <header name="X-Backside-Transport">OK OK</header>
    <header name="Date">Thu, 03 Oct 2013 05:54:08 GMT</header>
    <header name="Server">Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8j DAV/2</header>
    <header name="Vary">User-Agent</header>
    <header name="Content-Type">multipart/related; boundary="uuid:3c613028-bf34-43df-93e1-b1731ae5b472"; start-info="text/xml"; type="text/xml"; start="<root.message@cxf.apache.org>"</header>
    <header name="Content-Language">en-US</header>
    <header name="X-Client-IP">172.28.186.47</header></headers></result>

     

       Please throw some pointers, so that i can fix the issue.

     

     

    Updated on 2013-10-03T06:15:37Z at 2013-10-03T06:15:37Z by rock3111
  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-10-03T12:36:02Z  
    • rock3111
    • ‏2013-10-03T06:14:33Z

    Herman,

         i have the same issue. when i make a call from mgp to WSP using dp:open-URL() i see the following error msg.

     

    <url-open xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dp="http://www.datapower.com/schemas/management">
    <responsecode>200</responsecode>
    <errorcode>196609</errorcode>
    <errorstring>illegal character '-' at offset 4 of http://localhost:1235/image</errorstring>
    <content-type>multipart/related; boundary="uuid:b8b477f4-c5f9-4907-827d-6c280685182f"; start-info="text/xml"; type="text/xml"; start="<root.message@cxf.apache.org>"</content-type>
    <headers>
    <header name="X-Backside-Transport">OK OK</header>
    <header name="Date">Thu, 03 Oct 2013 06:01:07 GMT</header>
    <header name="Server">Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8j DAV/2</header>
    <header name="Vary">User-Agent</header>
    <header name="Content-Type">multipart/related; boundary="uuid:b8b477f4-c5f9-4907-827d-6c280685182f"; start-info="text/xml"; type="text/xml"; start="<root.message@cxf.apache.org>"</header>
    <header name="Content-Language">en-US</header>
    <header name="X-Client-IP">172.28.186.47</header></headers></url-open>

     

     

       When i directly hit the wsp, i am getting good response with attachment.    i have posted my query here

    https://www.ibm.com/developerworks/community/forums/html/topic?id=305f443d-8e3c-4d13-8b80-173c1940447a&ps=25

       I  apologize for cross posting, but i was looking how this problem can be fixed. I tried with binary node like the above, but in response i am getting like the following

     

    <result xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dp="http://www.datapower.com/schemas/management">
    <binary>***BINARY NODE***</binary>
    <responsecode>200</responsecode>
    <headers>
    <header name="X-Backside-Transport">OK OK</header>
    <header name="Date">Thu, 03 Oct 2013 05:54:08 GMT</header>
    <header name="Server">Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8j DAV/2</header>
    <header name="Vary">User-Agent</header>
    <header name="Content-Type">multipart/related; boundary="uuid:3c613028-bf34-43df-93e1-b1731ae5b472"; start-info="text/xml"; type="text/xml"; start="<root.message@cxf.apache.org>"</header>
    <header name="Content-Language">en-US</header>
    <header name="X-Client-IP">172.28.186.47</header></headers></result>

     

       Please throw some pointers, so that i can fix the issue.

     

     

    Hi,

    Pease check with the Backend team regarding the response format they are sending.

    In our case after searching a lot i came to know that Backend call can process the 'MTOM message type (which is basically used to send attachments in the request) but for Side call it will be a binary response.

    In our case the input was with attachments so the backend team had both request and response format as 'MTOM'.

    So we asked them to change the response type as text/xml. Earlier they were not willing to do this considering performance  issues, but some how we explained them and they finally agreed and it went fine.

    Try to check this first, in this way u can get rid of this manual coding.

    Regards,

    Simmer

    Updated on 2013-10-03T12:49:32Z at 2013-10-03T12:49:32Z by DPUser77
  • rock3111
    rock3111
    8 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-10-03T14:54:32Z  
    • DPUser77
    • ‏2013-10-03T12:36:02Z

    Hi,

    Pease check with the Backend team regarding the response format they are sending.

    In our case after searching a lot i came to know that Backend call can process the 'MTOM message type (which is basically used to send attachments in the request) but for Side call it will be a binary response.

    In our case the input was with attachments so the backend team had both request and response format as 'MTOM'.

    So we asked them to change the response type as text/xml. Earlier they were not willing to do this considering performance  issues, but some how we explained them and they finally agreed and it went fine.

    Try to check this first, in this way u can get rid of this manual coding.

    Regards,

    Simmer

    Thanks for the reply Simmer.

         This is actual response i am getting from backend server.

     

    HTTP/1.1 200 OK
    Date: Thu, 03 Oct 2013 14:48:03 GMT
    Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8j DAV/2
    Vary: User-Agent
    Transfer-Encoding: chunked
    Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:2f6db755-f3de-4601-8f99-1f536e522fe3"; start="<root.message@cxf.apache.org>"; start-info="text/xml"
    Content-Language: en-US
     
     
    --uuid:2f6db755-f3de-4601-8f99-1f536e522fe3
    Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
    Content-Transfer-Encoding: binary
    Content-ID: <root.message@cxf.apache.org>
     
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:Response xmlns:ns2="http://iabc.com/"><return><Data><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:ca651a0f-31d6-4008-b41c-f76714294327-103@cxf.apache.org"/></Data></return></ns2:Response></soap:Body></soap:Envelope>
    --uuid:2f6db755-f3de-4601-8f99-1f536e522fe3
    Content-Type: application/octet-stream
    Content-Transfer-Encoding: binary
    Content-ID: <ca651a0f-31d6-4008-b41c-f76714294327-103@cxf.apache.org>
     
    II*

     

  • DPUser77
    DPUser77
    70 Posts

    Re: How to add Proxy Policy attribute to dp : url-open()

    ‏2013-10-04T09:57:13Z  
    • rock3111
    • ‏2013-10-03T14:54:32Z

    Thanks for the reply Simmer.

         This is actual response i am getting from backend server.

     

    HTTP/1.1 200 OK
    Date: Thu, 03 Oct 2013 14:48:03 GMT
    Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8j DAV/2
    Vary: User-Agent
    Transfer-Encoding: chunked
    Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:2f6db755-f3de-4601-8f99-1f536e522fe3"; start="<root.message@cxf.apache.org>"; start-info="text/xml"
    Content-Language: en-US
     
     
    --uuid:2f6db755-f3de-4601-8f99-1f536e522fe3
    Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
    Content-Transfer-Encoding: binary
    Content-ID: <root.message@cxf.apache.org>
     
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:Response xmlns:ns2="http://iabc.com/"><return><Data><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:ca651a0f-31d6-4008-b41c-f76714294327-103@cxf.apache.org"/></Data></return></ns2:Response></soap:Body></soap:Envelope>
    --uuid:2f6db755-f3de-4601-8f99-1f536e522fe3
    Content-Type: application/octet-stream
    Content-Transfer-Encoding: binary
    Content-ID: <ca651a0f-31d6-4008-b41c-f76714294327-103@cxf.apache.org>
     
    II*

     

    Hi,

    Looks like the MTOM response.It worked for us when we changed the response type at the backend.

    I am not sure if it will work for you , as you might be having some differnt data in the <DATA> tag.

    Also when you set the response type in dp:url-open for binary data, you should get this after results tag(u posted in the past two posts.)

    As the response starts with "----uuid" the code suggested by Hermann earlier is to take the actual SOAP  response ignoring the unwanted characters and then putting the same into a variable for further processing.

    Also what is the exact need that you are not going for actual backend call ?

    In our case we wanted to go for retry. So we opted for a side call.