Topic
  • 5 replies
  • Latest Post - ‏2013-09-11T13:05:09Z by dmmicale
RS_DP
RS_DP
37 Posts

Pinned topic Data-type for dp:url-open

‏2013-09-10T13:11:59Z |

Hi Team,

 Need your inputs on below. I want to post a data to an Java Servlet. The format of the data is Name:Value(Base 64 encoded data). As mentioned the value is base 64 type of data.

 I am using url open as below :

 

<xsl:variable name="post_data" select="concat($Name,':',$Value)"/>

  <dp:url-open target="{$Url}" response="responsecode" data-type="base64" timeout="86400" http-method="post">
        <xsl:copy-of select="$post_data"/>
      </dp:url-open>

 I want to know if data-type as Base64 is correct or not as my entire post data is made up of two parts - NormalString+Base64 string.



Thanks.

Updated on 2013-09-11T14:00:32Z at 2013-09-11T14:00:32Z by RS_DP
  • dmmicale
    dmmicale
    32 Posts

    Re: Data-type for dp:url-open

    ‏2013-09-10T19:15:42Z  

    Setting the data-type to base64 tells DataPower that your input inside the url-open is base64 encoded and needs to be base64 decoded before transmitting over the wire.  Since you are mixing base64 with non-base64 this likely would not work.  You would need to dp:encode the normal string + base64.

  • RS_DP
    RS_DP
    37 Posts

    Re: Data-type for dp:url-open

    ‏2013-09-11T00:39:36Z  
    • dmmicale
    • ‏2013-09-10T19:15:42Z

    Setting the data-type to base64 tells DataPower that your input inside the url-open is base64 encoded and needs to be base64 decoded before transmitting over the wire.  Since you are mixing base64 with non-base64 this likely would not work.  You would need to dp:encode the normal string + base64.

    Thank You!

     What would be the impact if I set the data-type="xml" and send the Normal String + base64 encoded data. Basically, the URL where I want to POST this data does not expect it to be decoded over the wire as it has its own logic to decode it.

  • dmmicale
    dmmicale
    32 Posts

    Re: Data-type for dp:url-open

    ‏2013-09-11T00:48:52Z  
    • RS_DP
    • ‏2013-09-11T00:39:36Z

    Thank You!

     What would be the impact if I set the data-type="xml" and send the Normal String + base64 encoded data. Basically, the URL where I want to POST this data does not expect it to be decoded over the wire as it has its own logic to decode it.

    data-type is specifically for DataPower because it needs to know how to interpret the data you are inputting (XML data-type would require a valid xml message).  DataPower will decode the base-64 you pass in and take that data to transfer over the wire.

    Just create a new variable or append to the existing that dp encodes

    <xsl:variable name="encoded_data" select="dp:encode($post_data,'base-64')"/>

  • RS_DP
    RS_DP
    37 Posts

    Re: Data-type for dp:url-open

    ‏2013-09-11T08:17:30Z  
    • dmmicale
    • ‏2013-09-11T00:48:52Z

    data-type is specifically for DataPower because it needs to know how to interpret the data you are inputting (XML data-type would require a valid xml message).  DataPower will decode the base-64 you pass in and take that data to transfer over the wire.

    Just create a new variable or append to the existing that dp encodes

    <xsl:variable name="encoded_data" select="dp:encode($post_data,'base-64')"/>

    Thanks a lot. I checked the infocenter and found there are only 3 types supported for data-type="xml | base64 | filename". In case I do not have an valid xml or a file to be POSTED, the only way is to encode my data to base64 and then use the datatype as base64?

  • dmmicale
    dmmicale
    32 Posts

    Re: Data-type for dp:url-open

    ‏2013-09-11T13:05:09Z  
    • RS_DP
    • ‏2013-09-11T08:17:30Z

    Thanks a lot. I checked the infocenter and found there are only 3 types supported for data-type="xml | base64 | filename". In case I do not have an valid xml or a file to be POSTED, the only way is to encode my data to base64 and then use the datatype as base64?

    Correct