Greetings,
I have a simple POST to a webservice to make through PS.
I've done many in my life, however I just cant figure out what is the problem with this one. (I've also tried in VBs - getting same result)
I have an XML with content which I should POST to the webservice, using SOAPUI everything works perfectly, however when I use POSTMAN I can server internal error (there are no special headers nor authentication)
I tried the following when parsing the XML:
$Parameters = @'
<XML Stuff>
'@
and then I tried the following:
Option 1:
$Url = <http://My URL>?wsdl
also tried without ?wsdl
$Url = <http://My URL>
and then:
Invoke-webrequest -Uri $Url -Method POST -Body $Parameters -ContentType "text/xml" (also tried "application/xml")
or:
$http_request = new-object -comobject Msxml2.XMLHTTP
$http_request.open('POST', $Url, $false)
$http_request.SetRequestHeader("Content-type", "text/xml")
$http_request.SetRequestHeader("Content-Length", $Parameters.Length)
$http_request.SetRequestHeader("Connection", "close") #Also Tried without
$http_request.send($Parameters)
$http_request.statusText
$http_request.ResponseText
ending up getting same result which is server internal error... why?
I've also tried to take $Parameters and export it and paste it into SOAPUI and see if something happened to the XML but everything seems to be working just fine.
any clue?
Thanks in advance.