SAAJ - Soap With Attachments API for Java
Página 1 de 1
SAAJ - Soap With Attachments API for Java
Aqui fica um pequeno exemplo de como criar uma mensagem SOAP do tipo SAAJ e enviá-la para um web service preparado para tratar uma mensagem desse tipo.
...
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
SOAPConnection connection = soapConnectionFactory.createConnection();
SOAPFactory soapFactory = SOAPFactory.newInstance();
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
SOAPHeader header = message.getSOAPHeader();
SOAPBody body = message.getSOAPBody();
header.detachNode();
body.addTextNode(sXml);
URL endpoint = new URL("http://localhost:8080/WS/WSOperation");
SOAPMessage response = connection.call(message, endpoint);
...
...
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
SOAPConnection connection = soapConnectionFactory.createConnection();
SOAPFactory soapFactory = SOAPFactory.newInstance();
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
SOAPHeader header = message.getSOAPHeader();
SOAPBody body = message.getSOAPBody();
header.detachNode();
body.addTextNode(sXml);
URL endpoint = new URL("http://localhost:8080/WS/WSOperation");
SOAPMessage response = connection.call(message, endpoint);
...
Tópicos semelhantes
» The Java Posse
» Envio de attach em mensagem SOAP
» Webservice SAAJ
» Libraria 1.2 de SAAJ
» Turotial Java
» Envio de attach em mensagem SOAP
» Webservice SAAJ
» Libraria 1.2 de SAAJ
» Turotial Java
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
Ter Set 24, 2019 1:16 pm por jpmartins
» Artigo Bitcoin
Ter Set 24, 2019 1:13 pm por jpmartins
» Novo site para desportistas / New site for athletes
Ter Dez 04, 2018 8:19 am por Admin
» Check used port with the command line
Ter Dez 04, 2018 8:10 am por Admin
» Check the port where mariaDB is running
Seg Dez 03, 2018 4:59 am por Admin
» Check the linux version
Seg Dez 03, 2018 3:12 am por Admin
» Granting rights to a database for a user
Qui Nov 29, 2018 2:04 am por Admin
» Create new user
Qui Nov 29, 2018 2:01 am por Admin
» Change level of password security level
Qui Nov 29, 2018 1:59 am por Admin