Specifying a port in HttpPost

by drill » Sat, 27 Feb 2010 18:36:27 GMT


Sponsored Links
 I want to make a Http-post-request to a webserver on a specific port.
For that I use the HttpPost constructor as follows:
HttpPost post = new HttpPost(" http://webpage.com :1212/httppost.php");
Then I put some parameters with it using
post.setEntity(params);
When I now want to execute that request with
HttpResponse response = client.execute(post);
I receive a NoHttpResponseException.
The server is available and when I try all that without a port I don't
get that exception, but I need to specify my port. Is there anybody
who had a similar problem or do have a solution for me?

Thanks a lot.
regards

--



Other Threads

1. how can access map Overlay control

i want to develop location base system (gps) so i written code to
display map on the screen but i cant get overlay control on the map so
please give me info how can we access overlay control.
if once i got overlay control can we fine direction from one city to
another.

Thank You
Suresh Kerai

--~--~---------~--~----~------------~-------~--~----~

2. Web service Implementation for Android.

Hi All,
I want to implement Web services in Android application. There is lots
of post I found in this group regrading this but unfortunately none of
is working in my case. Below are the mine requirements.
1. I had developed a service layer which will bring data from Mysql.
2. Service layer is deployed under Apache axis in tomcat server.
3. I already tested my web service application from simple Axis client
application. Please find the working client code below:
try {

              String endpointURL = "http://localhost:8080/axis/services/
SurveyDetails";
              String  name = "EDUCATION";
              long a = 100;
              long b =0;
              Service service = new Service();
              Call   call  = (Call) service.createCall();

              call.setTargetEndpointAddress( new java.net.URL(endpointURL) );
              call.setOperationName( new
QName("urn:android.webservices.src.com",
"getAndUpdateSurveyDetails") );
              call.addParameter( "arg1", XMLType.XSD_STRING,
ParameterMode.IN);
              call.addParameter( "arg2", XMLType.XSD_LONG, ParameterMode.IN);
              call.addParameter( "arg3", XMLType.XSD_LONG, ParameterMode.IN);
              //call.addParameter( "arg2", XMLType.XSD_INT,
ParameterMode.IN);
        
call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING );

              String ret = (String) call.invoke( new Object[] {name,a,b} );

              System.out.println("@@@@"+ret );
            } catch (Exception e) {
              System.err.println(e.toString());
            }

Now I want to convert this client on Android application. I tried with
ksoap2,Xmlrpc as mention in previous posts but not able to get the
solution.
I have seen lots of people having the same issue.Some people might
have overcome this issue. Please help me to overcome from this issue.
I am really struggling with this issue.
Please provide me code snippet to resolve this issue.

Thanks in advance.
Prem.
--~--~---------~--~----~------------~-------~--~----~

3. how can display fancy button,menu (GUI)

4. Conversion to Dalvik format failed with error 2

5. About SimpleTalk

6. image database

7. jxta