forum-informatico
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Ajude a Asast
Patrocinadores
Últimos assuntos
» Artigo ethereum
SAAJ - Soap With Attachments API for Java EmptyTer Set 24, 2019 1:16 pm por jpmartins

» Artigo Bitcoin
SAAJ - Soap With Attachments API for Java EmptyTer Set 24, 2019 1:13 pm por jpmartins

» Novo site para desportistas / New site for athletes
SAAJ - Soap With Attachments API for Java EmptyTer Dez 04, 2018 8:19 am por Admin

» Check used port with the command line
SAAJ - Soap With Attachments API for Java EmptyTer Dez 04, 2018 8:10 am por Admin

» Check the port where mariaDB is running
SAAJ - Soap With Attachments API for Java EmptySeg Dez 03, 2018 4:59 am por Admin

» Check the linux version
SAAJ - Soap With Attachments API for Java EmptySeg Dez 03, 2018 3:12 am por Admin

» Granting rights to a database for a user
SAAJ - Soap With Attachments API for Java EmptyQui Nov 29, 2018 2:04 am por Admin

» Create new user
SAAJ - Soap With Attachments API for Java EmptyQui Nov 29, 2018 2:01 am por Admin

» Change level of password security level
SAAJ - Soap With Attachments API for Java EmptyQui Nov 29, 2018 1:59 am por Admin

AdSense
Contributo

SAAJ - Soap With Attachments API for Java

Ir para baixo

SAAJ - Soap With Attachments API for Java Empty SAAJ - Soap With Attachments API for Java

Mensagem  Admin Seg Mar 31, 2008 4:31 am

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);
...
Admin
Admin
Admin

Mensagens : 607
Data de inscrição : 21/01/2008
Idade : 47

https://forum-informatico.forumeiros.com

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

 
Permissões neste sub-fórum
Não podes responder a tópicos