Olá pessoal, estou tentado executar o seguinte método onde faz uma conexão via metodo post passando como parâmetro um XML de requisição:
Método utilizado:
public static String submit(boolean live, String xml) throws IOException {
String url = "http://xxxteste.operadora.co.uk/";
if (live) {
url = "http://xxxlivemaster.operadora.co.uk/";
}
PostMethod post = new PostMethod(url);
post.addParameter("xml_request", xml);
HttpClient client = new HttpClient();
client.executeMethod(post);
return post.getResponseBodyAsString();
}
XML enviado:
<?xml version="1.0" encoding="UTF-8"?>
<BOOKING type="BE" returnURLNeed="no" returnURL="http://" AGENTCODE="xxxxxx" AGENTPASSWORD="xxxxxx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xxxxxx.operadora.co.uk/BookEnquiry.xsd">
<HEADER>
<INTERNAL_CODE1>aaaaaa</INTERNAL_CODE1>
<INTERNAL_CODE2>ssssss</INTERNAL_CODE2>
<INTERNAL_CODE4>dddddd</INTERNAL_CODE4>
<INTERNAL_CODE7>ee</INTERNAL_CODE7>
<INTERNAL_CODE8>travel system</INTERNAL_CODE8>
</HEADER>
<DATA REF_NO="yza2345" DATE="08-Jan-2010">
<OUR_REF_NO>548755</OUR_REF_NO>
</DATA>
</BOOKING>
Mas estou recebendo uma mensagem de EXCEPTION do servidor.
Error! Parser : Request XML ( oracle.xml.parser.v2.XMLParseException: Start of root element expected. Error No:4001)
O XML é muito básico e não sei o porque dessa exception.
Por favor preciso de uma ajudinha aqui… please 