lackki rao [
http://community.jboss.org/people/lackki9] replied to the discussion
"SoapProxy issue while calling Client Program"
To view the discussion, visit:
http://community.jboss.org/message/544507#544507
--------------------------------------------------------------
Here is my Client code but nothing great.
public class ClientTest
{
private static final String SOAP_SAMPLE =
"<soapenv:Envelope xmlns:soapenv=\"
http://schemas.xmlsoap.org/soap/envelope/
http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"
http://www.webservicex.net/ http://www.webservicex.net/\">"+
"<soapenv:Header/>"+
"<soapenv:Body>"+
"<web:GetQuote>"+
"<web:symbol>RHT</web:symbol>"+
"</web:GetQuote>"+
"</soapenv:Body>"+
"</soapenv:Envelope>";
public static void main(String args[]) throws Exception
{
String url = "
http://localhost:8080/Proxy/http/Proxy_Basic/Proxy
http://localhost:8080/Proxy/http/Proxy_Basic/Proxy";
System.out.println("**** REQUEST URL: " + url);
PostMethod method = new PostMethod(url);
method.setRequestHeader("Content-Type", "text/xml;charset=UTF-8");
//method.addParameter("proxyHost", "10.48.133.184");
//method.addParameter("proxyPort", "6588");
//method.addParameter("proxySet", "true");
//System.setProperty("proxyHost", "10.48.133.184");
//System.setProperty("proxyPort", "6588");
//method.
method.setRequestHeader("SOAPAction", "\"\"");
//String request = SOAP_SAMPLE;
System.out.println("**** REQUEST BODY: " + SOAP_SAMPLE);
method.setRequestEntity( new StringRequestEntity(SOAP_SAMPLE) );
HttpClient client = new HttpClient();
InputStream response = null;
try
{
int code = client.executeMethod(method);
System.out.println("**** RESPONSE CODE: " + code);
response = method.getResponseBodyAsStream();
byte[] bytes = StreamUtils.readStream(response);
System.out.println("**** RESPONSE BODY: " + new String(bytes,
method.getResponseCharSet()));
}
finally
{
method.releaseConnection();
if (response != null)
{
response.close();
}
}
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/544507#544507]
Start a new discussion in JBoss ESB Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]