Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Remote Service and Web Service - suggested tools?(What kind of tools/frameworks are recommended to be used together with Virgo for deploying web services)
Remote Service and Web Service - suggested tools? [message #634559] Fri, 22 October 2010 08:47 Go to next message
Peter Lauri is currently offline Peter LauriFriend
Messages: 3
Registered: October 2010
Junior Member
We are in the process of having two different Virgos on different machines (separated over network by a SOCKS5 proxy). We are only allowed to have one port open between the two servers.

We are having two possible approaches:

1. Use some framework for exposing Remote Services (CXF DOSGI, ECF, other?)

2. Just expose a web service on the "server" side, and have a web service client on the "consumer" side.

Are there any guidelines/sample setups over what frameworks etc that works well on Virgo? For example, running ECF on Virgo?

Anyone here that for example have deployed ECF remote services on Virgo successfully?
Re: Remote Service and Web Service - suggested tools? [message #635209 is a reply to message #634559] Tue, 26 October 2010 01:05 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
You can try this:

http://wiki.eclipse.org/Using_ECF_Remote_Services_Bundles_se parate_from_the_ECF_SDK

Can you get away with a simple JSON Restful service? That might be the simplest thing and no XML (either in payload or in descriptors)
Re: Remote Service and Web Service - suggested tools? [message #645094 is a reply to message #635209] Wed, 15 December 2010 15:02 Go to previous messageGo to next message
Lorie Pisicchio is currently offline Lorie PisicchioFriend
Messages: 44
Registered: October 2010
Member
Dear Peter
I am starting to have a look at remote services, so I'm very interested in the question you posted.
Did you find a solution for your remote use?
I am trying to get ECF working on Virgo, but it is very complicated. I also tried CXF-DOSGi, but didn't succeeded in having 2 Virgo containers to communicate.

Any success on your side?

Regards
Lorie
Re: Remote Service and Web Service - suggested tools? [message #645113 is a reply to message #645094] Wed, 15 December 2010 15:49 Go to previous messageGo to next message
Peter Lauri is currently offline Peter LauriFriend
Messages: 3
Registered: October 2010
Junior Member
ECF: never got it to work on Virgo. The main problem is that ECF core depends on equinox-common, and that does not start up on Virgo. If the ECF core would not have a bundle dependency, but rather import package requirements it would probably run ok. You could probably modify the ECF core manifest to not require equinox-common, but require a set of import packages instead, it would probably work as Virgo is built ontop of Equniox (?).

CXF DOSGI: we have gotten it to work quite nicely with just direct connection between the Virgo containers, no proxy in between as my original requirement was. How is your setup between the two virgos? Can you access the endpoint via browser and inspect the wsdl?
Re: Remote Service and Web Service - suggested tools? [message #645116 is a reply to message #645113] Wed, 15 December 2010 16:00 Go to previous messageGo to next message
Lorie Pisicchio is currently offline Lorie PisicchioFriend
Messages: 44
Registered: October 2010
Member
To make it simple, I have a bundle on machine A that is exposing a service with CXF.
On machine B, I am able to get the wsdl via the web browser, but the service reference can not be resolved.
Maybe I'm missing a piece of configuration on machine B to get the OSGi service repository to be able to discover services on machine B?
Can you describe the way you are configuring the bundles in order to have remote services (META-INF, OSGI-INF)? That would be a great help.
Re: Remote Service and Web Service - suggested tools? [message #645134 is a reply to message #645116] Wed, 15 December 2010 16:38 Go to previous messageGo to next message
Peter Lauri is currently offline Peter LauriFriend
Messages: 3
Registered: October 2010
Junior Member
OSGI-INF/cxf/intents/intent-map.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements. See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership. The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License. You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied. See the License for the
  specific language governing permissions and limitations
  under the License.
-->

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://cxf.apache.org/policy"
       xmlns:wsp="http://www.w3.org/ns/ws-policy"
       xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
       xmlns:http="http://cxf.apache.org/transports/http/configuration"
       xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
       xsi:schemaLocation="
       http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
       http://www.w3.org/ns/ws-policy http://www.w3.org/2007/02/ws-policy.xsd
       http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
       http://schemas.xmlsoap.org/ws/2005/02/rm/policy http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="intentMap" class="org.apache.cxf.dosgi.dsw.qos.IntentMap">
       <property name="intents">
         <map>
           <entry key="reliability" value-ref="reliableMessaging"/>
           <entry key="decoupled" value-ref="decoupledAddressing"/>
         </map>
       </property>
    </bean>

    <p:policies id="reliableMessaging">
        <wsp:PolicyReference URI="#ReliabilityPolicy"/>
        <wsp:PolicyReference URI="#DecoupledPolicy"/>
        <wsp:PolicyReference URI="#AddressingPolicy"/>
    </p:policies>

    <p:policies id="decoupledAddressing">
        <wsp:PolicyReference URI="#DecoupledPolicy"/>
        <wsp:PolicyReference URI="#AddressingPolicy"/>
    </p:policies>

    <wsp:Policy wsu:Id="ReliabilityPolicy">
        <wsrm-policy:RMAssertion>
            <wsrm-policy:BaseRetransmissionInterval Milliseconds="4000"/>
            <wsrm-policy:AcknowledgementInterval Milliseconds="2000" />
        </wsrm-policy:RMAssertion>
    </wsp:Policy>

    <wsp:Policy wsu:Id="DecoupledPolicy">
        <wsp:ExactlyOne>
            <http:client DecoupledEndpoint="http://localhost:9970/decoupled_endpoint"/>
        </wsp:ExactlyOne>
    </wsp:Policy>

    <wsp:Policy wsu:Id="AddressingPolicy"
        xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata">
        <wsam:Addressing>
            <wsp:Policy />
        </wsam:Addressing>
    </wsp:Policy>

</beans>



OSGI-INF/remote-service/remote-service.xml. You need to put the ip or host that you want to connect to in the endpoint.id.

<?xml version="1.0" encoding="UTF-8"?>
<endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0">
	<endpoint-description>
		<property name="objectClass">
			<array>
				<value>com.mycompany.TheServiceInterface</value>
			</array>
		</property>
		<property name="endpoint.id">http://localhost:8888/theserviceinterface</property>
		<property name="service.imported.configs">org.apache.cxf.ws</property>
	</endpoint-description>
</endpoint-descriptions>



Re: Remote Service and Web Service - suggested tools? [message #645138 is a reply to message #645134] Wed, 15 December 2010 16:44 Go to previous messageGo to next message
Lorie Pisicchio is currently offline Lorie PisicchioFriend
Messages: 44
Registered: October 2010
Member
I'll try this. I was totally missing the file OSGI-INF/cxf/intents/intent-map.xml. I guess maybe this explains the problem.
Thank you very much for your help.
Re: Remote Service and Web Service - suggested tools? [message #645480 is a reply to message #645138] Fri, 17 December 2010 12:19 Go to previous message
Lorie Pisicchio is currently offline Lorie PisicchioFriend
Messages: 44
Registered: October 2010
Member
Dear Peter,
Again, thank you for your help. I finally had some very simple example working.
But I soon as I tried to adapt it to my "real-world" needs, I had to give up on using CXF-DOSGI..
Over the two implementations available for databinding (aegis or jaxb), none are matching my needs. In aegis, we need to have default constructor for all objects passesd through remote service (which is not possible in my case), and with jaxb, you can not pass objects through their interfaces (need to use implementation classes instead).
So my attempt to setup remote OSGi services has failed....
Sad

As ECF is not using SOAP and web services, I guess that this would be more adapted to my needs, but it is way too complicated to setup...

Previous Topic:Why two inter-dependent bundles are deployed successfully?
Next Topic:JAX-RS + Virgo?
Goto Forum:
  


Current Time: Fri Dec 27 00:32:52 GMT 2024

Powered by FUDForum. Page generated in 0.03561 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top