You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Dhiego Abrantes de Oliveira Martins <dh...@dhiegoabrantes.com> on 2013/02/27 04:55:28 UTC

Question about accessing component dosgi

Hi,

I'm exporting a dosgi component as a webservice and I like do access him.
I'm using iPOJO.

*Interface:*
public interface AdderService{
          String add();
}

*Provider:*
public class AdderServiceImpl implements AdderService{
          public String add(){
                    return "dhiego";
          }
}

*Provider metadata.xml*
<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="org.apache.felix.ipojo
http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd"
xmlns="org.apache.felix.ipojo">
     <instance
component="org.apache.felix.ipojo.remote.adder.impl.AdderServiceImpl">
          <property name="service.exported.interfaces" value="*" />
          <property name="osgi.remote.configuration.type" value="pojo"/>
          <property name="service.exported.configs" value="org.apache.cxf.ws"
/>
          <property name="org.apache.cxf.ws.address" value="
http://localhost:9090/adder" />
     </instance>
</ipojo>

So, I dont want to use dependence injection. Given some architectural
restrictions, I have to call the services as follow:

    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.getInInterceptors().add(new LoggingInInterceptor());
    factory.getOutInterceptors().add(new LoggingOutInterceptor());
    factory.setServiceClass(AdderService.class);
    factory.setAddress("http://localhost:9090/adder");
    AdderService client = (AdderService) factory.create();
   * String a = client.add();*
    System.out.println(a);

When the *bold* line is executed, I get this error:

 Exception in thread "main" javax.xml.ws.WebServiceException: Could not
find wsdl:binding operation info for web method add.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:112)
at $Proxy30.add(Unknown Source)
at Main.main(Main.java:22)

The cause basically is the AdderService wasn't annotated with @WebService.
If we use the @WebService in interface AdderService, the problem will be
solved. However, the service won't be recongnized when we try to import it
in another container to use it as a distributed osgi component.

Anyone can help me?


Best regards!
__
*Dhiego** **Abrantes*

Re: Question about accessing component dosgi

Posted by Dhiego Abrantes de Oliveira Martins <dh...@dhiegoabrantes.com>.
The access to this service should occurs outside of framework (felix
container). This is one of reasons of because I mustn't use dependency
injection.

anyone can help me?

best regarsd!

__
*Dhiego** **Abrantes*


2013/2/27 Dhiego Abrantes de Oliveira Martins <dh...@dhiegoabrantes.com>

> Hi,
>
> I'm exporting a dosgi component as a webservice and I like do access him.
> I'm using iPOJO.
>
> *Interface:*
> public interface AdderService{
>           String add();
> }
>
> *Provider:*
> public class AdderServiceImpl implements AdderService{
>           public String add(){
>                     return "dhiego";
>           }
> }
>
> *Provider metadata.xml*
> <ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="org.apache.felix.ipojo
> http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd"
> xmlns="org.apache.felix.ipojo">
>      <instance
> component="org.apache.felix.ipojo.remote.adder.impl.AdderServiceImpl">
>           <property name="service.exported.interfaces" value="*" />
>           <property name="osgi.remote.configuration.type" value="pojo"/>
>           <property name="service.exported.configs" value="
> org.apache.cxf.ws" />
>           <property name="org.apache.cxf.ws.address" value="
> http://localhost:9090/adder" />
>      </instance>
> </ipojo>
>
> So, I dont want to use dependence injection. Given some architectural
> restrictions, I have to call the services as follow:
>
>     JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
>     factory.getInInterceptors().add(new LoggingInInterceptor());
>     factory.getOutInterceptors().add(new LoggingOutInterceptor());
>     factory.setServiceClass(AdderService.class);
>     factory.setAddress("http://localhost:9090/adder");
>     AdderService client = (AdderService) factory.create();
>    * String a = client.add();*
>     System.out.println(a);
>
> When the *bold* line is executed, I get this error:
>
>  Exception in thread "main" javax.xml.ws.WebServiceException: Could not
> find wsdl:binding operation info for web method add.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:112)
> at $Proxy30.add(Unknown Source)
> at Main.main(Main.java:22)
>
> The cause basically is the AdderService wasn't annotated with @WebService.
> If we use the @WebService in interface AdderService, the problem will be
> solved. However, the service won't be recongnized when we try to import it
> in another container to use it as a distributed osgi component.
>
> Anyone can help me?
>
>
> Best regards!
> __
> *Dhiego** **Abrantes*
>

