spring+springxfire_client.xml
  
 <bean  id ="testWebService"  class ="org.codehaus.xfire.spring.remoting.XFireClientFactoryBean"> 
         <property  name ="serviceClass">           
                    <value>com.xx.fw.webservice.service.HelloWS</value>        
         </property>       
          <property  name ="wsdlDocumentUrl" >          
                      <value>http://localhost:8080/mywebservice/services/HelloService?wsdl</value>        
          </property >   
          
           <property name="lookupServiceOnStartup">  
                       <value>false</value>  
            </property>      
 </bean >       public void testClient()   {
       ApplicationContext ctx  =   new  ClassPathXmlApplicationContext("xfire_client.xml");
       service  =  (HelloWS) ctx.getBean( "testWebService");
       System.out.println(service.sayHello("xxx"));
    } Exception in thread "main" java.lang.IllegalStateException: A WSDL URL or service URL must be supplied.
at org.codehaus.xfire.spring.remoting.XFireClientFactoryBean.makeClient(XFireClientFactoryBean.java:530)
at org.codehaus.xfire.spring.remoting.XFireClientFactoryBean.createClient(XFireClientFactoryBean.java:412)
at org.codehaus.xfire.spring.remoting.XFireClientFactoryBean.access$100(XFireClientFactoryBean.java:54)
at org.codehaus.xfire.spring.remoting.XFireClientFactoryBean$ProxyInterceptor.getClient(XFireClientFactoryBean.java:640)
at org.codehaus.xfire.spring.remoting.XFireClientFactoryBean$ProxyInterceptor.invoke(XFireClientFactoryBean.java:601)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:209)
http://localhost:8080/mywebservice/services/HelloService?wsdl 是可以访问的,为什么会包找不到的异常呢?

解决方案 »

  1.   


     <property  name ="wsdlDocumentUrl" >          
                          <value>http://localhost:8080/mywebservice/services/HelloService?wsdl</value>        
              </property >     
    改成
     <property  name ="url" >          
                          <value>http://localhost:8080/mywebservice/services/HelloService?wsdl</value>        
              </property >     就可以了,这是咋回事啊