Hi,

I'm new to CXF and I'm having a lot of problems trying to consume the checkVat webservice from the EU
(http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl)

After much experimentation I finally got past the can't find exception by specifying the xmlns on jaxws bean.

Generated base code with wsdl2java.

This is my code now
package nl.mysite.service;

import eu.europa.ec.taxud.vies.services.checkvat.types.CheckVat;
import eu.europa.ec.taxud.vies.services.checkvat.types.CheckVatResponse;

@WebService(
targetNamespace="http://ec.europa.eu/taxation_customs/vies/services/checkVatService";,
        name="urn:ec.europa.eu:taxud:vies:services:checkVat")
public interface CheckVatService {

    @WebMethod
    public CheckVatResponse checkVat(@WebParam CheckVat params);
}

ApplicationContext.xml
<jaxws:client id="vatClient"
        serviceClass="nl.msw.compraventa.service.CheckVatService"
address="http://ec.europa.eu/taxation_customs/vies/services/checkVatService"; wsdlLocation="http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl";
        xmlns:ns="urn:ec.europa.eu:taxud:vies:services:checkVat"
        name="ns:checkVatService"
        endpointName="ns:checkVatPort"
        serviceName="ns:checkVatService"
        />

I'm getting this error on the vatNumber field when Spring tries to set the CheckVatService as a dependency on another bean. No clue why. The error message is not particularly helpful either. Don't see any difference between the countryCode field that passes correctly and the vatNumber field that fails. But then, I'm a newbie at this. A frustrated one.

java.lang.NullPointerException
    at org.apache.cxf.common.util.ASMHelper.getClassCode(ASMHelper.java:91)
at org.apache.cxf.jaxws.WrapperClassGenerator.generateMessagePart(WrapperClassGenerator.java:286) at org.apache.cxf.jaxws.WrapperClassGenerator.createWrapperClass(WrapperClassGenerator.java:235) at org.apache.cxf.jaxws.WrapperClassGenerator.generate(WrapperClassGenerator.java:138) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.generatedWrapperBeanClass(JaxWsServiceFactoryBean.java:608) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.getExtraClass(JaxWsServiceFactoryBean.java:579) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:426)

Any ideas?

Kind regards,

Marc

Reply via email to