Results 1 to 3 of 3

Thread: Basic web service consumption not working: CXF

  1. #1
    Join Date
    Jan 2008
    Posts
    248

    Default Basic web service consumption not working: CXF

    Hi,

    Having followed the cxf documentation on consuming a webservice, I can't get it to work with a : "org.apache.cxf.service.factory.ServiceConstructio nException: Could not find definition for service {http://service.mysite.msw.nl/}VatValidatorServiceService."

    PHP Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
        
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        
    xmlns:jaxws="http://cxf.apache.org/jaxws"
        
    xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"
    >

        <
    jaxws:client id="vatClient"
            
    serviceClass="nl.msw.mysite.service.VatValidatorService"
            
    address="http://ec.europa.eu/taxation_customs/vies/services/checkVatService"
            
    wsdlLocation="http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"/>
    </
    beans>

    @
    WebService
    public interface VatValidatorService {
        
        public 
    HashMap<String,ObjectcheckVat(String[] params);
    }

    public class 
    TestClient{

        private 
    VatValidatorService;
        
        @
    Autowired
        
    public void setVatClient(VatValidatorService vatValidator) {
            
    this.vatValidator vatValidator;
        }
        [...]

    Any ideas on this supposed piece of cake?

    Kind regards,

    Marc
    Last edited by mschipperheyn; Jul 26th, 2010 at 12:33 PM.

  2. #2
    Join Date
    Dec 2007
    Location
    Framingham, MA
    Posts
    5

    Default

    My suggestion would be to take the wsdl and run the CXF wsdl2java tool on it to generate the proper interface for it. In you sample, the @WebService annotation (or the jaxws:client element) would require more parameters (such as service name and endpoint name) to match the wsdl, but even then, it still wouldn't work as HashMap isn't a valid return for that method.

    Again, run the wsdl2java on the wsdl to get the proper interface and start from there.

    Dan

  3. #3
    Join Date
    Jan 2008
    Posts
    248

    Default

    Thanks for that suggestion. It generates quite a few files. It just seems such a far cry from the simple
    <jaxws:client id="vatClient"
    serviceClass="nl.msw.mysite.service.VatValidatorSe rvice"
    address="http://ec.europa.eu/taxation_customs/vies/services/checkVatService"
    wsdlLocation="http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl"/>

    from the documentation which suggests that all these files are proxied by the framework. Which it what you would expect and want. In my mind, it just can't be that complicated to consume a basic webservice! Just FUBAR. But wsdl2java will prob work.

    Again thanks for the suggestion.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •