Fórum autenticação no cabeçalho SOAP delphi #526347
20/07/2015
0
POST http://192.168.1.27/smsXMLWebService/smsXMLWebService.asmx HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://G4T.com/G4TLogin"
Content-Length: 1015
Host: 192.168.1.27
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Header><wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:UsernameToken wsu:Id="UsernameToken-2F9FBA1623522AD518143743008449964"><wsse:Username>installer</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">install</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">sTnuvmzWKuM7MKYDdyiEGg==</wsse:Nonce><wsu:Created>2015-07-20T22:08:04.499Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header>
<soap:Body>
<G4TLogin xmlns="http://G4T.com"/>
</soap:Body>
</soap:Envelope>
estou usador o soapUI para testar web services funciona perfeitamente.
já no delphi não consigo fazer a conexão da erro de login
procedure Tfrmmain.Button1Click(Sender: TObject);
var
Headers: ISOAPHeaders;
AuthHeader1 : TAuthHeader;
begin
AuthHeader1 := TAuthHeader.Create;
AuthHeader1.Username := 'installer';
AuthHeader1.Password := 'install';
ws.SOAPHeaders.Send(AuthHeader1);
(ws as smsXMLWebServiceSoap).G4TLogin;
end;
[img]http://arquivo.devmedia.com.br/forum/imagem/405545-20150720-194814.png[/img]
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://G4T.com/G4TLogin"
Content-Length: 1015
Host: 192.168.1.27
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Header><wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:UsernameToken wsu:Id="UsernameToken-2F9FBA1623522AD518143743008449964"><wsse:Username>installer</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">install</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">sTnuvmzWKuM7MKYDdyiEGg==</wsse:Nonce><wsu:Created>2015-07-20T22:08:04.499Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header>
<soap:Body>
<G4TLogin xmlns="http://G4T.com"/>
</soap:Body>
</soap:Envelope>
estou usador o soapUI para testar web services funciona perfeitamente.
já no delphi não consigo fazer a conexão da erro de login
procedure Tfrmmain.Button1Click(Sender: TObject);
var
Headers: ISOAPHeaders;
AuthHeader1 : TAuthHeader;
begin
AuthHeader1 := TAuthHeader.Create;
AuthHeader1.Username := 'installer';
AuthHeader1.Password := 'install';
ws.SOAPHeaders.Send(AuthHeader1);
(ws as smsXMLWebServiceSoap).G4TLogin;
end;
[img]http://arquivo.devmedia.com.br/forum/imagem/405545-20150720-194814.png[/img]
Bruno Natali
Curtir tópico
+ 0
Responder
Clique aqui para fazer login e interagir na Comunidade :)