Web Connection
SOAP - Unexpected wrapper element error
Gravatar is a globally recognized avatar based on your email address. SOAP - Unexpected wrapper element error
  Marcel DESMET
  All
  Jan 15, 2020 @ 05:00am

Hello,

I am a newbie with soap and try to validate a european VAT number, here is my code

oSoap = CREATEOBJECT("wwSoap")

oSoap.nHttpConnectTimeout = 5
oSoap.lParseReturnedObjects = .T.

lcWSDL = "http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"

loSDL = oSoap.ParseServiceWSDL(lcWSDL, .T.)

oSoap.AddParameter("RESET")

oSoap.AddParameter("countryCode","BE")
oSoap.AddParameter("vatNumber","0425692814")

lvResult = oSoap.CallWSDLMethod("checkVat",loSDL) 

and the checkVat description in wsdl

<xsd:element name="checkVat">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="countryCode" type="xsd:string"/>
<xsd:element name="vatNumber" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

Tks in advance for your help The soap.cErrorMsg is

Unexpected wrapper element {urn:ec.europa.eu:taxud:vies:services:checkVat}checkVat found.

Expected {urn:ec.europa.eu:taxud:vies:services:checkVat:types}checkVat.

Gravatar is a globally recognized avatar based on your email address. re: SOAP - Unexpected wrapper element error
  Rick Strahl
  Marcel DESMET
  Jan 15, 2020 @ 12:59pm

wwSoap is no longer supported and hasn't been for some time. So you're pretty much on your own with this unfortunately beyond what's in the docs.

It's been too long since I've worked with this to even remember all the crazy details to tweak SOAP requests that don't just work right out of the gate...

+++ Rick ---

© 1996-2020