Axis org.xml.sax.SAXParseException;行号:1;列数:1;prolog中不允许包含内容
下面是我用来访问Web服务的Axis客户端代码 我得到org.xml.sax.SAXParseException;行号:1;列数:1;prolog中不允许包含内容。这就是我发送Soap消息的时候 如果发送UTF-8编码的XML,则会出现套接字超时 这两种异常都发生在调用时 是否有一种方法可以忽略call.invoke上的BOM标记,这似乎是一个问题 如能迅速提供帮助,将不胜感激。。谢谢 公共类WSTestClient{public static void mainString[]args{ 试一试{Axis org.xml.sax.SAXParseException;行号:1;列数:1;prolog中不允许包含内容,axis,invoke,saxparseexception,Axis,Invoke,Saxparseexception,下面是我用来访问Web服务的Axis客户端代码 我得到org.xml.sax.SAXParseException;行号:1;列数:1;prolog中不允许包含内容。这就是我发送Soap消息的时候 如果发送UTF-8编码的XML,则会出现套接字超时 这两种异常都发生在调用时 是否有一种方法可以忽略call.invoke上的BOM标记,这似乎是一个问题 如能迅速提供帮助,将不胜感激。。谢谢 公共类WSTestClient{public static void mainString[]args{ 试一
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());
}}}
有什么更新吗?我好像在超时的时候也得到了类似的结果。