Re: Question about accessing component dosgi

Posted by Dhiego Abrantes de Oliveira Martins <dh...@dhiegoabrantes.com>.
Great!

Thank you, Christian.

I setted up felix + zookeeper and I try to use ipojo example. I installed
interface + provider in a felix container "a". So, in a container "b" I
installed interface and, when I installed the consumer, I get this warning:

INFO: *** Filter: null
Mar 01, 2013 10:53:41 AM
org.apache.cxf.dosgi.topologymanager.ListenerHookImpl added
INFO: ListenerHookImpl: skipping empty filter
Mar 01, 2013 10:53:41 AM
org.apache.cxf.dosgi.topologymanager.ListenerHookImpl added
INFO: *** Filter:
(objectClass=org.apache.felix.ipojo.remote.adder.AdderService)
Mar 01, 2013 10:53:41 AM
org.apache.cxf.dosgi.topologymanager.ListenerHookImpl added
*INFO: ListenerHookImpl: skipping import request for excluded classs
[org.apache.felix.ipojo.remote.adder.AdderService]*

Do you have any idea?

I'll try to use karaf..





Abs,
__
*Dhiego** **Abrantes** de Oliveira Martins*
*Computer Science, M.Sc. Candidate at UFPE*
www.dhiegoabrantes.com
+55 83 9999.1081
***Any fool can write code that a computer can understand. Good programmers
write code that humans can understand*. (Martin Fowler)


2013/3/1 Christian Schneider <ch...@die-schneider.net>

> Hi Dhiego,
>
> the ipojo example does not use zookeeper based discovery. It uses a static
> remote_services.xml file.
> In case of zookeeper discovery this file would not be necessary.
>
> So what you could try is run the ipojo example on Karaf like in my
> tutorial http://liquid-reality.de/**display/liquid/2013/02/13/**
> Apache+Karaf+Tutorial+Part+8+-**+Distributed+OSGi<http://liquid-reality.de/display/liquid/2013/02/13/Apache+Karaf+Tutorial+Part+8+-+Distributed+OSGi>.
>
> On the server side you just install the example on the first container. On
> the client side you leave out the remote_services file. I wonder if that
> makes a difference.
>
> In any case I will also try to get the ipojo example working. I did not
> yet test it.
>
> About @WebService and OSGi service. DOSGi allows to export plain OSGi
> services as webservices in this case it uses the CXF Simple front end and
> the Aegis data binding. When you add the @WebService annotation to the
> interface then it uses the JAX-WS frontend and the JAXB databinding by
> default.
>
> So yes you can have one service impl act as an OSGi service and a web
> service. You only have to make sure your service design is suitable for
> remote communication. For example you can have very fine grained OSGi
> service calls as there is almost no additional overhead compared to a java
> method call.
> If your service is intended for remote use it should be more coarse
> grained.
>
> Christian
>
>
> On 01.03.2013 00:47, Dhiego Abrantes de Oliveira Martins wrote:
>
>> My code is equals to basic example in ipojo page:
>> http://felix.apache.org/site/**apache-felix-ipojo-dosgi.html<http://felix.apache.org/site/apache-felix-ipojo-dosgi.html>
>>   By default, ipojo dosgi is zookeeper based, right?
>>
>> The only change was @WebService annotation added in AdderService and
>> AdderServiceProvider.
>>
>> One more question: A simple bundle can be a Service and a WebService at
>> the
>> same time?
>> I mean: Does make sense implements a bundle that behaves as WebService to
>> export it to another container, but I can use it as a "local" service?
>>
>> Can you share with us your test example?
>>
>> I'm think I'm confused about WebService as a bundle and distributed
>> bundles.
>>
>> Best regards!
>> __
>> *Dhiego** **Abrantes*
>>
>>
>>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@felix.**apache.org<us...@felix.apache.org>
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Question about accessing component dosgi

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Dhiego,

