Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MsXML2.ServerXMLHTTP
Message
From
05/10/2022 05:23:11
 
 
To
05/10/2022 05:15:51
General information
Forum:
Visual FoxPro
Category:
Web Services
Miscellaneous
Thread ID:
01685028
Message ID:
01685039
Views:
35
Somehow :-) I solved a problem. Below is solution. I think that solution was to remove first blank line in xml. Antonio, thanks for helping me.
SET TEXTMERGE TO "SoapEnvelope.xml" NOSHOW
SET TEXTMERGE ON

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
SET TEXTMERGE TO

m.PrviRed = FILETOSTR("SoapEnvelope.xml")
m.PrviRed = STRTRAN(m.PrviRed, CHR(13)+CHR(10)+'<?xml version="1.0" encoding="utf-8"?>', '<?xml version="1.0" encoding="utf-8"?>')
Vrati = STRTOFILE(m.PrviRed,"SoapEnvelope.xml")
SoapEnvelope = FILETOSTR("SoapEnvelope.xml")

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.setrequestheader('Content-Type','text/xml;charset=UTF-8')
loXMLHTTP.send(soapenvelope)

m.Response1 = loXMLHTTP.ResponseText
A = STRTOFILE(M.RESPONSE1,"Odgovor.TXT")
Previous
Reply
Map
View

Click here to load this message in the networking platform