Topic
  • 5 replies
  • Latest Post - ‏2013-01-15T13:41:41Z by HermannSW
ansmyke
ansmyke
79 Posts

Pinned topic output of convert-http action is puzzling

‏2013-01-09T01:23:15Z |
The following is my HTML form which I use to post data to a MPGW. The convert-http action is used to conver the form body to XML format. I can see the content of the message(username, first name , lastname etc) in the match action in probe.

<!DOCTYPE html>
<html>
<body>

This is the form

<form enctype="multipart/form-data" name="input" action="https://URLxyz/a/" method="post">
First name: <input type="text" name="firstname">
Last name: <input type="text" name="lastname">
Password: <input type="password" name="pwd">

<input type="radio" name="sex" value="male">Male
<input type="radio" name="sex" value="female">Female

Username: <input type="text" name="user">
<input type="submit" value="Submit">
</form>
</body>
</html>
The problem here is that convert-http output is:

<request>
<url>/a</url>
<base-url>/a</base-url>
<args src="url" />
</request>

Not sure why I am seeing the value of URL as output instead of the form body.
Updated on 2013-01-15T13:41:41Z at 2013-01-15T13:41:41Z by HermannSW
  • HermannSW
    HermannSW
    4741 Posts

    Re: output of convert-http action is puzzling

    ‏2013-01-09T09:56:27Z  
    Hi Mike,

    • I used your HTTP form
    • pointed to a convert-http action loopback XML FW
    • filled out the form and submitted
    • got prompt on what to do with DataPower response
    • selected "Save File".

    As you can see it works -- please make sure that your Service request type is Non-XML for convert-http action to work:
    $ ls -lst ~/Downloads/ | head -2
    total 1485212
         4 -rw-rw-r--.  1 stammw stammw       260 Jan  9 10:54 JhiGMJWF.part
    $ 
    $ tidy -q -xml ~/Downloads/JhiGMJWF.part 
    <request>
      <url>/</url>
      <base-url>/</base-url>
      <args src='url'></args>
      <args src='body'>
        <arg name="firstname">Hermann</arg>
        <arg name="lastname">Stamm-Wilbrandt</arg>
        <arg name="pwd">terces</arg>
        <arg name="sex">male</arg>
        <arg name="user">stammw</arg>
      </args>
    </request>
     
    $
    


     
    Hermann <myXsltBlog/> <myXsltTweets/>
    Updated on 2014-03-25T02:42:38Z at 2014-03-25T02:42:38Z by iron-man
  • ansmyke
    ansmyke
    79 Posts

    Re: output of convert-http action is puzzling

    ‏2013-01-11T19:51:31Z  
    • HermannSW
    • ‏2013-01-09T09:56:27Z
    Hi Mike,

    • I used your HTTP form
    • pointed to a convert-http action loopback XML FW
    • filled out the form and submitted
    • got prompt on what to do with DataPower response
    • selected "Save File".

    As you can see it works -- please make sure that your Service request type is Non-XML for convert-http action to work:
    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr">$ ls -lst ~/Downloads/ | head -2 total 1485212 4 -rw-rw-r--. 1 stammw stammw 260 Jan 9 10:54 JhiGMJWF.part $ $ tidy -q -xml ~/Downloads/JhiGMJWF.part <request> <url>/</url> <base-url>/</base-url> <args src='url'></args> <args src='body'> <arg name="firstname">Hermann</arg> <arg name="lastname">Stamm-Wilbrandt</arg> <arg name="pwd">terces</arg> <arg name="sex">male</arg> <arg name="user">stammw</arg> </args> </request> $ </pre>

     
    Hermann <myXsltBlog/> <myXsltTweets/>
    Herman, Thanks for your response. Looks like its a bug in firmware version 5.0.0.3 for XI50. I tried the same export on XB62 5.0.0.4 and XI50 3.8.2.7 and it worked very well.

    In XI50 5.0.0.3, its chopping off
    the whole Body part

    <args src='body'>
    <arg name="firstname">Hermann</arg>
    <arg name="lastname">Stamm-Wilbrandt</arg>
    <arg name="pwd">terces</arg>
    <arg name="sex">male</arg>
    <arg name="user">stammw</arg>
    </args>

    I will open a PMR with IBM for this.
  • HermannSW
    HermannSW
    4741 Posts

    Re: output of convert-http action is puzzling

    ‏2013-01-13T00:32:17Z  
    • ansmyke
    • ‏2013-01-11T19:51:31Z
    Herman, Thanks for your response. Looks like its a bug in firmware version 5.0.0.3 for XI50. I tried the same export on XB62 5.0.0.4 and XI50 3.8.2.7 and it worked very well.

    In XI50 5.0.0.3, its chopping off
    the whole Body part

    <args src='body'>
    <arg name="firstname">Hermann</arg>
    <arg name="lastname">Stamm-Wilbrandt</arg>
    <arg name="pwd">terces</arg>
    <arg name="sex">male</arg>
    <arg name="user">stammw</arg>
    </args>

    I will open a PMR with IBM for this.
    Hi,

    I just tried on XI50 5.0.0.1 and XI52 5.0.0.4 and get the same responses I described.
    Perhaps you may want to try attached convert-http service export?

     
    Hermann<myXsltBlog/> <myXsltTweets/>
  • ansmyke
    ansmyke
    79 Posts

    Re: output of convert-http action is puzzling

    ‏2013-01-14T23:04:19Z  
    • HermannSW
    • ‏2013-01-13T00:32:17Z
    Hi,

    I just tried on XI50 5.0.0.1 and XI52 5.0.0.4 and get the same responses I described.
    Perhaps you may want to try attached convert-http service export?

     
    Hermann<myXsltBlog/> <myXsltTweets/>
    Nope its still doesn't work on XI50 5.0.0.3 but works fine on XB62 5.0.0.4. Please see the attached snapshots

    Thanks,
  • HermannSW
    HermannSW
    4741 Posts

    Re: output of convert-http action is puzzling

    ‏2013-01-15T13:41:41Z  
    • ansmyke
    • ‏2013-01-14T23:04:19Z
    Nope its still doesn't work on XI50 5.0.0.3 but works fine on XB62 5.0.0.4. Please see the attached snapshots

    Thanks,
    Hi,

    I do not know how you submit the data (which browser).
    But what you show in your screenshot is not HTTP POST Form data.

    I did enable the Probe, submitted your form and did a screenshot of Probe for that transaction.
    As you can see my Firefox does send completely different data, important are especially the boundaries:


     
    Hermann<myXsltBlog/> <myXsltTweets/>