Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VAT Webservice

Posted on 2006-07-20
12
Medium Priority
?
2,897 Views
Last Modified: 2013-12-24
Hi,

I am trying to use this webservice:

http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl

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

<cfinvoke webservice="http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl"
             method="checkVat"
             returnvariable="wsresult"
             timeout="20">
<cfinvokeargument name="countryCode" value="GB">
<cfinvokeargument name="vatNumber" value="12345">
</cfinvoke>

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.

Thanks,
H
0
Comment
Question by:hanneman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
12 Comments
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17145885
<cfinvoke webservice="http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl" 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"/>
</cfinvoke>
0
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17145894
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.
0
 
LVL 4

Author Comment

by:hanneman
ID: 17145927
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:

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.NullPointerException
 faultActor:
 faultNode:
 faultDetail:
      {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
      at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
      at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
      at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
      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...

0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17145993
Can you show me the code with the values so I can test?
0
 
LVL 4

Author Comment

by:hanneman
ID: 17146124
The actual values dont matter, the web service should simply return an error message if incorrect values are given.
0
 
LVL 4

Author Comment

by:hanneman
ID: 17146594
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", "http://www.w3.org/2001/XMLSchema-instance");        
   
        bodyName = se.createName("checkVat", "nsg", "http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl");
        bodyElement = body.addBodyElement(bodyName);
   
        childName = se.createName("vatNumber");
        stateNm = bodyElement.addChildElement(childName);
        stateNm.addTextNode("1234");
            
            childName = se.createName("countryCode");
        stateNm = bodyElement.addChildElement(childName);
        stateNm.addTextNode("GB");
            
        //Save the message
        smsg.saveChanges();
             
        conn = new("javax.xml.soap.SOAPConnectionFactory").newInstance().createConnection();
     
        response = conn.call(smsg, "http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl");
            
            responseXML = xmlparse(response.getSOAPPart().getAsString());
0
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17146622
I was wrong about the arguments, the country code and VAT should be sufficient, but I can't get it to work yet either . . .
0
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17147941
Sorry posted before reading your post.  Did you get it working via JAVA?
0
 
LVL 4

Author Comment

by:hanneman
ID: 17152546
Yep the java ported to cfscript works great, thanks anyway usachrisk1983!
0
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17153459
Sorry I couldn't help, but glad you got it working :)
0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 17185213
Closed, 500 points refunded.

GhostMod
Community Support Moderator
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question