lPIB = some tin STORE "" TO lMatBr, lNaziv, lNazivKratki, lAdresa, lMesto, lRegion, lPtt, lDelatnost STORE CTOD("..") TO lDatReg, lDatOsniv m.UNBSUser = some username m.UNBSLoz = some password m.UNBSLic = some licence dtwwwGetCompany(lPIB, .F., @lMatBr, @lNaziv, @lNazivKratki, @lAdresa, @lMesto, @lRegion, @lPtt, @lDelatnost, @lDatReg, @lDatOsniv) **************************************** FUNCTION dtwwwGetCompany( lPIB, lDeoNaziva, lMatBr, lNaziv, lNazivKratki, lAdresa, lMesto, lRegion, lPtt, lDelatnost, lDatReg, lDatOsniv ) **************************************** LOCAL loXMLHTTP LOCAL soapEnvelope SET SAFE OFF SET TALK OFF TEXT TO soapEnvelope TEXTMERGE NOSHOW TEXT <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Header> <AuthenticationHeader xmlns="http://communicationoffice.nbs.rs"> <UserName><<m.UNBSUser>></UserName> <Password><<m.UNBSLoz>></Password> <LicenceID><<m.UNBSLic>></LicenceID> </AuthenticationHeader> </soap12:Header> <soap12:Body> <GetCompany xmlns="http://communicationoffice.nbs.rs"> <companyID>00000000-0000-0000-0000-000000000000</companyID> <companyCode>0</companyCode> <name></name> <city></city> <nationalIdentificationNumber>0</nationalIdentificationNumber> <taxIdentificationNumber><<lPIB>></taxIdentificationNumber> <startItemNumber>0</startItemNumber> <endItemNumber>0</endItemNumber> </GetCompany> </soap12:Body> </soap12:Envelope> ENDTEXT loXMLHTTP = CREATEOBJECT("MsXML2.ServerXMLHTTP") cUrl = "https://webservices.nbs.rs/CommunicationOfficeService1_0/CoreXmlService.asmx" loXMLHTTP.open("POST", cUrl, .F.) loXMLHTTP.setrequestheader('SOAPAction','http://communicationoffice.nbs.rs/GetCompany') loXMLHTTP.setrequestheader('Content-Type','application/soap+xml;charset=UTF-8') loXMLHTTP.send(soapenvelope) WAIT WIND STR(loXMLHTTP.status)Response (loXMLHTTP.ResponseTEXT) is
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Server was unable to process request. ---> Data at the root level is invalid. Line 1, position 1.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>Thanks in advance.