|
FORUMS PROFESSIONNELS WINDEV, WEBDEV et WINDEV Mobile |
| | | | | |
Acessando Webservice Ws_security feito com Embarcadeiro |
Débuté par adrianoboller, 09 déc. 2014 16:42 - 7 réponses |
| |
| | | |
|
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 09 décembre 2014 - 16:42 |
Procedure WS_Taxi_Disponivel(LOCAL DebugSN)
ok, bRet is boolean = False
nRetornoCodigo is int = 0
nContador is int = 0
CodClienteCelula is string = ""
XML_Retorno is string = ""
LocSt_TaxisLogados is ST_TaxisLogados
IpSaladaFruta01 is string = Morango_01 +"."+ Abacaxi_02 +"."+ Limao_03 +"."+ Melancia_04 +":"+ Laranja_05
IpSaladaFruta02 is string = Morango_01 +"."+ Abacaxi_02 +"."+ Limao_03 +"."+ Melancia_04 +":"+ Manga_06
ChangeCharset(charsetOccidental)
HReadSeekFirst(t001_cliente,t001_cliente.t001_seq_cliente,1) IF HFound(t001_cliente) = True AND t001_cliente.t001_cod_clientecelula > 0 THEN
CodClienteCelula = t001_cliente.t001_cod_clientecelula
NumProces is string = WS_Taxi_ValidaRequisicao(t001_cliente.t001_ddd_telefone,... t001_cliente.t001_num_telefone,... 0,... 0,... "N")
Xml_SEND is string = [ <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:act297_RtPlusSSDM-IRtPlusSSDM#ObterRelacaoDeVeiculosLogados"> <soapenv:Header/> <soapenv:Body> <urn:ObterRelacaoDeVeiculosLogados soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <cod_client_celula xsi:type="xsd:int">V001</cod_client_celula> <dat_hora_proces xsi:type="xsd:string">V002</dat_hora_proces> <num_proces xsi:type="xsd:int">V003</num_proces> </urn:ObterRelacaoDeVeiculosLogados> </soapenv:Body> </soapenv:Envelope> ]
Xml_SEND = Clip(Replace(Xml_SEND,"V001",CodClienteCelula)) Xml_SEND = Clip(Replace(Xml_SEND,"V002",GloDataHora)) Xml_SEND = Clip(Replace(Xml_SEND,"V003",NumProces))
IF DebugSN = "S" THEN Info("/mnt/sdcard/TaxiFv/Arquivos/EnvioWSVersao.TXT", Xml_SEND) IF InAndroidMode() = True IF InSimulatorMode() = False THEN fSaveBuffer("/mnt/sdcard/TaxiFv/Arquivos/EnvioWSVersao.TXT", Xml_SEND) ELSE fSaveBuffer("c:\EnvioWSVersao.TXT", Xml_SEND) END END END
HTTPTimeOut(GloHTTPTimeOut)
ok = HTTPRequest("http://"+IpSaladaFruta01+"/soap/IRtPlusSSDM","", "", Xml_SEND, "text/xml","","")
IF ok = True
XML_Retorno = WS_Android_IOS_HTTPGetResult()
ok = False
IF DebugSN = "S" Info("/mnt/sdcard/TaxiFv/Arquivos/RetornoWSVersaoSemTratamento.TXT",XML_Retorno) IF InAndroidMode() = True IF InSimulatorMode() = False THEN fSaveBuffer("/mnt/sdcard/TaxiFv/Arquivos/RetornoWSVersaoSemTratamento.TXT", XML_Retorno) ELSE fSaveBuffer("C:\RetornoWSVersao.TXT", XML_Retorno) END END END
XML_Retorno = WS_RemoveAcentos(XML_Retorno)
IF Length(XML_Retorno) > 0 THEN
ArrayDeleteAll(arr_TaxisLogados)
IF IniOSMode() = True THEN
NoXml is string i is int = 1
LOOP
NoXml = XMLExtractString(XML_Retorno,"NS2:TVeiculoLogadoVO",i)
IF NoXml = "" THEN BREAK END
LocSt_TaxisLogados.ST_ID = XMLExtractString(NoXml,"NumUnidad") LocSt_TaxisLogados.ST_Latitude = XMLExtractString(NoXml,"ValLatitu",1) LocSt_TaxisLogados.ST_Longitude = XMLExtractString(NoXml,"ValLongit",1) LocSt_TaxisLogados.ST_Situacao = XMLExtractString(NoXml,"IdeStatus",1)
arr_TaxisLogados[LocSt_TaxisLogados.ST_ID] = LocSt_TaxisLogados
nContador ++ i++ ok = True
IF DebugSN = "S" THEN Info(LocSt_TaxisLogados.ST_ID,LocSt_TaxisLogados.ST_Latitude,LocSt_TaxisLogados.ST_Longitude,LocSt_TaxisLogados.ST_Situacao) END
END
ELSE IF InAndroidMode() = True
nInicial is int nFinal is int nInicial = PositionOccurrence(XML_Retorno,"<NS2:TVeiculoLogadoVO",firstRank,FromBeginning) nFinal = PositionOccurrence(XML_Retorno,"</NS2:TVeiculoLogadoVO>",lastRank,FromEnd) +Length("</NS2:TVeiculoLogadoVO>") XML_Retorno = Middle(XML_Retorno,nInicial,nFinal - nInicial) XML_Retorno = Replace(XML_Retorno,"NS2:TVeiculoLogadoVO","NoXml") XML_Retorno = "<Xml><Recorte>"+XML_Retorno+"</Recorte></Xml>"
IF DebugSN = "S" THEN Info(XML_Retorno) IF InAndroidMode() = True fSaveBuffer("/mnt/sdcard/TaxiFv/Arquivos/RecorteBlocoLogados.TXT", XML_Retorno) END END
XmlDoc is XMLDocument
XmlDoc = XMLOpen(XML_Retorno, fromString)
NoXml is xmlNode
FOR EACH NoXml OF XmlDoc.Xml.Recorte on NoXml
IF NoXml.NumUnidad <> Null AND NoXml.ValLatitu <> Null AND NoXml.ValLongit <> Null THEN
nContador += 1 ok = True LocSt_TaxisLogados.ST_ID = NoXml.NumUnidad LocSt_TaxisLogados.ST_Latitude = NoXml.ValLatitu LocSt_TaxisLogados.ST_Longitude = NoXml.ValLongit LocSt_TaxisLogados.ST_Situacao = NoXml.IdeStatus
arr_TaxisLogados[LocSt_TaxisLogados.ST_ID] = LocSt_TaxisLogados
END
END
END
END
END
END
IF DebugSN = "S" THEN Info("Qtde de Taxis Disponiveis:",nContador) END
RESULT(ok) |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 09 décembre 2014 - 17:31 |
How is the ws_security webservice done with embarcadeiro (Como é o webservice ws_security feito com embarcadeiro)
<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"> <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-e97649ba-da58-429e-8b1c-a51fac8ce5e4"> <wsu:Created>2007-04-10T20:10:13Z</wsu:Created> <wsu:Expires>2007-04-10T20:11:13Z</wsu:Expires> </wsu:Timestamp> <wsse:BinarySecurityToken ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-080766c7-0c4f-4dec-881f-2a07fc0b3e09">MIICGDCCAYGgAwIBAgIBADANBgkqhkiG9w0BAQUFADBSMQswCQYDVQQGEwJVUzELMAkGA1UECBMCTUExEjAQBgNVBAcTCUNhbWJyaWRnZTESMBAGA1U EChMJRGF0YVBvd2VyMQ4wDAYDVQQDEwVBbGljZTAeFw0wMjExMjMwMTE1MzNaFw0xMjExMjMwMTE1MzNaMFIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJNQTESMBAGA1UEBxMJQ2FtYnJpZGdlMRIwEAYDVQQKEwlEYXRhUG93ZXIxDjAMBgNVBAMTBUFsaWNlMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCUIz3F9Kwgu57QfATZfCJmJq0kNoXFN2cagRP/YtH+T3A0fyA6g0MASAkjRX4waOCZL/Dpl+kIyUiFjbDku2vNIZS49OC66g021bIJpDHrV2+nML+XDc5tTOgyNCX2drT3AL9Rjj2guAIvUQLvi8Nj7sd2PL98h4wCKQCXbMpOdwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAJBKfQN7hJZ2tNjLiZWpXaRyiTc80TDZhPZYsSAEMYJ13R4gcThuZuSkpr3qxpdHotS8KhNn7FzVn /KtOnh1fqCGQQ6UfRiRAtEruhaBDI9jculwQRyzm7Ard7q5MLIIx3CKjaf12kN1mmEdHOitpfb+2LM/ksBIEaJ2MC5F0Jvi</wsse:BinarySecurityToken> <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-c3c88ae9-7f84-4e42-8072-ab5320440422"> <wsse:Username>femauser</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">passw0rd</wsse:Password> <wsse:Nonce>b/FEuSSdYLBPMbWhktSf4g==</wsse:Nonce> <wsu:Created>2007-04-10T20:10:13Z</wsu:Created> </wsse:UsernameToken> <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" /> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> <Reference URI="#Timestamp-e97649ba-da58-429e-8b1c-a51fac8ce5e4"> <Transforms> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> </Transforms> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> <DigestValue>hgwbQEdoP4El3oq0xBtueXgZP04=</DigestValue> </Reference:> <Reference URI="#Id-d998fece-5cdd-4fb8-a609-ba479b58e1e7"> <Transforms> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> </Transforms> <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /> <DigestValue>GF3nEBV24nUf5HgSNWeQGYHjkrE=</DigestValue> </Reference> </SignedInfo> <SignatureValue>WFT40oJ+a6bhZuPw8k5tMNlEm7PXhZeLFQLhWMlw+Zpc0mCTp6O3evmIIUhMF6ht9x4kpjimJw2Gykx9MA+KYrzAUmjU/sLp5yal7tW8uJLBtX2THPlv83d/gk1CUsLyv7tnp2YWE/Orypgc+HxbMSjvdYIr3ywAUTm633x6KUQ=</SignatureValue> <KeyInfo> <wsse:SecurityTokenReference> <wsse:Reference URI="#SecurityToken-080766c7-0c4f-4dec-881f-2a07fc0b3e09" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" /> </wsse:SecurityTokenReference> </KeyInfo> </Signature> </wsse:Security> </soap:Header> |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 09 décembre 2014 - 17:32 |
//Modelo a ser seguido:
//####ENVELOPE DE ENVIO#### -----> //<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" //xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" //xmlns:urn="urn:act297_RtPlusSSDM-IRtPlusSSDM"> //<soapenv:Header/> //<soapenv:Body> //<urn:ObterRelacaoDeVeiculosLogados soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> //<cod_client_celula xsi:type="xsd:int">1</cod_client_celula> //<dat_hora_proces xsi:type="xsd:string">2014-06-30T15:01:24</dat_hora_proces> //<num_proces xsi:type="xsd:int">1617</num_proces> //</urn:ObterRelacaoDeVeiculosLogados> //</soapenv:Body> //</soapenv:Envelope>
//####ENVELOPE DE RETORNO#### <---- ta aqui o que vem, um bloco confuso que no loop so vai atrapalhar //<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" //xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" //xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> //<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" //xmlns:NS1="urn:act297_RtPlusSSDM-IRtPlusSSDM" xmlns:NS2="urn:act297_RtPlusSSDM"> //<NS1:ObterRelacaoDeVeiculosLogadosResponse> //<return href="#1"/> //</NS1:ObterRelacaoDeVeiculosLogadosResponse> //<NS2:TVeiculosLogadosResult id="1"> //<ArrayVeiculosLogados> //<item href="#2"/> //</ArrayVeiculosLogados> //</NS2:TVeiculosLogadosResult> //<NS2:TVeiculoLogadoVO id="2"> //<NumUnidad>4</NumUnidad> //<ValLatitu>-25.468</ValLatitu> //<ValLongit>-49.227</ValLongit> //<IdeStatus>0</IdeStatus> //</NS2:TVeiculoLogadoVO> //<NS2:TVeiculoLogadoVO id="3"> //<NumUnidad>10</NumUnidad> //<ValLatitu>-25.39272</ValLatitu> //<ValLongit>-49.183008</ValLongit> //<IdeStatus>0</IdeStatus> //</NS2:TVeiculoLogadoVO> //</SOAP-ENV:Body> //</SOAP-ENV:Envelope> |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 09 décembre 2014 - 17:35 |
Xml_SEND is string = [ <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:act297_RtPlusSSDM-IRtPlusSSDM#ObterRelacaoDeVeiculosLogados"> <soapenv:Header/> <soapenv:Body> <urn:ObterRelacaoDeVeiculosLogados soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <cod_client_celula xsi:type="xsd:int">V001</cod_client_celula> <dat_hora_proces xsi:type="xsd:string">V002</dat_hora_proces> <num_proces xsi:type="xsd:int">V003</num_proces> </urn:ObterRelacaoDeVeiculosLogados> </soapenv:Body> </soapenv:Envelope> ]
Locate this #ObterRelacaoDeVeiculosLogados code in the text above, this piece of code uses the not SOAPUI but Windev Mobile needs to occur Envelope Shipping
Localize esse codigo #ObterRelacaoDeVeiculosLogados no texto acima, esse pedaço de código o SOAPUI nao Usa mas o Windev Mobile necessita para ocorrer o envio do envelope |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 09 décembre 2014 - 17:41 |
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:act297_RtPlusSSDM-IRtPlusSSDM#ObterRelacaoDeVeiculosLogados">
Veja que no final tem isso aqui:
#ObterRelacaoDeVeiculosLogados
Esse é o segredo, tem que estar tudo definido na string do envelope #metodo
Quando importa o WSDL com o SOAPUI, nao tem #metodo funciona o SOAPUI tendo ou não esse informação no inicio do envelope.
Isso deu trabalho achar o motivo que não enviava e nem recebia dados desse tipo de webservice |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 09 décembre 2014 - 17:42 |
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:act297_RtPlusSSDM-IRtPlusSSDM#ObterRelacaoDeVeiculosLogados">
See that in the end have it here:
#ObterRelacaoDeVeiculosLogados
That's the secret, have to be all set in the envelope string #metodo
When you import the WSDL with SOAPUI, do not have #metodo Works SOAPUI whether or not this information in the envelope the beginning.
It gave work to find the subject not sent nor received such data from webservice
At
Adriano Boller (41) 9949 1800
br.linkedin.com/in/adrianoboller |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 09 décembre 2014 - 17:45 |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 657 messages Popularité : +175 (223 votes) |
|
Posté le 09 décembre 2014 - 17:47 |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|