É um serviço da Web SOAP padrão e comum. SSH não tem nada a ver aqui. Acabei de ligar comondulação (uma linha):
$ curl -X POST -H "Content-Type: text/xml" \
-H 'SOAPAction: "http://api.eyeblaster.com/IAuthenticationService/ClientLogin"' \
--data-binary @request.xml \
https:
Onde o request.xml
arquivo tem o seguinte conteúdo:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.eyeblaster.com/">
<soapenv:Header/>
<soapenv:Body>
<api:ClientLogin>
<api:username>user</api:username>
<api:password>password</api:password>
<api:applicationKey>key</api:applicationKey>
</api:ClientLogin>
</soapenv:Body>
</soapenv:Envelope>
Eu recebo este lindo 500:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:Security.Authentication.UserPassIncorrect</faultcode>
<faultstring xml:lang="en-US">The username, password or application key is incorrect.</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
Você tentou soapui?
Consulte Mais informação
Na linha de comando do Linux, você pode simplesmente executar:
curl -H "Content-Type: text/xml; charset=utf-8" -H "SOAPAction:" -d @your_soap_request.xml -X POST https://ws.paymentech.net/PaymentechGateway
fonte
Usando CURL:
SOAP_USER='myusername' PASSWORD='mypassword' AUTHENTICATION="$SOAP_USER:$PASSWORD" URL='http://mysoapserver:8080/meeting/aws' SOAPFILE=getCurrentMeetingStatus.txt TIMEOUT=5
Pedido CURL:
curl --user "${AUTHENTICATION}" --header 'Content-Type: text/xml;charset=UTF-8' --data @"${SOAPFILE}" "${URL}" --connect-timeout $TIMEOUT
Eu uso isso para verificar a resposta:
http_code=$(curl --write-out "%{http_code}\n" --silent --user "${AUTHENTICATION}" --header 'Content-Type: text/xml;charset=UTF-8' --data @"${SOAPFILE}" "${URL}" --connect-timeout $TIMEOUT --output /dev/null) if [[ $http_code -gt 400 ]]; # 400 and 500 Client and Server Error codes http://en.wikipedia.org/wiki/List_of_HTTP_status_codes then echo "Error: HTTP response ($http_code) getting URL: $URL" echo "Please verify parameters/backend. Username: $SOAP_USER Password: $PASSWORD Press any key to continue..." read entervalue || continue fi
fonte
Aqui está outro exemplo de solicitação CURL - SOAP ( WSDL ) para códigos de banco swift
Solicitação
curl -X POST http://www.thomas-bayer.com/axis2/services/BLZService \ -H 'Content-Type: text/xml' \ -H 'SOAPAction: blz:getBank' \ -d ' <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:blz="http://thomas-bayer.com/blz/"> <soapenv:Header/> <soapenv:Body> <blz:getBank> <blz:blz>10020200</blz:blz> </blz:getBank> </soapenv:Body> </soapenv:Envelope>'
Resposta
< HTTP/1.1 200 OK < Server: Apache-Coyote/1.1 < Content-Type: text/xml;charset=UTF-8 < Date: Tue, 26 Mar 2019 08:14:59 GMT < Content-Length: 395 < <?xml version='1.0' encoding='UTF-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns1:getBankResponse xmlns:ns1="http://thomas-bayer.com/blz/"> <ns1:details> <ns1:bezeichnung>BHF-BANK</ns1:bezeichnung> <ns1:bic>BHFBDEFF100</ns1:bic> <ns1:ort>Berlin</ns1:ort> <ns1:plz>10117</ns1:plz> </ns1:details> </ns1:getBankResponse> </soapenv:Body> </soapenv:Envelope>
fonte
curl --header "Content-Type: text/xml;charset=UTF-8" --header "SOAPAction:ACTION_YOU_WANT_TO_CALL" --data @FILE_NAME URL_OF_THE_SERVICE
O comando acima foi útil para mim
Exemplo
curl --header "Content-Type: text/xml;charset=UTF-8" --header "SOAPAction:urn:GetVehicleLimitedInfo" --data @request.xml http://11.22.33.231:9080/VehicleInfoQueryService.asmx
Mais informações
fonte
Para usuários do Windows que procuram uma alternativa ao PowerShell, aqui está (usando POST). Eu o dividi em várias linhas para facilitar a leitura.
$url = 'https://sandbox.mediamind.com/Eyeblaster.MediaMind.API/V2/AuthenticationService.svc' $headers = @{ 'Content-Type' = 'text/xml'; 'SOAPAction' = 'http://api.eyeblaster.com/IAuthenticationService/ClientLogin' } $envelope = @' <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Body> <yourEnvelopeContentsHere/> </Body> </Envelope> '@ # <--- This line must not be indented Invoke-WebRequest -Uri $url -Headers $headers -Method POST -Body $envelope
fonte
Para Windows:
Salve o seguinte como MSFT.vbs:
set SOAPClient = createobject("MSSOAP.SOAPClient") SOAPClient.mssoapinit "https://sandbox.mediamind.com/Eyeblaster.MediaMind.API/V2/AuthenticationService.svc?wsdl" WScript.Echo "MSFT = " & SOAPClient.GetQuote("MSFT")
Em seguida, em um prompt de comando, execute:
C:\>MSFT.vbs
Referência: http://blogs.msdn.com/b/bgroth/archive/2004/10/21/246155.aspx
fonte
Para Windows, achei isso funcionando:
Set http = CreateObject("Microsoft.XmlHttp") http.open "GET", "http://www.mywebservice.com/webmethod.asmx?WSDL", FALSE http.send "" WScript.Echo http.responseText
Referência: CodeProject
fonte