the ipojo example does not use zookeeper based discovery. It uses a 
static remote_services.xml file.
In case of zookeeper discovery this file would not be necessary.

So what you could try is run the ipojo example on Karaf like in my 
tutorial 
http://liquid-reality.de/display/liquid/2013/02/13/Apache+Karaf+Tutorial+Part+8+-+Distributed+OSGi 
.

On the server side you just install the example on the first container. 
On the client side you leave out the remote_services file. I wonder if 
that makes a difference.

In any case I will also try to get the ipojo example working. I did not 
yet test it.

About @WebService and OSGi service. DOSGi allows to export plain OSGi 
services as webservices in this case it uses the CXF Simple front end 
and the Aegis data binding. When you add the @WebService annotation to 
the interface then it uses the JAX-WS frontend and the JAXB databinding 
by default.

So yes you can have one service impl act as an OSGi service and a web 
service. You only have to make sure your service design is suitable for 
remote communication. For example you can have very fine grained OSGi 
service calls as there is almost no additional overhead compared to a 
java method call.
If your service is intended for remote use it should be more coarse 
grained.

Christian

On 01.03.2013 00:47, Dhiego Abrantes de Oliveira Martins wrote:
> My code is equals to basic example in ipojo page:
> http://felix.apache.org/site/apache-felix-ipojo-dosgi.html
>   By default, ipojo dosgi is zookeeper based, right?
>
> The only change was @WebService annotation added in AdderService and
> AdderServiceProvider.
>
> One more question: A simple bundle can be a Service and a WebService at the
> same time?
> I mean: Does make sense implements a bundle that behaves as WebService to
> export it to another container, but I can use it as a "local" service?
>
> Can you share with us your test example?
>
> I'm think I'm confused about WebService as a bundle and distributed bundles.
>
> Best regards!
> __
> *Dhiego** **Abrantes*
>
>

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Question about accessing component dosgi

Posted by Dhiego Abrantes de Oliveira Martins <dh...@dhiegoabrantes.com>.
My code is equals to basic example in ipojo page:
http://felix.apache.org/site/apache-felix-ipojo-dosgi.html
 By default, ipojo dosgi is zookeeper based, right?

The only change was @WebService annotation added in AdderService and
AdderServiceProvider.

One more question: A simple bundle can be a Service and a WebService at the
same time?
I mean: Does make sense implements a bundle that behaves as WebService to
export it to another container, but I can use it as a "local" service?

Can you share with us your test example?

I'm think I'm confused about WebService as a bundle and distributed bundles.

Best regards!
__
*Dhiego** **Abrantes*


2013/2/28 Christian Schneider <ch...@die-schneider.net>

