Java: "The message with Action 'X' can not be processed on the recipient."

0

I'm having trouble understanding what's being done wrong and because I'm getting this error message in java when trying to send the XML to the city of Camaquã. The parameters used and the wsdl link are in the code below.

Message: "The message with Action ' link ' can not be processed at the recipient, due to an incorrect ContractFilter in the EndpointDispatcher. (incompatible actions between sender and recipient) or an association / security incompatibility between the sender and the recipient Verify that the sender and the recipient have the same contract and the same association (including the security requirements , for example, Message, Transport, None). "

Code with parameters used for sending:

public String enviarXMLAbaco(String caminhoXML, int codLancamento, String basedados, String servidor) {

    String ret = ""; 
        Logger.getLogger("org.apache.pdfbox.util.PDFStreamEngine");


    try{
        NFSeParametrosDAO nfseparametrosdao = new 
        NFSeParametrosDAO(servidor, "5432", basedados, "postgres", "");

        String url = "http://nfseteste.camaqua.rs.gov.br/NFSEWSTESTE/Services.svc?wsdl"

        if (url.equals("")){
            JOptionPane.showMessageDialog(null, "Não foi localizada a URL para envio do Arquivo XML");
            System.exit(0);
        }

        SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
        SOAPConnection soapConnection = soapConnectionFactory.createConnection();
        String servico = "RecepcionarLoteRps";
        String namespace = "http://tempuri.org/";

        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); 
        dbf.setNamespaceAware(true); 
        DocumentBuilder builder = dbf.newDocumentBuilder();  
        Document doc = builder.parse(new FileInputStream(caminhoXML));
        DOMSource domSource = new DOMSource(doc);
        StringWriter writer = new StringWriter();
        StreamResult result = new StreamResult(writer);
        TransformerFactory tf = TransformerFactory.newInstance();
        Transformer transformer = tf.newTransformer();
        transformer.transform(domSource, result);        
        String xml = writer.toString();

        String [][] parametros = new String[2][2];
        parametros[0] [0] = "Nfsecabecmsg";
        parametros[0] [1] = "<cabecalho versao=\"201001\"><versaoDados>V2010</versaoDados></cabecalho>";
        parametros[1] [0] = "Nfsedadosmsg";

        parametros[1] [1] = xml;

        SOAPMessage soapResponse = soapConnection.call(createSOAPRequest(namespace, "e", servico, parametros), url);

        ret = printSOAPResponse(soapResponse);
        ret = removeEnvelopSoap(ret);
        ret = removeHeaderXML(ret + "");
        ret = ret.replaceAll("&lt;", "<");
        ret = ret.replaceAll("&gt;", ">");
        soapConnection.close();

        System.out.println("Fim WS Envio: " + new Date());


    } catch (Exception e) {

        System.out.println("Fim WS Envio Erro: " + new Date());
        JOptionPane.showMessageDialog(null, "Exception:" + e.getMessage(), "Erro", JOptionPane.ERROR_MESSAGE);
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        e.printStackTrace(pw);      
        ALLogger.getInstance().error(sw.toString());
        e.printStackTrace();
        System.exit(0);
    }
    return ret;
}
    
asked by anonymous 16.02.2018 / 12:39

0 answers