You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by jayasreeb <ja...@infosys.com> on 2008/07/16 12:10:37 UTC

Urgent!!! No matching endpoint found

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 java.util.logging.Logger;


import javax.jbi.messaging.InOut;
import javax.xml.namespace.QName;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.servicemix.client.DefaultServiceMixClient;
import org.apache.servicemix.cxfse.CxfSeComponent;
import org.apache.servicemix.jbi.jaxp.SourceTransformer;
import org.apache.servicemix.jbi.jaxp.StringSource;
//import org.servicemix.jbi.container.JBIContainer;
import org.apache.servicemix.jbi.container.SpringJBIContainer;







public class FibonacciClient {

private static final Logger LOG =
LogUtils.getL7dLogger(org.apache.servicemix.samples.webservice.FibonacciClient.class);
    
    private DefaultServiceMixClient client;
    private InOut io;
    private CxfSeComponent component;
    private SpringJBIContainer jbi;


    public void testProvider() throws Exception{

	//start external service
	LOG.info("inside test provider---");
	
	jbi = new SpringJBIContainer();
	jbi.init();
        jbi.start();


        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        factory.setServiceClass(FibonacciServiceService.class);
        factory.setServiceBean(new FibonacciServiceImpl());
        String address = "http://localhost:8080/axis/services/fibonacci";
        factory.setAddress(address);
        factory.setBindingId("http://schemas.xmlsoap.org/wsdl/soap12/");
        Server server = factory.create();
        Endpoint endpoint = server.getEndpoint();
        endpoint.getInInterceptors().add(new LoggingInInterceptor());
        endpoint.getOutInterceptors().add(new LoggingOutInterceptor());
        ServiceInfo service = endpoint.getEndpointInfo().getService();
	
        client = new DefaultServiceMixClient(jbi);
        io = client.createInOutExchange();

        io.setService(new QName("http://schemas.xmlsoap.org/soap/",
"fibonacci"));
        io.setInterfaceName(new QName("http://schemas.xmlsoap.org/soap/",
"urn:fibonacci"));
        io.setOperation(new QName("http://schemas.xmlsoap.org/soap/",
"calculateFibonacci"));
        
	//send message to proxy

        io.getInMessage().setContent(new StringSource(
                "<message
xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
              + "<part> "
              + "<calculateFibonacci
xmlns='http://apache.org/hello_world_soap_http/types'><requestType>"
              + "3"
              + "</requestType></calculateFibonacci>"
              + "</part> "
              + "</message>"));

        client.sendSync(io);

	LOG.info("result---->"+new
SourceTransformer().contentToString(io.getOutMessage()));
}


public static void main(String args[])
  {

	System.out.println("Inside main--");
	try{
	 new FibonacciClient().testProvider();
	}catch(Exception e){
		LOG.info("inside exception--"+e);
	}


  }


}

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

<beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0">

<cxfse:endpoint> 
<cxfse:pojo> 
<bean class="org.apache.servicemix.samples.webservice.FibonacciClient"> 
</bean>

</beans>

4. I have created service unit binding component(cxf-bc) .I have placed
fib.wsdl(external web service wsdl) under (main\src\resource).

5.My xbean.xml entry in binding component sevice unit is :

<beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
<cxfbc:provider service="fib:FibonacciService"
locationURI="http://localhost:8080/axis/services/fibonacci"
wsdl="classpath:fib.wsdl" endpoint="FibonacciClient"
interfaceName="fib:Fibonacci">
</cxfbc:provider>
</beans>

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::

INFO - WSDL1Processor - Endpoint
ServiceEndpointservice={urn:fibonacci}FibonacciService,endpoint=FibonacciClient
has a service description, but no matching endpoint found in fibonacci

A) Can you provide me suggestion in resolving this?

B) Am I following right approach in calling external web service from
servicemix client? If so how to test the response? 

C)How to use log4j in service mix so that I can see the logs of my
FibonacciClient.java.

Its urgent..Pls help me..
Jayasree.B
-- 
View this message in context: http://www.nabble.com/Urgent%21%21%21-No-matching-endpoint-found-tp18484334p18484334.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.