> Am 27.02.2013 23:25, schrieb Dhiego Abrantes de Oliveira Martins:
>
>> Christian,
>>
>> I follow these steps:
>>
>> 1- Implements AdderService (using @WebService) (interface)
>> 2- Implements AdderServiceImpl (using @WebService)  (Provider)
>> 3- deploy item 1 and 2 in a container OSGi 1.
>>
>> 4- Create a *importer bundle* that contains a configuration file to show
>> to
>>
>> CXF-DOSGi where locale the AdderService using an endpoint.
>> 5- Deploy item 4 to use the WEBSERVICE exported by item3 as a "local"
>> bundle.
>>
>> So, when I try to deploy, I get this warning:
>>
>> Fev 27, 2013 1:09:58 AM
>> org.apache.cxf.dosgi.dsw.**hooks.AbstractClientHook$**DiscoveryCallback
>> serviceChanged
>> INFO: Notified - AVAILABLE:
>> [org.apache.felix.ipojo.**remote.adder.AdderService] endpoint id:
>> 5e8f5f57-03d6-44bd-bcaf-**f0eeadb5c433
>> Fev 27, 2013 1:09:58 AM org.apache.cxf.dosgi.dsw.**
>> hooks.AbstractClientHook
>> proxifyMatchingInterface
>> WARNING: No class can be found for
>> org.apache.felix.ipojo.remote.**adder.AdderService
>>
> Did you deploy the AdderService interface on the container where you want
> to import the service?
> Can you put your project on github or similar. Then I can take a look.
>
> Honestly I personally have not yet used importer bundles. Instead I use
> the zookeeper based discovery which is easier to use.
> There basically you only need to reference the service in blueprint on the
> client side and need no other config per service.
>
>
>> The question is: Its possible use DOSGi with WebServices (REST/SOAP)?
>> I mean: We can implement a bundle as a webservice and export it by dosgi ?
>>
> This is absolutely possible. I have an integration test in place that
> works this way.
>
> Christian
>
>
>> Abs,
>> __
>> *Dhiego** **Abrantes** de Oliveira Martins*
>> *Computer Science, M.Sc. Candidate at UFPE*
>> www.dhiegoabrantes.com
>> +55 83 9999.1081
>> ***Any fool can write code that a computer can understand. Good
>> programmers
>> write code that humans can understand*. (Martin Fowler)
>>
>>
>> 2013/2/27 Christian Schneider <ch...@die-schneider.net>
>>
>>  You have two options here:
>>>
>>> 1) Introduce the @Webservice annotation  on the interface. CXF-DOSGi will
>>> then automatically use JAXWS/JAXB to export the service. Importing the
>>> service using DOSGi should also work.
>>> If it does not work then this is a bug. Can you give more informations
>>> abbout the problem and eventually open an issue at the CXF-DOSGi jira?
>>> 2) Do not change the interface. In this case DOSGi will use the Simple
>>> frontend with the Aegis binding. So you have to change your CXF code to
>>> access the service outside of OSGi use the same frontend and databinding.
>>>
>>> Christian
>>>
>>> Am 27.02.2013 04:55, schrieb Dhiego Abrantes de Oliveira Martins:
>>>
>>>  Hi,
>>>>
>>>> I'm exporting a dosgi component as a webservice and I like do access
>>>> him.
>>>> I'm using iPOJO.
>>>>
>>>> *Interface:*
>>>>
>>>> public interface AdderService{
>>>>             String add();
>>>> }
>>>>
>>>> *Provider:*
>>>>
>>>> public class AdderServiceImpl implements AdderService{
>>>>             public String add(){
>>>>                       return "dhiego";
>>>>             }
>>>> }
>>>>
>>>> *Provider metadata.xml*
>>>>
>>>> <ipojo xmlns:xsi="http://www.w3.org/****2001/XMLSchema-instance<http://www.w3.org/**2001/XMLSchema-instance>
>>>> <http:**//www.w3.org/2001/XMLSchema-**instance<http://www.w3.org/2001/XMLSchema-instance>
>>>> >
>>>> "
>>>> xsi:schemaLocation="org.****apache.felix.ipojo
>>>> http://felix.apache.org/ipojo/****schemas/CURRENT/core.xsd<http://felix.apache.org/ipojo/**schemas/CURRENT/core.xsd>
>>>> <htt**p://felix.apache.org/ipojo/**schemas/CURRENT/core.xsd<http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd>
>>>> >
>>>> "
>>>> xmlns="org.apache.felix.ipojo"****>
>>>>        <instance
>>>> component="org.apache.felix.****ipojo.remote.adder.impl.**
>>>> AdderServiceImpl">
>>>>             <property name="service.exported.****interfaces" value="*"
>>>> />
>>>>             <property name="osgi.remote.****configuration.type"
>>>> value="pojo"/>
>>>>             <property name="service.exported.****configs" value="
>>>> org.apache.cxf.ws"
>>>> />
>>>>             <property name="org.apache.cxf.ws.****address" value="
>>>>
>>>> http://localhost:9090/adder" />
>>>>        </instance>
>>>> </ipojo>
>>>>
>>>> So, I dont want to use dependence injection. Given some architectural
>>>> restrictions, I have to call the services as follow:
>>>>
>>>>       JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
>>>>       factory.getInInterceptors().****add(new LoggingInInterceptor());
>>>>       factory.getOutInterceptors().****add(new
>>>> LoggingOutInterceptor());
>>>>       factory.setServiceClass(****AdderService.class);
>>>>       factory.setAddress("http://****localhost:9090/adder<http://**
>>>> localhost:9090/adder <http://localhost:9090/adder>>
>>>>
>>>> ");
>>>>       AdderService client = (AdderService) factory.create();
>>>>      * String a = client.add();*
>>>>       System.out.println(a);
>>>>
>>>> When the *bold* line is executed, I get this error:
>>>>
>>>>
>>>>    Exception in thread "main" javax.xml.ws.****WebServiceException:
>>>> Could
>>>>
>>>> not
>>>> find wsdl:binding operation info for web method add.
>>>> at org.apache.cxf.jaxws.****JaxWsClientProxy.invoke(**
>>>>
>>>> JaxWsClientProxy.java:112)
>>>> at $Proxy30.add(Unknown Source)
>>>> at Main.main(Main.java:22)
>>>>
>>>> The cause basically is the AdderService wasn't annotated with
>>>> @WebService.
>>>> If we use the @WebService in interface AdderService, the problem will be
>>>> solved. However, the service won't be recongnized when we try to import
>>>> it
>>>> in another container to use it as a distributed osgi component.
>>>>
>>>> Anyone can help me?
>>>>
>>>>
>>>> Best regards!
>>>> __
>>>> *Dhiego** **Abrantes*
>>>>
>>>>
>>>>  --
>>>   Christian Schneider
>>> http://www.liquid-reality.de
>>>
>>> Open Source Architect
>>> Talend Application Integration Division http://www.talend.com
>>>
>>>
>>> ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.**apac**he.org<http://apache.org>
>>> <us...@felix.apache.org>
>>> >
>>>
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>>
>
> --
>  Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> Talend Application Integration Division http://www.talend.com
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@felix.**apache.org<us...@felix.apache.org>
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Question about accessing component dosgi

Posted by Christian Schneider <ch...@die-schneider.net>.
Am 27.02.2013 23:25, schrieb Dhiego Abrantes de Oliveira Martins:
> Christian,
>
> I follow these steps:
>
> 1- Implements AdderService (using @WebService) (interface)
> 2- Implements AdderServiceImpl (using @WebService)  (Provider)
> 3- deploy item 1 and 2 in a container OSGi 1.
>
> 4- Create a *importer bundle* that contains a configuration file to show to
> CXF-DOSGi where locale the AdderService using an endpoint.
> 5- Deploy item 4 to use the WEBSERVICE exported by item3 as a "local"
> bundle.
>
> So, when I try to deploy, I get this warning:
>
> Fev 27, 2013 1:09:58 AM
> org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$DiscoveryCallback
> serviceChanged
> INFO: Notified - AVAILABLE:
> [org.apache.felix.ipojo.remote.adder.AdderService] endpoint id:
> 5e8f5f57-03d6-44bd-bcaf-f0eeadb5c433
> Fev 27, 2013 1:09:58 AM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook
> proxifyMatchingInterface
> WARNING: No class can be found for
> org.apache.felix.ipojo.remote.adder.AdderService
Did you deploy the AdderService interface on the container where you 
want to import the service?
Can you put your project on github or similar. Then I can take a look.

Honestly I personally have not yet used importer bundles. Instead I use 
the zookeeper based discovery which is easier to use.
There basically you only need to reference the service in blueprint on 
the client side and need no other config per service.
>
> The question is: Its possible use DOSGi with WebServices (REST/SOAP)?
> I mean: We can implement a bundle as a webservice and export it by dosgi ?
This is absolutely possible. I have an integration test in place that 
works this way.

Christian

>
> Abs,
> __
> *Dhiego** **Abrantes** de Oliveira Martins*
> *Computer Science, M.Sc. Candidate at UFPE*
> www.dhiegoabrantes.com
> +55 83 9999.1081
> ***Any fool can write code that a computer can understand. Good programmers
> write code that humans can understand*. (Martin Fowler)
>
>
> 2013/2/27 Christian Schneider <ch...@die-schneider.net>
>
>> You have two options here:
>>
>> 1) Introduce the @Webservice annotation  on the interface. CXF-DOSGi will
>> then automatically use JAXWS/JAXB to export the service. Importing the
>> service using DOSGi should also work.
>> If it does not work then this is a bug. Can you give more informations
>> abbout the problem and eventually open an issue at the CXF-DOSGi jira?
>> 2) Do not change the interface. In this case DOSGi will use the Simple
>> frontend with the Aegis binding. So you have to change your CXF code to
>> access the service outside of OSGi use the same frontend and databinding.
>>
>> Christian
>>
>> Am 27.02.2013 04:55, schrieb Dhiego Abrantes de Oliveira Martins:
>>
>>> Hi,
>>>
>>> I'm exporting a dosgi component as a webservice and I like do access him.
>>> I'm using iPOJO.
>>>
>>> *Interface:*
>>>
>>> public interface AdderService{
>>>             String add();
>>> }
>>>
>>> *Provider:*
>>>
>>> public class AdderServiceImpl implements AdderService{
>>>             public String add(){
>>>                       return "dhiego";
>>>             }
>>> }
>>>
>>> *Provider metadata.xml*
>>>
>>> <ipojo xmlns:xsi="http://www.w3.org/**2001/XMLSchema-instance<http://www.w3.org/2001/XMLSchema-instance>
>>> "
>>> xsi:schemaLocation="org.**apache.felix.ipojo
>>> http://felix.apache.org/ipojo/**schemas/CURRENT/core.xsd<http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd>
>>> "
>>> xmlns="org.apache.felix.ipojo"**>
>>>        <instance
>>> component="org.apache.felix.**ipojo.remote.adder.impl.**
>>> AdderServiceImpl">
>>>             <property name="service.exported.**interfaces" value="*" />
>>>             <property name="osgi.remote.**configuration.type"
>>> value="pojo"/>
>>>             <property name="service.exported.**configs" value="
>>> org.apache.cxf.ws"
>>> />
>>>             <property name="org.apache.cxf.ws.**address" value="
>>> http://localhost:9090/adder" />
>>>        </instance>
>>> </ipojo>
>>>
>>> So, I dont want to use dependence injection. Given some architectural
>>> restrictions, I have to call the services as follow:
>>>
>>>       JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
>>>       factory.getInInterceptors().**add(new LoggingInInterceptor());
>>>       factory.getOutInterceptors().**add(new LoggingOutInterceptor());
>>>       factory.setServiceClass(**AdderService.class);
>>>       factory.setAddress("http://**localhost:9090/adder<http://localhost:9090/adder>
>>> ");
>>>       AdderService client = (AdderService) factory.create();
>>>      * String a = client.add();*
>>>       System.out.println(a);
>>>
>>> When the *bold* line is executed, I get this error:
>>>
>>>
>>>    Exception in thread "main" javax.xml.ws.**WebServiceException: Could
>>> not
>>> find wsdl:binding operation info for web method add.
>>> at org.apache.cxf.jaxws.**JaxWsClientProxy.invoke(**
>>> JaxWsClientProxy.java:112)
>>> at $Proxy30.add(Unknown Source)
>>> at Main.main(Main.java:22)
>>>
>>> The cause basically is the AdderService wasn't annotated with @WebService.
>>> If we use the @WebService in interface AdderService, the problem will be
>>> solved. However, the service won't be recongnized when we try to import it
>>> in another container to use it as a distributed osgi component.
>>>
>>> Anyone can help me?
>>>
>>>
>>> Best regards!
>>> __
>>> *Dhiego** **Abrantes*
>>>
>>>
>> --
>>   Christian Schneider
>> http://www.liquid-reality.de
>>
>> Open Source Architect
>> Talend Application Integration Division http://www.talend.com
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@felix.**apache.org<us...@felix.apache.org>
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>


-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Question about accessing component dosgi

Posted by Dhiego Abrantes de Oliveira Martins <dh...@dhiegoabrantes.com>.
Christian,

I follow these steps:

1- Implements AdderService (using @WebService) (interface)
2- Implements AdderServiceImpl (using @WebService)  (Provider)
3- deploy item 1 and 2 in a container OSGi 1.

4- Create a *importer bundle* that contains a configuration file to show to
CXF-DOSGi where locale the AdderService using an endpoint.
5- Deploy item 4 to use the WEBSERVICE exported by item3 as a "local"
bundle.

So, when I try to deploy, I get this warning:

Fev 27, 2013 1:09:58 AM
org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$DiscoveryCallback
serviceChanged
INFO: Notified - AVAILABLE:
[org.apache.felix.ipojo.remote.adder.AdderService] endpoint id:
5e8f5f57-03d6-44bd-bcaf-f0eeadb5c433
Fev 27, 2013 1:09:58 AM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook
proxifyMatchingInterface
WARNING: No class can be found for
org.apache.felix.ipojo.remote.adder.AdderService

The question is: Its possible use DOSGi with WebServices (REST/SOAP)?
I mean: We can implement a bundle as a webservice and export it by dosgi ?


Abs,
__
*Dhiego** **Abrantes** de Oliveira Martins*
*Computer Science, M.Sc. Candidate at UFPE*
www.dhiegoabrantes.com
+55 83 9999.1081
***Any fool can write code that a computer can understand. Good programmers
write code that humans can understand*. (Martin Fowler)


2013/2/27 Christian Schneider <ch...@die-schneider.net>

> You have two options here:
>
> 1) Introduce the @Webservice annotation  on the interface. CXF-DOSGi will
> then automatically use JAXWS/JAXB to export the service. Importing the
> service using DOSGi should also work.
> If it does not work then this is a bug. Can you give more informations
> abbout the problem and eventually open an issue at the CXF-DOSGi jira?
> 2) Do not change the interface. In this case DOSGi will use the Simple
> frontend with the Aegis binding. So you have to change your CXF code to
> access the service outside of OSGi use the same frontend and databinding.
>
> Christian
>
> Am 27.02.2013 04:55, schrieb Dhiego Abrantes de Oliveira Martins:
>
>> Hi,
>>
>> I'm exporting a dosgi component as a webservice and I like do access him.
>> I'm using iPOJO.
>>
>> *Interface:*
>>
>> public interface AdderService{
>>            String add();
>> }
>>
>> *Provider:*
>>
>> public class AdderServiceImpl implements AdderService{
>>            public String add(){
>>                      return "dhiego";
>>            }
>> }
>>
>> *Provider metadata.xml*
>>
>> <ipojo xmlns:xsi="http://www.w3.org/**2001/XMLSchema-instance<http://www.w3.org/2001/XMLSchema-instance>
>> "
>> xsi:schemaLocation="org.**apache.felix.ipojo
>> http://felix.apache.org/ipojo/**schemas/CURRENT/core.xsd<http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd>
>> "
>> xmlns="org.apache.felix.ipojo"**>
>>       <instance
>> component="org.apache.felix.**ipojo.remote.adder.impl.**
>> AdderServiceImpl">
>>            <property name="service.exported.**interfaces" value="*" />
>>            <property name="osgi.remote.**configuration.type"
>> value="pojo"/>
>>            <property name="service.exported.**configs" value="
>> org.apache.cxf.ws"
>> />
>>            <property name="org.apache.cxf.ws.**address" value="
>> http://localhost:9090/adder" />
>>       </instance>
>> </ipojo>
>>
>> So, I dont want to use dependence injection. Given some architectural
>> restrictions, I have to call the services as follow:
>>
>>      JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
>>      factory.getInInterceptors().**add(new LoggingInInterceptor());
>>      factory.getOutInterceptors().**add(new LoggingOutInterceptor());
>>      factory.setServiceClass(**AdderService.class);
>>      factory.setAddress("http://**localhost:9090/adder<http://localhost:9090/adder>
>> ");
>>      AdderService client = (AdderService) factory.create();
>>     * String a = client.add();*
>>      System.out.println(a);
>>
>> When the *bold* line is executed, I get this error:
>>
>>
>>   Exception in thread "main" javax.xml.ws.**WebServiceException: Could
>> not
>> find wsdl:binding operation info for web method add.
>> at org.apache.cxf.jaxws.**JaxWsClientProxy.invoke(**
>> JaxWsClientProxy.java:112)
>> at $Proxy30.add(Unknown Source)
>> at Main.main(Main.java:22)
>>
>> The cause basically is the AdderService wasn't annotated with @WebService.
>> If we use the @WebService in interface AdderService, the problem will be
>> solved. However, the service won't be recongnized when we try to import it
>> in another container to use it as a distributed osgi component.
>>
>> Anyone can help me?
>>
>>
>> Best regards!
>> __
>> *Dhiego** **Abrantes*
>>
>>
>
> --
>  Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> Talend Application Integration Division http://www.talend.com
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@felix.**apache.org<us...@felix.apache.org>
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Question about accessing component dosgi

Posted by Christian Schneider <ch...@die-schneider.net>.
You have two options here:

1) Introduce the @Webservice annotation  on the interface. CXF-DOSGi 
will then automatically use JAXWS/JAXB to export the service. Importing 
the service using DOSGi should also work.
If it does not work then this is a bug. Can you give more informations 
abbout the problem and eventually open an issue at the CXF-DOSGi jira?
2) Do not change the interface. In this case DOSGi will use the Simple 
frontend with the Aegis binding. So you have to change your CXF code to 
access the service outside of OSGi use the same frontend and databinding.

