I’m trying to create SOAP request with AS:HttpRequest (string HttpRequest(string url, string method, string content, string contentType, XPathNavigator headers)
. I can simulate it with SoapUI without any problem. I’ve test transformation like this:
<xsl:template match="ROOT">
<ROOT>
<xsl:variable name="lpisContent">
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v02="http://www.pds.eu/vOKO/v0200" xmlns:lpi="http://sitewell.cz/lpis/schemas/LPI_GDP01A">
<soapenv:Header/>
<soapenv:Body>
<v02:Request vOKOid="LPI_GDP01A">
<v02:RequestContent>
<lpi:Request>
<lpi:GETDATA>1</lpi:GETDATA>
<lpi:CTVEREC>740-1030</lpi:CTVEREC>
<lpi:ZKOD>1004/10</lpi:ZKOD>
<lpi:DATOD>2024-02-01</lpi:DATOD>
<lpi:DATDO>2024-02-01</lpi:DATDO>
<lpi:STAVID>4</lpi:STAVID>
</lpi:Request>
</v02:RequestContent>
</v02:Request>
</soapenv:Body>
</soapenv:Envelope>
</xsl:variable>
<xsl:variable name="lpisHeader">
<header name="Cache-Control" value="no-cache" />
</xsl:variable>
<xsl:variable name="lpisContentType" select="'text/xml; charset=utf-8'" />
<xsl:variable name="lpisMethod" select="'POST'" />
<xsl:variable name="lpisUrl" select="'https://eagritest.cz/ssl/nosso-app/EPO/WS/Online/vOKOsrv.ashx'"/>
<xsl:variable name="lpisData" select="AS:HttpRequest($lpisUrl, $lpisMethod, $lpisContent, $lpisContentType, $lpisHeader)"/>
<LPISDATA>
<xsl:value-of select="AS:ToXML($lpisData)" />
</LPISDATA>
</ROOT>
</xsl:template>
When I transform it I got error from Architect:
An error occurred during a call to extension function 'HttpRequest'. See InnerException for a complete description of the error.
and the remote server returns:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><SOAP:Body><SOAP:Fault><faultcode>SOAP:Client</faultcode><faultstring>Nepodařilo se načíst xml. Data at the root level is invalid. Line 1, position 1.</faultstring></SOAP:Fault></SOAP:Body></SOAP:Envelope>
I tried to capture the http request via Wireshark an it looks there is no content inside the request.
Any help is welcome
Thank you.