3 Replies Latest reply on Jun 14, 2011 9:21 PM by Willem Jiang

    Difference on webservice invocations

    Rogelio Sevilla Novice

      Good day

       

      Sorry if this is too basic, i'm still learning Fuse ESB and Osgi :-P

       

       

      I have a question that honestly i havent been able to answer.  I have a client app that invoques a webservice succesfully doing this

       

              SOAPService ss = new SOAPService();

              Greeter greeter = ss.getSoapPort();

              System.out.println(greeter.sayHi("Calling success!!"));

       

       

       

      *My client spring file has this code:*

       

       

       

       

       

       

       

       

      And my server spring file has this code

       

       

       

       

       

       

       

      Everything works great (thanks to mr. Freeman and Willem by the way ), but I would like to add a property on the client app side using spring, so I uncomment the next line from the spring file on the client :

       

       

       

      And I add this property on my client POJO  (I don't even use it, I just declare it)

       

      private Greeter servidorWsdl;

       

          public Greeter getServidorWsdl() {

              return servidorWsdl;

          }

       

          public void setServidorWsdl(Greeter servidorWsdl) {

              this.servidorWsdl = servidorWsdl;

          }

       

       

       

      The moment I update my client bundle with the spring line uncommented on the fuse esb, the fuse esb throws this exception

       

       

      Exception in thread "SpringOsgiExtenderThread-20" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clienteWsdl' defined in URL bundleentry://222.fwk7318012/META-INF/spring/beans.xml: Cannot resolve reference to bean 'servidorProxy' while setting bean property 'servidorWsdl'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servidorProxy': FactoryBean threw exception on object creation; nested exception is org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for service {mycompany.osgi_wsdl_first}GreeterService

       

       

      Am I missing something else???

        • 1. Re: Difference on webservice invocations
          Willem Jiang Master

          Hi,

           

          Your jaxws client's address is wrong. please change the address attribute to a real one which start with "http://".

           

          <jaxws:client 
          id="servidorProxy"
          serviceClass="mycompany.osgi_wsdl_first.Greeter"
          wsdlLocation="wsdl/helloworld.wsdl"
          address="/GreeterService"
          />
          

           

          Willem

          • 2. Re: Difference on webservice invocations
            Rogelio Sevilla Novice

            Maaan,  I just had a "Duh" moment,  thanks a lot for pointing out my mistake mr. Willem, that was quite silly error on my part.

             

            Also I had another error, with the same level of silliness,  after changing what mr. Willem said, the error persisted because my client was trying to access

             

            {mycompany.osgi_wsdl_first}GreeterService

             

            And my service was registered as

             

            {mycompany.osgi_wsdl_first}SOAPService

             

            so I added on my client spring file, on the beans  tag, this line:

             

            xmlns:tns="mycompany.osgi_wsdl_first"

             

             

            And I added  this on my jaxws:client  tag

             

            serviceName="tns:SOAPService"

             

             

            That was it. Thanks a lot for your help mr. Willem  :-D

            • 3. Re: Difference on webservice invocations
              Willem Jiang Master

              It's good to see you finally find a way out. It's important to make sure the client and server share the same configuration information