commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: HttpClient PostMethod execute call hangs
Date Fri, 03 Oct 2008 19:23:48 GMT
A very useful tool in determine what may be different about the way the 
request is made of the server between your code and a browser, and in 
particular, to determine which side may be misbehaving, is to use a packet 
trace tool like wireshark, which is Open Source, and available for 
multiple platforms.  I consider it indispensible for sorting out this type 
of issue.

Please respond to "Commons Users List" <>

Subject:        HttpClient PostMethod execute call hangs

I apologize, I don't have access to my code right now, but I remember it
well, and it's fairly simple. I'm trying to login to a website (step 1) 
post data to a form on a page that I only have access to once I have 
in (step 2). Step 1 works fine, no problem. I execute a PostMethod 
and print the result from the server so I can confirm that I am indeed
logged in. Step 2 has been giving me a lot of problems. I have been able 
get it to do two different things, depending on how I mess with the code.
Still my code for step 2 is largely identical to the code in step 1. When 
try to execute the code for step 2, one permutation of my code, when
executed, the server returns the HTML of the page I am trying to post to -
obviously not the result I want. When I modify my code a bit, it hangs on
the call to execute the PostMethod instance. I stepped into the code, and 
looks like it is stuck waiting for a response from the server - it never
gets one. I'm sure this form works fine when I navigate it manually w/ a
browser. Any idea what may be going on? I'm really stuck here. I've posted
the form HTML code from the page I'm trying to post to in step 2 below for

<form method="post" action="webcalls2.php">
<input type="hidden" name="action" value="initcall">
<input type="hidden" name="panel" value="">
<div style="margin: 0px; padding: 0px;">

<table border="0" cellspacing="0" cellpadding="0">

<td colspan="2">
<table border="0" cellpadding="0" cellspacing="0" style="width: 398px;">
<td class="g11">&nbsp;</td>
<td class="g12"><h1 width="100" style="float: left; padding: 0px; margin:
0px; color: #FFFFFF; padding-top: 10px; font-size: 17px; font-weight:
bold;">Phone-to-Phone (connection fee 5Ct.)</h1></td>
<td class="g13">&nbsp;</td>

<td class="g21">&nbsp;</td>
<td class="g22" width="386" style="width: 376px; height: 140px;">
<table border="0" cellpadding="0" cellspacing="0" style="width: 360px;
height: 150px;">
<td  colspan="2" nowrap>
Your phone number:

<td colspan="2" style="width: 100%;">
<input type="text" name="anrphonenr" size="30" value="" onkeyup="return
checkDisabled();" onchange="return checkDisabled();" id="anrphonenr">
<td colspan="2" style="font-size: 1px; height: 1px;">&nbsp;</td>
<td colspan="2" nowrap>

Destination phone number:
<td colspan="2" style="width: 100%;">
<input type="text" name="bnrphonenr" size="30" value="" onkeyup="return
checkDisabled();" onchange="return checkDisabled();" id="bnrphonenr">

<td colspan="2" width="300" style="width: 300px;">
Make sure you enter both phone numbers in the international format, for
instance for calls to/from UK phones: +442012345678
(+44 is the international code for the UK, use this and then your normal
number without the first zero)  #  questionmark.gif  .

<td colspan="2" style="vertical-align: bottom;">
webcalls2.php?explain=true&panel=  questionmark.gif   <input
type="submit" value="Call!" id="callbutton">

<td class="g23">&nbsp;</td>
<td class="g31">&nbsp;</td>
<td class="g32">&nbsp;</td>
<td class="g33">&nbsp;</td>



View this message in context:

Sent from the Commons - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message