Well, i myself looked into some documents and try another way to make client
call by:

    URL wsdlURL = new
URL("http://localhost:8080/interface/webservice/HelloWorld?wsdl";);
    final QName SERVICE_NAME = new QName("http://webservice.net2com.com/";,
"HelloWorldImplService");
    Service service = Service.create(wsdlURL, SERVICE_NAME);
    HelloWorld client = service.getPort(HelloWorld.class);
    String result = client.sayHi("Diego");


and change the annotation of interface a little bit as:

@WebService
@SOAPBinding(style=Style.DOCUMENT, use=Use.LITERAL)
public interface HelloWorld {
    @WebMethod(action = "http://webservice.net2com.com/SayHi";, operationName
= "SayHi")
    @WebResult(name="msg", targetNamespace="http://webservice.net2com.com/";)
    String sayHi(
            @WebParam(targetNamespace="http://webservice.net2com.com/";,
partName = "text", name = "text")
            String text);
}


and it seems things work all perfect. Thank godness.

BTW, the document on CXF wiki still too simple to make newbees make through.

--------------------------------------------------------------------------------------------------



Diego Xu wrote:
> 
> Hi:
>   I'm using CXF2.0 release version for my first try of jax-ws, and now got
> blocked by an error throwed by server.
>   I'm using JDK5.0, Tomcat5.5, Spring2.0.6.
>   
>   here is my HellowWorld interface:
> ---------------------------------
> package com.net2com.webservice;
> 
> import javax.jws.WebService;
> 
> @WebService
> public interface HelloWorld {
>     String sayHi(String text);
> }
> 
>   and impl:
> ------------------------------------
> package com.net2com.webservice;
> 
> import javax.jws.WebService;
> 
> @WebService(endpointInterface = "com.net2com.webservice.HelloWorld")
> public class HelloWorldImpl implements HelloWorld {
> 
>     public String sayHi(String text) {
>         return "Hello " + text;
>     }
> }
> 
> 
> Spring config: (I put both server and client into one application)
> -------------------------------
> 
> <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-2.0.xsd
>       http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd";>
>        
>     <import resource="classpath:META-INF/cxf/cxf.xml" />
>       <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
>       <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>       .......
>       <jaxws:endpoint id="helloWorld" 
>               implementor="com.net2com.webservice.HelloWorldImpl" 
>               address="/HelloWorld" />
>  
>       <bean id="client" class="com.net2com.webservice.HelloWorld" 
>       factory-bean="clientFactory" factory-method="create"/>
>     
>       <bean id="clientFactory"
> class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
>         <property name="serviceClass"
> value="com.net2com.webservice.HelloWorld"/>
>         <property name="address"
> value="http://localhost:8080/interface/webservice/HelloWorld"/>
>       </bean>
> </beans>
> 
>  tomcat web.xml
> ------------------------------------
> <web-app>
>             .......
>       <servlet>
>               <servlet-name>CXFServlet</servlet-name>
>               <display-name>CXF Servlet</display-name>
>               <servlet-class>
>                       org.apache.cxf.transport.servlet.CXFServlet
>               </servlet-class>
>               <load-on-startup>1</load-on-startup>
>       </servlet>
> 
>       <servlet-mapping>
>               <servlet-name>CXFServlet</servlet-name>
>               <url-pattern>/webservice/*</url-pattern>
>       </servlet-mapping>
>            ..............
> </web-app>
> 
> and i already put following deps into WEB-INF/lib
> -----------------------------------
> commons-logging-1.1.jar
> geronimo-activation_1.1_spec-1.0-M1.jar 
> geronimo-annotation_1.0_spec-1.1.jar 
> geronimo-javamail_1.4_spec-1.0-M1.jar 
> geronimo-servlet_2.5_spec-1.1-M1.jar 
> geronimo-ws-metadata_2.0_spec-1.1.1.jar 
> jaxb-api-2.0.jar
> jaxb-impl-2.0.5.jar
> jaxws-api-2.0.jar
> saaj-api-1.3.jar
> saaj-impl-1.3.jar
> stax-api-1.0.1.jar
> wsdl4j-1.6.1.jar
> wstx-asl-3.2.1.jar
> XmlSchema-1.2.jar
> 
> spring-2.0.6.jar
> 
> cxf-2.0-incubator.jar
> 
> -----------------------------#
> 
> that's all my did to run the first spring demo, but when i try to invoke
> server side impl through:
> 
> this.helloWorldService = (HelloWorld) wac.getBean("client");  // get ws
> client bean from spring context
> ...
> String greet = helloWorldService.sayHi("CXF");
> 
> i got following error:
> 
> javax.xml.ws.soap.SOAPFaultException: Could not find destination factory
> for transport http://schemas.xmlsoap.org/soap/http
>       at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:168)
>       at $Proxy15.sayHi(Unknown Source)
>       at
> com.net2com.face.action.thirdinterface.ThirdInterfaceQueryAction.queryOutBoundInterface(ThirdInterfaceQueryAction.java:75)
>    .......
> Caused by: java.lang.RuntimeException: Could not find destination factory
> for transport http://schemas.xmlsoap.org/soap/http
>       at
> org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:148)
>     .......
> 
> 
> I already checked out some threads, some say their is another dependency
> needed:
> cxf-rt-transports-http-2.0-incubator.jar
> but i wonder it's not what i want coz i have tried it out, while still
> doesn't work.
> 
> I got stuck for a whole day to work this out, could any body here give me
> a hand? 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Could-not-find-destination-factory-for-transport-tf4103147.html#a11703841
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to