ERRO client java para WS dotNet - Server did not recognize the value of HTTP Header SOAPAction

0 respostas
A

Pessoal, estou usando o saaj axis 1.1 ( ja tentei o saaj1.3) e estou tendo um grande problema no soap, com a seguinte mensagem “Server did not recognize the value of HTTP Header SOAPAction” .

obs: só posso usar a jre 1.4_02

=================================

java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

//endpoint = service urls

java.net.URL endpoint = new java.net.URL(“<a href="http://servidor/cadastro/gerador.asmx">http://servidor/cadastro/gerador.asmx</a>”);

// Create request message

javax.xml.soap.MessageFactory mf = javax.xml.soap.MessageFactory.newInstance();

javax.xml.soap.SOAPMessage request = mf.createMessage();

// Get message elements

javax.xml.soap.SOAPPart part = request.getSOAPPart();

javax.xml.soap.SOAPEnvelope envelope = part.getEnvelope();

// Remove header

javax.xml.soap.SOAPHeader header = envelope.getHeader();

((javax.xml.soap.Node)header).detachNode();

// Add content to body

javax.xml.soap.SOAPBody body = envelope.getBody();

javax.xml.soap.Name soapAction = envelope.createName(“OBTEM_RFP” ,"" , <a href="http://servidor/cadastro/">http://servidor/cadastro/</a>”);
javax.xml.soap.SOAPBodyElement bodyElement = body.addBodyElement(soapAction);

// Add mensagem

JOptionPane.showMessageDialog(null,“Ok”);
javax.xml.soap.SOAPElement mensagem = bodyElement.addChildElement(“stArquivo”).addTextNode(“XML”);

String depto = “teste”;

bodyElement.addChildElement(“stNomeDep”).addTextNode(depto);

bodyElement.addChildElement(“stRFP”).addTextNode(""+bf1.toString()+"");
javax.xml.soap.SOAPConnectionFactory scf = javax.xml.soap.SOAPConnectionFactory.newInstance();

javax.xml.soap.SOAPConnection sc = scf.createConnection();

javax.xml.soap.SOAPMessage response = sc.call(request, endpoint);
System.out.println(response: " + response);

response.writeTo(System.out);

System.out.println(”");
Criado 9 de junho de 2007
Respostas 0
Participantes 1