by ramirezosvaldo2 » Thu Jan 27, 2022 8:58 pm
Hello Byron
I use SoapUI, Please download it, create a SOAP project, then hit the WSDL URL that you client/provider give to you,
Then you can see all transaction, after that, you can mimic you templates ...
Let me show How I did:
LOCAL cUrl := "https://orbisws01.orbisfarma.com.mx/transaccion.asmx?WSDL"
LOCAL cAction := "https://orbisws01.orbisfarma.com.mx/setTransactionInit"
First, create a XML var ..
cXML := '<?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope '+;
'xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:s="http://www.w3.org/2001/XMLSchema" '+;
'xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" '+;
'xmlns:tns="https://orbisws01.orbisfarma.com.mx/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" '+;
'xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" '+;
'xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" '+;
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" >'+;
'<SOAP-ENV:Body><tns:setTransactionInit xmlns:tns="https://orbisws01.orbisfarma.com.mx/">'+;
'<tns:cardnumber>##CARDNUMBER##</tns:cardnumber><tns:storeid>##STOREID##</tns:storeid><tns:posid>##CAJAID##</tns:posid>'+;
'<tns:employeeid>##EMPLEADOID##</tns:employeeid><tns:key>##KEY##</tns:key></tns:setTransactionInit></SOAP-ENV:Body></SOAP-ENV:Envelope>'
Then replaces the template with their values ..
cXML := strtran( cXML , '##CARDNUMBER##',cTarjeta )
cXML := strtran( cXML , '##STOREID##',strzero(SucursalActual,3,0))
cXML := strtran( cXML , '##CAJAID##',strzero(CajaActual,1,0))
cXML := strtran( cXML , '##EMPLEADOID##','1OSVALDO')
cXML := strtran( cXML , '##KEY##',cKeyOrbisFarma)
// using Pablo Botella tools
oHttp := TServerXMLHTTPRequest():New()
oHttp:Open("POST",cURL,.F.)
oHttp:SetReQuestHeader( "SOAPAction" , cAction )
oHttp:SetReQuestHeader( "Content-Type" , "text/xml;charset=UTF-8" )
oHttp:SetReQuestHeader( "User-Agent" , ", power by Jobb-iSoft")
deletefile( "RequestActiva.xml" )
lMemowrite( "RequestActiva.xml",cXML)
oHttp:Send( cXml )
cResponse := oHttp:responseText
deletefile( "ResponseActiva.xml")
lMemowrite( "ResponseActiva.xml",cResponse)
IF oHttp:status = 200
oXml = CreateObject("Chilkat_9_5_0.Xml")
nSuccess = oXml:LoadXml(cResponse)
IF (nSuccess <> 1)
msgbox( oXml:LastErrorText )
ELSE
cId := oXml:ChilkatPath( "soap:Body|setTransactionInitResponse|setTransactionInitResult|diffgr:diffgram|NewDataSet|FirstTable|errorid|*")
cMsg:= oXml:ChilkatPath( "soap:Body|setTransactionInitResponse|setTransactionInitResult|diffgr:diffgram|NewDataSet|FirstTable|message|*")
IF val( cID ) = 0
csession := oXml:ChilkatPath( "soap:Body|setTransactionInitResponse|setTransactionInitResult|diffgr:diffgram|NewDataSet|FirstTable|transactionid|*")
cSession := cSession+"|"+oXml:ChilkatPath( "soap:Body|setTransactionInitResponse|setTransactionInitResult|diffgr:diffgram|NewDataSet|FirstTable|carditems|*")
ELSE
/// msgbox( cMsg ,"Mensaje de Orbisfarma" )
ENDIF
ENDIF
oXML:destroy()
oXML:= NIL
Let me know if you need to some help
Best Regards
Osvaldo Ramirez