Marco,
Here's the spring config file that i used to create webservice proxy that is
hosted using a hostname and port from the Config Admin. The values defined
in the spring config are defaults which are only used when the Config Admin
has no config dictionary registrered under the given persistent-id. This
means that you can drop a file named 'eu.schuring.cloud.node.cfg' in the
deploy directory with the following content:
host=192.168.10.3
port=8080
This will obviously cause the webservice to be hosted at 192.168.10.3:8080
instead of localhost:7000 as defined in the spring config. Make sure the
config is deployed before you start the webservice bundle. You can check if
your config registered properly using the command "config:list" in the
karaf/servicemix console.
Good luck, and feel free to ask a lot more questions! We know the website
isn't what it should be so we'll make up for that on the mailinglist ;)
Geert Schuring.
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://servicemix.apache.org/cxfbc/1.0"
xmlns:calc="http://cloud.schuring.eu/calculator"
xmlns:ctx="http://www.springframework.org/schema/context"
xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/osgi-compendium
http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
http://servicemix.apache.org/cxfbc/1.0
http://servicemix.apache.org/cxfbc/1.0/servicemix-cxf-bc.xsd">
<cxf:consumer
id="cloudCalculatorService"
wsdl="classpath:CloudCalculator.wsdl"
locationURI="http://${host}:${port}/cloud/calculator"
schemaValidationEnabled="false"
service="calc:CloudCalculatorService"
targetService="calc:CloudCalculatorService"
targetInterface="calc:CloudCalculator"/>
<bean
class="org.apache.servicemix.jbi.cluster.engine.OsgiSimpleClusterRegistration">
<property name="endpoint" ref="cloudCalculatorService" />
</bean>
<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
<osgix:cm-properties id="properties"
persistent-id="eu.schuring.cloud.node">
<prop key="host">localhost</prop>
<prop key="port">7000</prop>
</osgix:cm-properties>
<ctx:property-placeholder properties-ref="properties"/>
</beans>
-----Original Message-----
From: Marco Westermann
Sent: Monday, April 11, 2011 4:11 PM
To: [email protected]
Subject: Re: newbie question
Am 11.04.2011 10:15, schrieb Geert Schuring:
Hey Marco,
Another thing is:
Is it possible to externalize the service-binding so that I don't need
to rebuild the modules when the service-adresses change?
Yes that's possible. You can use properties from the OSGi Config Admin
service in your blueprint/spring XML file. I've used it to do exactly what
you describe. I have the code at home (@work now). Send me an email as a
reminder and i'll reply with an attached code example. I'm a bit busy so I
might forget without a reminder. :)
Greets,
Geert Schuring.
Thanks for any advise,
Marco
Am 08.04.2011 16:45, schrieb Matt Pavlovich:
Marco-
Check out XSLT. You can extract data from that XML document and output
it it any variety of formats, not just XML. You'll want to capture the
exact XML from "service one", so you can test your XSLT's. A handy tool
to do that is TCP Mon, available as an Eclipse plugin, or a stand alone
tool.
XSLT:
http://w3schools.com/xsl/default.asp
TCPMon:
http://ws.apache.org/commons/tcpmon/download.cgi
Matt Pavlovich
On Apr 8, 2011, at 9:33 AM, Marco Westermann wrote:
Hi, thank you for your response,
in fact there is some transformation needed for the response payload of
service call one.
The service one wrappes an activeX-Object and returns a string as part
of a complex type:
<element name="getChangedArticlesResponse">
<complexType>
<sequence>
<element name="getChangedArticlesReturn"
type="xsd:string" />
</sequence>
</complexType>
</element>
the string itself contains exactly the message which has to be routed
to service 2. Any idea how to make this work?
Thank you!
Marco
Am 07.04.2011 17:39, schrieb Matt Pavlovich:
Hi Marco-
You could implement a very simple solution using Camel running in
ServiceMix to do that. Look into the timer, or quartz Camel
components to start.
It would look something like:
<route>
<from uri="timer.. configure to kick off every 5 mintues" />
<to uri="http://webservice1:8080/call />
<to uri="http://webservice2:8080/call2 />
</route>
The response from the webservice1 would be directed as the input to
webservice2. As long as the payload is exactly the same, you don't
need to do anything. If there are slight changes to the xml, you can
insert a XSLT to take the response from webservice1 and send it to
webservice2 as the input.
Time based invocation:
http://camel.apache.org/timer.html
http://camel.apache.org/quartz.html
Simple web service calls:
http://camel.apache.org/http.html
Advanced web service:
http://camel.apache.org/cxf.html
XSLT:
http://camel.apache.org/xslt.html
Matt Pavlovich
On Apr 7, 2011, at 7:59 AM, Marco Westermann wrote:
Hi,
I try to implement the following process:
every 5 minutes I want to call a web Service take the answer and call
another web service with the return value from the first call.
using bpel would be nice to do the job (ode?). Is there a tutorial
which does similar tasks? I think I have still an understanding
problem on how to use serviceMix.
Thank you for all advice you can give.
Marco
__________ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version
6025 (20110408) __________
E-Mail wurde geprüft mit ESET NOD32 Antivirus.
http://www.eset.com
__________ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version
6026 (20110408) __________
E-Mail wurde geprüft mit ESET NOD32 Antivirus.
http://www.eset.com
__________ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version
6031 (20110410) __________
E-Mail wurde geprüft mit ESET NOD32 Antivirus.
http://www.eset.com
that would be great.. I really have problems implementing a simple
solution and I already spent days for it.
regards Marco