AYUDA A CONSUMIR UN WEB SERVICE ASMX
Hola a toda la comunidad de Java requiero de su valioso conocimiento para ver si me pueden ayudar a consumir un web service hecho en .net les dejo aca el codigo:
@WebMethod
public static RecargaResponse Catel(Param dto)
{
try{
conection();
String sku="";
String select="SELECT T008_SKU FROM TASEB_TA008 WHERE t008_tipoOperacion=?";
PreparedStatement statemen = con.prepareStatement(select);
statemen.setString(1, dto.getCarrier());
statemen.executeQuery();
ResultSet result;
result = statemen.executeQuery();
while(result.next())
{
sku=result.getString("T008_SKU");
}
System.out.println("Sku\t"+sku);
Recarga x=new Recarga();
x.setUsuario("WSBARARED");
x.setOrigen("WS");
x.setCarrier(sku);
x.setSessionId("qzlilylkiqjzvmnmeumu0hy4");
x.setTienda("BaraRed");
WSRecargaSoap ws=new WSRecarga().getWSRecargaSoap();
Object re=ws.recarga(x.getUsuario(), x.getOrigen(), dto.getNumero(), dto.getCarrier(), dto.getMonto(), x.getSessionId(),x.getTienda());
rec = new RecargaResponse();
re= re.toString().replace("<CodigoError></CodigoError>", "<error></error>");
re= re.toString().replace("<FolioVenta>0</FolioVenta>", "<codigo_respuesta></codigo_respuesta>");
re= re.toString().replace("<Mensaje></Mensaje>", "<mensaje_respuesta></mensaje_respuesta>");
re= re.toString().replace("<Ticket>0</Ticket>", "<mensaje_aclaraciones></mensaje_aclaraciones>");
rec.setRecargaResult(re);
// re =re.replace("<exito>true</exito>", "<error>false</error>");
}catch (Exception e) {
e.printStackTrace();
}
return rec;
}
public static RecargaResponse Catel(Param dto)
{
try{
conection();
String sku="";
String select="SELECT T008_SKU FROM TASEB_TA008 WHERE t008_tipoOperacion=?";
PreparedStatement statemen = con.prepareStatement(select);
statemen.setString(1, dto.getCarrier());
statemen.executeQuery();
ResultSet result;
result = statemen.executeQuery();
while(result.next())
{
sku=result.getString("T008_SKU");
}
System.out.println("Sku\t"+sku);
Recarga x=new Recarga();
x.setUsuario("WSBARARED");
x.setOrigen("WS");
x.setCarrier(sku);
x.setSessionId("qzlilylkiqjzvmnmeumu0hy4");
x.setTienda("BaraRed");
WSRecargaSoap ws=new WSRecarga().getWSRecargaSoap();
Object re=ws.recarga(x.getUsuario(), x.getOrigen(), dto.getNumero(), dto.getCarrier(), dto.getMonto(), x.getSessionId(),x.getTienda());
rec = new RecargaResponse();
re= re.toString().replace("<CodigoError></CodigoError>", "<error></error>");
re= re.toString().replace("<FolioVenta>0</FolioVenta>", "<codigo_respuesta></codigo_respuesta>");
re= re.toString().replace("<Mensaje></Mensaje>", "<mensaje_respuesta></mensaje_respuesta>");
re= re.toString().replace("<Ticket>0</Ticket>", "<mensaje_aclaraciones></mensaje_aclaraciones>");
rec.setRecargaResult(re);
// re =re.replace("<exito>true</exito>", "<error>false</error>");
}catch (Exception e) {
e.printStackTrace();
}
return rec;
}
cuando lo invoco el mensaje que me da es esto:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:CatelResponse xmlns:ns2="http://WsUniversal.com/" xmlns:ns3="http://tempuri.org/">
<return>
<ns3:RecargaResult xsi:type="xs:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">[RecargaResult: null]</ns3:RecargaResult>
</return>
</ns2:CatelResponse>
</soap:Body>
</soap:Envelope>
<soap:Body>
<ns2:CatelResponse xmlns:ns2="http://WsUniversal.com/" xmlns:ns3="http://tempuri.org/">
<return>
<ns3:RecargaResult xsi:type="xs:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">[RecargaResult: null]</ns3:RecargaResult>
</return>
</ns2:CatelResponse>
</soap:Body>
</soap:Envelope>
como pueden ver lo unico que me retorna es: [RecargaResult: null] y no se a que de debe si he logrado consumir Web Service de java y no me salen estos errores , e pero y me puedan ayudar ..
Saludos..
- Valerio's blog
- Inicie sesión o regístrese para enviar comentarios
Comentarios recientes
hace 24 semanas 12 horas
hace 44 semanas 4 días
hace 2 años 4 semanas
hace 2 años 8 semanas
hace 2 años 15 semanas
hace 2 años 23 semanas
hace 2 años 26 semanas
hace 2 años 28 semanas
hace 2 años 31 semanas
hace 2 años 31 semanas