hi,
I am Facing issues regarding posting the soap xml as a string (it was
working fine till i was using file) in setting post.requestEntity();
PostMethod post = new PostMethod(strURL);
// Get target URL
// Request content will be retrieved directly
// from the input stream
String xm = "<soap:Envelope
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><soap:Header><AuthenticationToken
xmlns=\"http://user.mynamesspace.com\">..................................</soap:Body></soap:Envelope>";
// String to be passed
RequestEntity entity1 = new
StringRequestEntity(xm,"SOAPREQUEST",""); //*my error is here.* I have
tried passing
//StringRequestEntity(content) and
//StringRequestEntity(content, contenttype, charset);
//RequestEntity entity = new FileRequestEntity(input,
"text/xml; charset=ISO-8859-1"); //file was working fine
earlier
post.setRequestEntity(entity1);
post.setRequestHeader("SOAPAction", strSoapAction);
// Get HTTP client
HttpClient httpclient = new HttpClient();
// Execute request
try {
int result = httpclient.executeMethod(post);
response = post.getResponseBodyAsString();
System.out.println("String
Response"+post.getResponseBodyAsString());
}
finally {
// Release current connection to the connection pool once
you are done
post.releaseConnection();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]