You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Alice christy <sw...@tcs.com> on 2007/10/26 08:54:12 UTC

HttpClient - help on submitting request to webservice

Hi,

I am using Httpclient to post my request to the webservice and get the
response from the webservice. I need to bypass the proxy and then hit the
webservice.

//Configure the host
httpClient.getHostConfiguration().setProxyHost(new
ProxyHost("xxx.xx.xx.xx"));
httpClient.getState().setProxyCredentials(null,null,new
UsernamePasswordCredentials("username", "password"));

PostMethod post = new
PostMethod("http://sampleDomain.com:30010/webservice");
post.setRequestBody(myRequestXML);
post.setDoAuthentication(true);

// Execute request
result = httpClient.executeMethod(post);

I am able to hit the webservice URL http://sampleDomain.com:30010/webservice
(for example) in IE. But I get response as below on running the code above:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>

Not Found
The requested URL /~transfer/sampleDomain.com/webservice was not found on
this server.

<hr />
<address>Apache/2.0.47 (Unix) mod_ssl/2.0.47  Server at sampleDomain.com
Port 80</address>
</body></html>

I think it is using the default port 80 and it is not using the port 30010
for submitting the request to the webservice.

can anybody help me on the code changes required?

Regards,
Swathi 
-- 
View this message in context: http://www.nabble.com/HttpClient---help-on-submitting-request-to-webservice-tf4695497.html#a13421771
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org