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(“http://servidor/cadastro/gerador.asmx”);
// 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” ,"" , “http://servidor/cadastro/”);
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("<RFP>"+bf1.toString()+"</RFP>");
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("");