This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

TESA Assa Abloy SOAP API
#3
Hi!

I've begun to use the same SMARTAIR SOAP API with PowerShell but always receiving the error: "Invoke-WebRequest : The remote server returned an error: (415) Unsupported Media Type.". For example with the following code:

Code:
$Body = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.ws.ts1000.tesa.es/">
<soapenv:Header/>
<soapenv:Body>
<soap:lockingPlanModify>
<operatorName>user</operatorName>
<operatorPassword>XXXXXX</operatorPassword>
<userId>274</userId>
<doorId>118</doorId>
<canOpen>true</canOpen>
<codTimetable>15</codTimetable>
<privacyOverride>true</privacyOverride>
</soap:lockingPlanModify>
</soapenv:Body>
</soapenv:Envelope>'
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
$Response = Invoke-WebRequest -Uri 'https://localhost:8181/TesaSmartairPlatform/LockingPlanWebService' -Method Post -Body $Body

Any help will be appreciated.

Regards, Fernando.

Solved!!  :D

I had got to add -ContentType 'text/xml' in Invoke-WebRequest

Code:
Invoke-WebRequest -Uri 'https://localhost:8181/TesaSmartairPlatform/LockingPlanWebService' -Method 'Post' -Body $Body -ContentType 'text/xml'
Reply


Messages In This Thread
TESA Assa Abloy SOAP API - by pentadom - 21.04.2020, 10:41
RE: TESA Assa Abloy SOAP API - by admin - 21.04.2020, 10:56
RE: TESA Assa Abloy SOAP API - by ffrr12 - 07.07.2023, 08:10

Forum Jump: