2 Replies Latest reply on Jul 15, 2008 5:08 AM by edelln

    Endpoint ServiceEndpoint has a service description,but no matching endpoint

    jayasreeb

      Hi,

       

      I have developed and deployed external web service in Axis1.4 using Tomcat. By giving following external web service location (http://localhost:8080/axis/services/fibonacci?wsdl) in browser I am able to see the generated wsdl file.

       

      My requirement is to write a client in servicemix and call a method in external web service and get response from it.I have followed following steps..

       

       

      1.I have created service unit (cxf-se) and placed the fib.wsdl(external webservice wsdl) under (main\src\resource) and generated the client stubs required to call the external webservice from service mix.

       

      2. I have written following client program in cxf-se service unit to call this external web service.Its under (main\src\java)

       

      package org.apache.servicemix.samples.webservice;

      import org.apache.servicemix.samples.fibonacci.*;

       

      import java.io.File;

      import java.net.URL;

      import javax.xml.namespace.QName;

      import javax.xml.ws.Service;

      import org.apache.commons.logging.Log;

      import org.apache.commons.logging.LogFactory;

       

       

      public class FibonacciClient{

       

      private static final Log log = LogFactory.getLog(FibonacciClient.class);

       

      public static void main(String args[])

        {

          log.info("inside Fuse Fibonacci Client Program");

          QName serviceName = new QName("urn:fibonacci", "FibonacciService");

          Service s = Service.create(serviceName);   

       

          QName portName = new QName("urn:fibonacci", "fibonacci");

          s.addPort(portName, "http://schemas.xmlsoap.org/soap/", "http://localhost:8080/axis/services/fibonacci");

       

          Fibonacci proxy = s.getPort(portName, Fibonacci.class);

       

          //Quote quote = proxy.calculateFibonacci(3);

          log.debug("Calculated Fibonacci in Client--->"+proxy.calculateFibonacci(3));

        }

      }

       

       

      3. My xbean.xml of service unit(cxf-se) has following entries

       

       

       

      6. After this I created service assembly and successfully able to deploy it in service mix.

       

      7. In service mix i got the following trace::

       

      Jul 15, 2008 11:34:55 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass

      INFO: Creating Service FibonacciClientService from class org.ap

      ache.servicemix.samples.webservice.FibonacciClient

      Jul 15, 2008 11:34:56 AM org.apache.cxf.configuration.spring.ConfigurerImpl getBeanName

      INFO: Could not determine bean name for instance of class org.apache.cxf.transport.jbi.JBIDestination.

      Jul 15, 2008 11:34:56 AM org.apache.cxf.endpoint.ServerImpl initDestination

      INFO: Setting the server's publish address to be jbi://ID-10-66-177-114-11b2537ebfe-20-0

      INFO  - ServiceUnitLifeCycle           - Starting service unit: fuse-client-http-bc

      INFO  - WSDL1Processor                 - Endpoint ServiceEndpoint[service=FibonacciService,endpoin

      t=FibonacciClient] has a service description, but no matching endpoint found in

       

       

      *)Can you help me in resolving this?

       

      *)Whether the steps followed for calling external web service from service mix client is correct?

       

      *) How can I test in service mix whether the method of external web service is returning proper value? I mean how to perform the test?

       

      Its urgent please help me in resolving this..

       

      Jayasree.B

        • 1. Re: Endpoint ServiceEndpoint has a service description,but no matching endpoint
          edelln

          I will take a look at get back to you.

          • 2. Re: Endpoint ServiceEndpoint has a service description,but no matching endpoint
            edelln

            Hi,

             

            I think you are missing the point here.

             

            You will need something to invoke on your method in your cxf-se.

             

            So effectively you need to set up this client external to servicemix.

             

            Create a cxf-bc consumer that will consume this message and forward it to the cxf-se

             

            Then in the cxf-se invoke the external web service call to the external web service.

            for this you will also need to setup a cxf-bc provider as you have done.

             

            But if you just want to test this call from the cxf-se

             

            you will need to set up something similar to what is in the cxfbcSystemProviderSystemTest in your cxf-se class

             

            e.g.

             

            client = new DefaultServiceMixClient(jbi);
                    io = client.createInOutExchange();
                    io.setService(new QName("http://apache.org/hello_world_soap_http_provider", "SOAPService"));
                    io.setInterfaceName(new QName("http://apache.org/hello_world_soap_http_provider", "Greeter"));
                    io.setOperation(new QName("http://apache.org/hello_world_soap_http_provider", "greetMe"));
                    //send message to proxy
                    io.getInMessage().setContent(new StringSource(
                          "<greetMe xmlns='http://apache.org/hello_world_soap_http_provider/types'><requestType>"
                          + "Edell"
                          + "</requestType></greetMe>"));
            
                    client.sendSync(io);
                    
                    assertTrue(new SourceTransformer().contentToString(
                            io.getOutMessage()).indexOf("Hello Edell") >= 0); 
            
            

            Here you will see it sets the servicename, operation name etc , sets up the content of the message and at the end will check the return value.

             

            In the cxf-bc provider - try set the locationURI as well.

             

            Also the error you get suggests that the endpoint name is different.

             

            What is the Port name of your wsdl  ?

             

            Hope this helps, Edell.

             

            Edited by: edelln on Jul 15, 2008 5:04 AM