Christian

Am 27.02.2013 04:55, schrieb Dhiego Abrantes de Oliveira Martins:
> Hi,
>
> I'm exporting a dosgi component as a webservice and I like do access him.
> I'm using iPOJO.
>
> *Interface:*
> public interface AdderService{
>            String add();
> }
>
> *Provider:*
> public class AdderServiceImpl implements AdderService{
>            public String add(){
>                      return "dhiego";
>            }
> }
>
> *Provider metadata.xml*
> <ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="org.apache.felix.ipojo
> http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd"
> xmlns="org.apache.felix.ipojo">
>       <instance
> component="org.apache.felix.ipojo.remote.adder.impl.AdderServiceImpl">
>            <property name="service.exported.interfaces" value="*" />
>            <property name="osgi.remote.configuration.type" value="pojo"/>
>            <property name="service.exported.configs" value="org.apache.cxf.ws"
> />
>            <property name="org.apache.cxf.ws.address" value="
> http://localhost:9090/adder" />
>       </instance>
> </ipojo>
>
> So, I dont want to use dependence injection. Given some architectural
> restrictions, I have to call the services as follow:
>
>      JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
>      factory.getInInterceptors().add(new LoggingInInterceptor());
>      factory.getOutInterceptors().add(new LoggingOutInterceptor());
>      factory.setServiceClass(AdderService.class);
>      factory.setAddress("http://localhost:9090/adder");
>      AdderService client = (AdderService) factory.create();
>     * String a = client.add();*
>      System.out.println(a);
>
> When the *bold* line is executed, I get this error:
>
>   Exception in thread "main" javax.xml.ws.WebServiceException: Could not
> find wsdl:binding operation info for web method add.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:112)
> at $Proxy30.add(Unknown Source)
> at Main.main(Main.java:22)
>
> The cause basically is the AdderService wasn't annotated with @WebService.
> If we use the @WebService in interface AdderService, the problem will be
> solved. However, the service won't be recongnized when we try to import it
> in another container to use it as a distributed osgi component.
>
> Anyone can help me?
>
>
> Best regards!
> __
> *Dhiego** **Abrantes*
>


-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org