Here is Axis client code that i am using to hit the webservice I am getting org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. This is when i send a Soap Message I get a Socket time out if i send XML with UTF-8 encoded
Both exceptions happen on invoke
Is there a way i can ignore BOM marker on call.invoke which seems to be issue.
Quick help would be appreciated.. thanks
public class WSTestClient { public static void main(String [] args) { try{
String acordXMLUrl = "C:\\request.xml";
File xmlFile = new File(acordXMLUrl);
InputStream in = new FileInputStream(xmlFile);
Reader reader = new InputStreamReader(in, "UTF-8");
int c;
StringBuffer sb = new StringBuffer();
while ((c = in.read()) != -1)
sb.append((char) c);
String acordXML = sb.toString();
Message msg = new Message(acordXMLUrl);
SOAPEnvelope se;
String endpoint ="https://somewebservice/getme";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTimeout(5000);
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://soapactionurl","getme"));
System.out.println("Calling into webservice" );
String ret="";
try{
//ret = (String) call.invoke( new Object[] {acordXML} );
se = call.invoke( msg);
}
catch (RemoteException e) {
System.err.println(e.toString());
}
System.out.println("Return is:"+ ret);
}
catch (Exception e) {
System.err.println(e.toString());
}}}