VAT Webservice


I am trying to use this webservice:

After a quick glance at the wsdl, I thought this would do it:

<cfinvoke webservice=""
<cfinvokeargument name="countryCode" value="GB">
<cfinvokeargument name="vatNumber" value="12345">

No joy, the parameters arent right, so I tried passing a struct of the values, still no joy.

Can anyone help with reading the webservice and determining what parameters it wants?

BTW, I can only get this far using my CF 7 install, my CF 6.1 install doesnt even want to generate a stub object for the wsdl.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

<cfinvoke webservice="" method="checkVat" returnvariable="myReturn">
 <cfinvokeargument name="countryCode" value="001"/>
 <cfinvokeargument name="vatNumber" value="enter_value_here"/>
 <cfinvokeargument name="requestDate" value="enter_value_here"/>
 <cfinvokeargument name="valid" value="enter_value_here"/>
 <cfinvokeargument name="name" value="enter_value_here"/>
 <cfinvokeargument name="address" value="enter_value_here"/>
Sorry to post and run, I didn't mean to submit.  After running that with valid values, try <cfdump var="#myReturn#"> to see what type of return you get, and voila.
hannemanAuthor Commented:
hehe, dreamweaver wrote that for you right? ;)

Heres the result:

 Could not perform web service invocation "checkVat".
Here is the fault returned when invoking the web service operation:

 faultCode: {}Server.userException
 faultString: java.lang.NullPointerException
      at org.apache.axis.message.SOAPFaultBuilder.createFault(
      at org.apache.axis.message.SOAPFaultBuilder.endElement(
      at org.apache.axis.encoding.DeserializationContext.endElement(
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unk...

10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Can you show me the code with the values so I can test?
hannemanAuthor Commented:
The actual values dont matter, the web service should simply return an error message if incorrect values are given.
hannemanAuthor Commented:
I ended up going for a java port to cfscript solution:

function new(classname){
                  return createobject("java",arguments.classname);
            mf = new("javax.xml.soap.MessageFactory").newInstance();      
        smsg = mf.createMessage();
        sp = smsg.getSOAPPart();
        se = sp.getEnvelope();
        body = se.getBody();
        //Add a namespace declaration to the envelope
        se.addNamespaceDeclaration("xsi", "");        
        bodyName = se.createName("checkVat", "nsg", "");
        bodyElement = body.addBodyElement(bodyName);
        childName = se.createName("vatNumber");
        stateNm = bodyElement.addChildElement(childName);
            childName = se.createName("countryCode");
        stateNm = bodyElement.addChildElement(childName);
        //Save the message
        conn = new("javax.xml.soap.SOAPConnectionFactory").newInstance().createConnection();
        response =, "");
            responseXML = xmlparse(response.getSOAPPart().getAsString());
I was wrong about the arguments, the country code and VAT should be sufficient, but I can't get it to work yet either . . .
Sorry posted before reading your post.  Did you get it working via JAVA?
hannemanAuthor Commented:
Yep the java ported to cfscript works great, thanks anyway usachrisk1983!
Sorry I couldn't help, but glad you got it working :)
Closed, 500 points refunded.

Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.