Search code examples
xmlweb-servicespowershellwsdl

webservice (checkVatService) powershell


i want to use this webservice:

http://ec.europa.eu/taxation_customs/vies/services/checkVatService Method: POST Content-Type application/xml

this is my request:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ec.europa.eu:taxud:vies:services:checkVat:types">
<soapenv:Header/>
<soapenv:Body>
    <urn:checkVat>
        <urn:countryCode>ES</urn:countryCode>
        <urn:vatNumber>A28017895</urn:vatNumber>
    </urn:checkVat>
</soapenv:Body>

The wsdl is here: http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl

How can i send the xml request with powershell and get the response there?

Thank you in advance.


Solution

  • You should be able to use Invoke-Webrequest to handle that. Just set the -Method switch to POST and provide your xml as the body