You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by Raffaele Spazzoli <rs...@imolinfo.it> on 2006/03/09 10:25:22 UTC

exposing a jbi endpoint as a SOAP endpoint

I'm developing a binding component using the sericemix-common library
and taking inspiration (i.e. coping :-) )from the jsr181 component.
It works and when I generate the wsdl for my deployed service I obtain a
jbi binding:

  <wsdl:binding name="VinciServiceJBIBinding"
type="tns:VinciServicePortType">
    <wsdlsoap:binding style="document"
transport="http://java.sun.com/xml/ns/jbi/binding/service+engine"/>
    <wsdl:operation name="vinciOperation">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="vinciOperationRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="vinciOperationResponse">
        <wsdlsoap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="VinciService">
    <wsdl:port binding="tns:VinciServiceJBIBinding"
name="VinciServiceJBIPort">
      <wsdlsoap:address
location="jbi://{http://vinci.test.iif.imolinfo.it}VinciService"/>
    </wsdl:port>

For what I understand (and is not much yet) of the jbi specification
this is ok and means that my component is listening on the NMR message
bus. Now I want to expose my service to external clients via SOAP
binding (lets say SOAP over HTTP).
I think this should be possible just configuring a SOAP endpoint to
route the messages it receives to my jbi endpoint. I didn't find a
standard way to do it. Is it possible and how?

I was able to exposte my endpoint on a http trasport using the non
standard jbi component provided by service mix adding this configuration
to the servicemix.xml:

<sm:activationSpec componentName="httpReceiver"
service="foo:httpBinding" 					   endpoint="httpReceiver"
destinationService="im:VinciService">
  <sm:component>
    <bean class="org.apache.servicemix.components.http.HttpConnector">
       <property name="host" value="localhost"/>
       <property name="port" value="8912"/>
    </bean>
  </sm:component>
</sm:activationSpec>

The problem is that this work only if I send to this endpoint just the
content of the SOAP body i.e. I must delete the Envelope and the Body
from the message. Probably this is what the jbi bindig requires.

thank in advance
Raffaele

Re: exposing a jbi endpoint as a SOAP endpoint

Posted by Guillaume Nodet <gn...@gmail.com>.
What I do not understand clearly is what you are trying to achieve.
>From what I understand, you are writing a binding component using
XFire.  The problem is that the JbiTransport has been designed to
be used in a Service Engine for receiving messages and I'm not
sure how it can be used it for a Binding Component.
What are the features of your BC compared to the existing servicemix-http ?

Guillaume Nodet

On 3/16/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
>
> sorry for not being clear.
> when I create the xfire service I also execute the following code
>     factory.getSoap11Transports().clear();
>     factory.getSoap12Transports().clear();
>     factory.getSoap11Transports().add(JbiTransport.JBI_BINDING);
>
> The code fragment is copied from the jsr181 component, but I think it is
> necessary. The problem is that JbiTransport is a class from
> servicemix-jsr181.jar as you say, so my prject is dependent from
> servicemix-common and also from servicemix-jsr181.jar just for one
> single class. I'm worndering whether this is a problem that every one
> that make a binding component using xfire as web service engine will
> encunter. If it happen to be like that it may be worth while moving that
> class to servicemix-common.
>
> ciao
> Raffaele
>
>
> On Thu, 2006-03-16 at 11:09 +0100, Guillaume Nodet wrote:
> > We use maven 1 to build ServiceMix.
> > The maven 2 build is not stable.
> > Btw, you can use nightly snapshots also (but you have to wait 24 hours)
> ...
> >
> > For the xfire stuff, I 'm not sure to understand how you use it.
> > Could you please explain ?
> > The transport is in the servicemix-jsr181.jar available at
> > http://cvs.apache.org/repository/incubator-servicemix/jars/
> >
> > Cheers,
> > Guillaume Nodet
> >
> > On 3/15/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
> > >
> > > I'm having problems building servicemix so I can't try your update. I
> > > have the following errors
> > > [WARNING] POM for 'incubator-activemq:activemq-core:pom:4.0-SNAPSHOT'
> is
> > > invalid. It will be ignored for artifact resolution. Reason: Not a
> > > v4.0.0 POM.
> > > Downloading:
> > >
> > >
> http://repo1.maven.org/maven2/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
> > > [WARNING] Unable to get resource from repository central
> > > (http://repo1.maven.org/maven2)
> > > Downloading:
> > >
> > >
> http://snapshots.maven.codehaus.org/maven2/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
> > > [WARNING] Unable to get resource from repository maven2-snapshots
> > > (http://snapshots.maven.codehaus.org/maven2)
> > > Downloading:
> > >
> > >
> http://servicemix.org/m2-repo/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
> > > [WARNING] Unable to get resource from repository servicemix-m2-repo
> > > (http://servicemix.org/m2-repo)
> > > Downloading:
> > >
> > >
> http://cvs.apache.org/maven-snapshot-repository/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
> > > [WARNING] Unable to get resource from repository apache-m2
> > > (http://cvs.apache.org/maven-snapshot-repository)
> > > Downloading:
> > >
> > >
> http://cvs.apache.org/repository/org.apache.db.ddlutils/poms/ddlutils-1.0-20060223.pom
> > > [WARNING] Unable to get resource from repository apache
> > > (http://cvs.apache.org/repository)
> > > Downloading:
> > >
> > >
> http://dist.codehaus.org/org.apache.db.ddlutils/poms/ddlutils-1.0-20060223.pom
> > > [WARNING] Unable to get resource from repository codehaus
> > > (http://dist.codehaus.org)
> > > Downloading:
> > >
> > >
> http://repo.logicblaze.com/maven1/org.apache.db.ddlutils/poms/ddlutils-1.0-20060223.pom
> > > [WARNING] Unable to get resource from repository logicblaze
> > > (http://repo.logicblaze.com/maven1)
> > >
> > > and so on ...
> > > Maven seems to have problems with active-mq and its depencies, I know
> is
> > > not a problem of servicemix, but do you know a workaround?
> > >
> > > Another issue: writing my component I used xfire for web service
> > > runtime, wrapping it as a JBI component I had to import the following
> > > class: org.apache.servicemix.jsr181.xfire.JbiTransport, which is
> located
> > > in the jsr181 component. Do you think it could be moved to common? or
> am
> > > I doing something wrong?
> > >
> > > thanks
> > > Raffaele
> > >
> > >
> > >
> > >
> > > On Mon, 2006-03-13 at 17:28 +0100, Guillaume Nodet wrote:
> > > > On 3/13/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
> > > > >
> > > > > I did as you said and it worked, thanks.
> > > > > There are still a couple of issue that I'd like to understand:
> > > > > 1. the SOAP-Http proxy service doesn't provide a wsdl. Do you
> think
> > > that
> > > > > could be possible to take the wsdl of the proxied service strip
> the
> > > jbi
> > > > > binding and put a SOAP-http binding?
> > > >
> > > >
> > > > Done. You should give it a try.  It does not currenly generate the
> > > binding
> > > > informations,
> > > > only the http or soap address for the endpoint.
> > > >
> > > > 2. I configured the routing using the xbean file:
> > > > > <http:endpoint service="im:VinciService"
> > > > >                            endpoint="imhttp:VinciService"
> > > > >                role="consumer"
> > > > >                locationURI="
> http://localhost:8192/Service/VinciService
> > > "
> > > > >                defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> > > > >                soap="true" />
> > > > > I'd like to do the same using the standard connection definitions
> of
> > > the
> > > > > jbi deployment descriptor of the service assembly. Does it make
> sense
> > > > > and is it supported in serivicemix?
> > > >
> > > >
> > > > Connections are now fully supported, but I'm not really sure how
> > > you  could
> > > > use them.
> > > > They have been rewritten last week.
> > > >
> > > > A connection defines that when a component will send a message to
> the
> > > > consumer
> > > > endpoint (or interface), it will be routed to the given provider
> > > endpoint.
> > > > The main goal
> > > > is to be able to define service units that are independant of the
> > > provider
> > > > endpoints.
> > > > These endpoints are thus defined in the service assembly with
> > > connections.
> > > >
> > > >
> > > > <connection>
> > > > >   <consumer endpoint-name="im:VinciServiceHttpPort"
> > > > > service-name="im:VinciService">
> > > > >   </consumer>
> > > > > <provider endpoint-name="im:VinciServiceJBIPort"
> > > > > service-name="im:VinciService">
> > > > >   </provider>
> > > > > </connection>
> > > > >
> > > > > If I try to do it servicemix complains that it can't find the
> cosumer
> > > > > service (the proxy), I believe it does is because the proxy
> service
> > > > > doesn't register a wsdl, so back to the previous point.
> > > > >
> > > > > About the service-common library I found it useful but not much
> > > > > documented, it took me a couple of days of code reading to
> understand
> > > > > what it could do for me.
> > > >
> > > >
> > > > Yeah, i know.  I will try to put write some doc in the following
> weeks.
> > > >
> > > > Last thing I suggest to add to the maven-servicemix-plugin a couple
> of
> > > goal
> > > > > to help the deploy of install zip and service assemblies.
> > > > > supposing to have a directory structure that mirrors the service
> > > assembly,
> > > > > I did the following scripts that could be a start:
> > > > >
> > > > >   <goal name="jbi:install" prereqs="jbi:jbi" description="install
> > > > > installer in deploy directory of esb">
> > > > >
> > > > >      <ant:echo>installing installer</ant:echo>
> > > > >      <ant:delete file="${maven.jbi.esb.dir}/install/${
> > > maven.jbi.final.name
> > > > > }"/>
> > > > >      <ant:copy file="${maven.build.dir}/${maven.jbi.final.name}"
> > > todir="${
> > > > > maven.jbi.esb.dir}/install" />
> > > > >
> > > > >   </goal>
> > > > >
> > > > >   <goal name="jbi:deploy"
> > > > >         prereqs="jbi:create-sa"
> > > > >         description="deploy the serice assembies">
> > > > >
> > > > >      <ant:echo>deploying sa</ant:echo>
> > > > >      <ant:delete file="${maven.jbi.esb.dir}/deploy/${
> jbi.assembly.name
> > > > > }.zip"/>
> > > > >      <ant:copy file="${basedir}/target/${jbi.assembly.name}.zip"
> > > todir="${
> > > > > maven.jbi.esb.dir}/deploy" />
> > > > >
> > > > >   </goal>
> > > > >
> > > > >   <goal name="jbi:create-sa" description="create the service
> > > assembly">
> > > > >         <j:set var="saname" value="${jbi.assembly.name}" />
> > > > >         <j:set var="keysaname" value="
> jbi.assembly.unitname.${saname}"
> > > />
> > > > >         <util:tokenize var="sus" delim=",">${context.getVariable
> > > > > (keysaname)}</util:tokenize>
> > > > >         <ant:mkdir dir="${basedir}/target/jbi_sa_${saname}" />
> > > > >         <j:forEach var="su" items="${sus}">
> > > > >         <log:info>generate service unit zip file for
> ${su}</log:info>
> > > > >                                 <ant:zip
> > > > > destfile="${basedir}/target/jbi_sa_${saname}/${su}.zip"
> > > > >                                 basedir="${jbi.assembly.dir}/${
> > > > > jbi.assembly.name}/${su}"/>
> > > > >                         </j:forEach>
> > > > >
> > > > >                         <ant:zip destfile="${basedir}/target/${
> > > > > jbi.assembly.name}.zip">
> > > > >                                 <ant:zipfileset dir="${
> > > jbi.assembly.dir
> > > > > }/${jbi.assembly.name}/META-INF" prefix="META-INF"/>
> > > > >                 <ant:zipfileset
> > > dir="${basedir}/target/jbi_sa_${saname}"
> > > > > includes="*.zip"/>
> > > > >                 </ant:zip>
> > > > >   </goal>
> > > >
> > > >
> > > > Good idea.
> > > > Thanks for the goals definitions ...
> > > >
> > > > Cheers,
> > > > Guillaume Nodet
> > > >
> > > > bye
> > > > > Raffaele
> > > > >
> > > > >
> > > > > On Thu, 2006-03-09 at 12:22 +0100, Guillaume Nodet wrote:
> > > > > > See comments inline
> > > > > >
> > > > > > On 3/9/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
> > > > > > >
> > > > > > > I'm developing a binding component using the sericemix-common
> > > library
> > > > > > > and taking inspiration (i.e. coping :-) )from the jsr181
> > > component.
> > > > > >
> > > > > >
> > > > > > If you have concerns with the existing component (missing
> features,
> > > > > > bugs...),
> > > > > > please raise them.
> > > > > >
> > > > > > It works and when I generate the wsdl for my deployed service I
> > > obtain a
> > > > > > > jbi binding:
> > > > > > >
> > > > > > >   <wsdl:binding name="VinciServiceJBIBinding"
> > > > > > > type="tns:VinciServicePortType">
> > > > > > >     <wsdlsoap:binding style="document"
> > > > > > > transport="
> http://java.sun.com/xml/ns/jbi/binding/service+engine
> > > "/>
> > > > > > >     <wsdl:operation name="vinciOperation">
> > > > > > >       <wsdlsoap:operation soapAction=""/>
> > > > > > >       <wsdl:input name="vinciOperationRequest">
> > > > > > >         <wsdlsoap:body use="literal"/>
> > > > > > >       </wsdl:input>
> > > > > > >       <wsdl:output name="vinciOperationResponse">
> > > > > > >         <wsdlsoap:body use="literal"/>
> > > > > > >       </wsdl:output>
> > > > > > >     </wsdl:operation>
> > > > > > >   </wsdl:binding>
> > > > > > >   <wsdl:service name="VinciService">
> > > > > > >     <wsdl:port binding="tns:VinciServiceJBIBinding"
> > > > > > > name="VinciServiceJBIPort">
> > > > > > >       <wsdlsoap:address
> > > > > > > location="jbi://{
> http://vinci.test.iif.imolinfo.it}VinciService"/>
> > > > > > >     </wsdl:port>
> > > > > > >
> > > > > > > For what I understand (and is not much yet) of the jbi
> > > specification
> > > > > > > this is ok and means that my component is listening on the NMR
> > > message
> > > > > > > bus. Now I want to expose my service to external clients via
> SOAP
> > > > > > > binding (lets say SOAP over HTTP).
> > > > > > > I think this should be possible just configuring a SOAP
> endpoint
> > > to
> > > > > > > route the messages it receives to my jbi endpoint. I didn't
> find a
> > > > > > > standard way to do it. Is it possible and how?
> > > > > >
> > > > > >
> > > > > > The servicemix-http component can do this for you.
> > > > > > See soap-binding example in the distribution and the test cases
> for
> > > this
> > > > > > component.
> > > > > > You can deploy WSDL or simple xml describing the endpoints.
> > > > > > I hope we can provide some "automatic" way do create
> > > > > > a proxy endpoint on a binding component in the future.
> > > > > >
> > > > > > I was able to exposte my endpoint on a http trasport using the
> non
> > > > > > > standard jbi component provided by service mix adding this
> > > > > configuration
> > > > > > > to the servicemix.xml:
> > > > > > >
> > > > > > > <sm:activationSpec componentName="httpReceiver"
> > > > > > >
> > > > > > >
> > > > >
> > >
> service="foo:httpBinding"                                          endpoint="httpReceiver"
> > > > > > > destinationService="im:VinciService">
> > > > > > >   <sm:component>
> > > > > > >     <bean class="
> > > org.apache.servicemix.components.http.HttpConnector">
> > > > > > >        <property name="host" value="localhost"/>
> > > > > > >        <property name="port" value="8912"/>
> > > > > > >     </bean>
> > > > > > >   </sm:component>
> > > > > > > </sm:activationSpec>
> > > > > > >
> > > > > > > The problem is that this work only if I send to this endpoint
> just
> > > the
> > > > > > > content of the SOAP body i.e. I must delete the Envelope and
> the
> > > Body
> > > > > > > from the message. Probably this is what the jbi bindig
> requires.
> > > > > >
> > > > > >
> > > > > > If you use the servicemix-http component, you will be able to
> > > configure
> > > > > > if you want to use soap or not.
> > > > > > Else you may want to try the HttpSoapConnector instead.
> > > > > > Note that there is no reason why the soap enveloppe should be
> sent
> > > > > > inside the NMR.  Soap is a protocol and should be handled by the
> > > binding
> > > > > > component, not the service engine.  The HttpConnector does not
> care
> > > > > about
> > > > > > soap
> > > > > > and so will send the whole content of the message in the http
> > > request
> > > > > (and
> > > > > > same thing
> > > > > > the other way), whereas the HttpSoapConnector will add/remove
> the
> > > soap
> > > > > > enveloppe.
> > > > > >
> > > > > > Cheers,
> > > > > > Guillaume Nodet
> > > > > >
> > > > > > thank in advance
> > > > > > > Raffaele
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > >
> > >
>
>

Re: exposing a jbi endpoint as a SOAP endpoint

Posted by Raffaele Spazzoli <rs...@imolinfo.it>.
sorry for not being clear. 
when I create the xfire service I also execute the following code
    factory.getSoap11Transports().clear();
    factory.getSoap12Transports().clear();
    factory.getSoap11Transports().add(JbiTransport.JBI_BINDING);

The code fragment is copied from the jsr181 component, but I think it is
necessary. The problem is that JbiTransport is a class from
servicemix-jsr181.jar as you say, so my prject is dependent from
servicemix-common and also from servicemix-jsr181.jar just for one
single class. I'm worndering whether this is a problem that every one
that make a binding component using xfire as web service engine will
encunter. If it happen to be like that it may be worth while moving that
class to servicemix-common.

ciao
Raffaele


On Thu, 2006-03-16 at 11:09 +0100, Guillaume Nodet wrote:
> We use maven 1 to build ServiceMix.
> The maven 2 build is not stable.
> Btw, you can use nightly snapshots also (but you have to wait 24 hours) ...
> 
> For the xfire stuff, I 'm not sure to understand how you use it.
> Could you please explain ?
> The transport is in the servicemix-jsr181.jar available at
> http://cvs.apache.org/repository/incubator-servicemix/jars/
> 
> Cheers,
> Guillaume Nodet
> 
> On 3/15/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
> >
> > I'm having problems building servicemix so I can't try your update. I
> > have the following errors
> > [WARNING] POM for 'incubator-activemq:activemq-core:pom:4.0-SNAPSHOT' is
> > invalid. It will be ignored for artifact resolution. Reason: Not a
> > v4.0.0 POM.
> > Downloading:
> >
> > http://repo1.maven.org/maven2/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
> > [WARNING] Unable to get resource from repository central
> > (http://repo1.maven.org/maven2)
> > Downloading:
> >
> > http://snapshots.maven.codehaus.org/maven2/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
> > [WARNING] Unable to get resource from repository maven2-snapshots
> > (http://snapshots.maven.codehaus.org/maven2)
> > Downloading:
> >
> > http://servicemix.org/m2-repo/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
> > [WARNING] Unable to get resource from repository servicemix-m2-repo
> > (http://servicemix.org/m2-repo)
> > Downloading:
> >
> > http://cvs.apache.org/maven-snapshot-repository/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
> > [WARNING] Unable to get resource from repository apache-m2
> > (http://cvs.apache.org/maven-snapshot-repository)
> > Downloading:
> >
> > http://cvs.apache.org/repository/org.apache.db.ddlutils/poms/ddlutils-1.0-20060223.pom
> > [WARNING] Unable to get resource from repository apache
> > (http://cvs.apache.org/repository)
> > Downloading:
> >
> > http://dist.codehaus.org/org.apache.db.ddlutils/poms/ddlutils-1.0-20060223.pom
> > [WARNING] Unable to get resource from repository codehaus
> > (http://dist.codehaus.org)
> > Downloading:
> >
> > http://repo.logicblaze.com/maven1/org.apache.db.ddlutils/poms/ddlutils-1.0-20060223.pom
> > [WARNING] Unable to get resource from repository logicblaze
> > (http://repo.logicblaze.com/maven1)
> >
> > and so on ...
> > Maven seems to have problems with active-mq and its depencies, I know is
> > not a problem of servicemix, but do you know a workaround?
> >
> > Another issue: writing my component I used xfire for web service
> > runtime, wrapping it as a JBI component I had to import the following
> > class: org.apache.servicemix.jsr181.xfire.JbiTransport, which is located
> > in the jsr181 component. Do you think it could be moved to common? or am
> > I doing something wrong?
> >
> > thanks
> > Raffaele
> >
> >
> >
> >
> > On Mon, 2006-03-13 at 17:28 +0100, Guillaume Nodet wrote:
> > > On 3/13/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
> > > >
> > > > I did as you said and it worked, thanks.
> > > > There are still a couple of issue that I'd like to understand:
> > > > 1. the SOAP-Http proxy service doesn't provide a wsdl. Do you think
> > that
> > > > could be possible to take the wsdl of the proxied service strip the
> > jbi
> > > > binding and put a SOAP-http binding?
> > >
> > >
> > > Done. You should give it a try.  It does not currenly generate the
> > binding
> > > informations,
> > > only the http or soap address for the endpoint.
> > >
> > > 2. I configured the routing using the xbean file:
> > > > <http:endpoint service="im:VinciService"
> > > >                            endpoint="imhttp:VinciService"
> > > >                role="consumer"
> > > >                locationURI="http://localhost:8192/Service/VinciService
> > "
> > > >                defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> > > >                soap="true" />
> > > > I'd like to do the same using the standard connection definitions of
> > the
> > > > jbi deployment descriptor of the service assembly. Does it make sense
> > > > and is it supported in serivicemix?
> > >
> > >
> > > Connections are now fully supported, but I'm not really sure how
> > you  could
> > > use them.
> > > They have been rewritten last week.
> > >
> > > A connection defines that when a component will send a message to the
> > > consumer
> > > endpoint (or interface), it will be routed to the given provider
> > endpoint.
> > > The main goal
> > > is to be able to define service units that are independant of the
> > provider
> > > endpoints.
> > > These endpoints are thus defined in the service assembly with
> > connections.
> > >
> > >
> > > <connection>
> > > >   <consumer endpoint-name="im:VinciServiceHttpPort"
> > > > service-name="im:VinciService">
> > > >   </consumer>
> > > > <provider endpoint-name="im:VinciServiceJBIPort"
> > > > service-name="im:VinciService">
> > > >   </provider>
> > > > </connection>
> > > >
> > > > If I try to do it servicemix complains that it can't find the cosumer
> > > > service (the proxy), I believe it does is because the proxy service
> > > > doesn't register a wsdl, so back to the previous point.
> > > >
> > > > About the service-common library I found it useful but not much
> > > > documented, it took me a couple of days of code reading to understand
> > > > what it could do for me.
> > >
> > >
> > > Yeah, i know.  I will try to put write some doc in the following weeks.
> > >
> > > Last thing I suggest to add to the maven-servicemix-plugin a couple of
> > goal
> > > > to help the deploy of install zip and service assemblies.
> > > > supposing to have a directory structure that mirrors the service
> > assembly,
> > > > I did the following scripts that could be a start:
> > > >
> > > >   <goal name="jbi:install" prereqs="jbi:jbi" description="install
> > > > installer in deploy directory of esb">
> > > >
> > > >      <ant:echo>installing installer</ant:echo>
> > > >      <ant:delete file="${maven.jbi.esb.dir}/install/${
> > maven.jbi.final.name
> > > > }"/>
> > > >      <ant:copy file="${maven.build.dir}/${maven.jbi.final.name}"
> > todir="${
> > > > maven.jbi.esb.dir}/install" />
> > > >
> > > >   </goal>
> > > >
> > > >   <goal name="jbi:deploy"
> > > >         prereqs="jbi:create-sa"
> > > >         description="deploy the serice assembies">
> > > >
> > > >      <ant:echo>deploying sa</ant:echo>
> > > >      <ant:delete file="${maven.jbi.esb.dir}/deploy/${jbi.assembly.name
> > > > }.zip"/>
> > > >      <ant:copy file="${basedir}/target/${jbi.assembly.name}.zip"
> > todir="${
> > > > maven.jbi.esb.dir}/deploy" />
> > > >
> > > >   </goal>
> > > >
> > > >   <goal name="jbi:create-sa" description="create the service
> > assembly">
> > > >         <j:set var="saname" value="${jbi.assembly.name}" />
> > > >         <j:set var="keysaname" value="jbi.assembly.unitname.${saname}"
> > />
> > > >         <util:tokenize var="sus" delim=",">${context.getVariable
> > > > (keysaname)}</util:tokenize>
> > > >         <ant:mkdir dir="${basedir}/target/jbi_sa_${saname}" />
> > > >         <j:forEach var="su" items="${sus}">
> > > >         <log:info>generate service unit zip file for ${su}</log:info>
> > > >                                 <ant:zip
> > > > destfile="${basedir}/target/jbi_sa_${saname}/${su}.zip"
> > > >                                 basedir="${jbi.assembly.dir}/${
> > > > jbi.assembly.name}/${su}"/>
> > > >                         </j:forEach>
> > > >
> > > >                         <ant:zip destfile="${basedir}/target/${
> > > > jbi.assembly.name}.zip">
> > > >                                 <ant:zipfileset dir="${
> > jbi.assembly.dir
> > > > }/${jbi.assembly.name}/META-INF" prefix="META-INF"/>
> > > >                 <ant:zipfileset
> > dir="${basedir}/target/jbi_sa_${saname}"
> > > > includes="*.zip"/>
> > > >                 </ant:zip>
> > > >   </goal>
> > >
> > >
> > > Good idea.
> > > Thanks for the goals definitions ...
> > >
> > > Cheers,
> > > Guillaume Nodet
> > >
> > > bye
> > > > Raffaele
> > > >
> > > >
> > > > On Thu, 2006-03-09 at 12:22 +0100, Guillaume Nodet wrote:
> > > > > See comments inline
> > > > >
> > > > > On 3/9/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
> > > > > >
> > > > > > I'm developing a binding component using the sericemix-common
> > library
> > > > > > and taking inspiration (i.e. coping :-) )from the jsr181
> > component.
> > > > >
> > > > >
> > > > > If you have concerns with the existing component (missing features,
> > > > > bugs...),
> > > > > please raise them.
> > > > >
> > > > > It works and when I generate the wsdl for my deployed service I
> > obtain a
> > > > > > jbi binding:
> > > > > >
> > > > > >   <wsdl:binding name="VinciServiceJBIBinding"
> > > > > > type="tns:VinciServicePortType">
> > > > > >     <wsdlsoap:binding style="document"
> > > > > > transport="http://java.sun.com/xml/ns/jbi/binding/service+engine
> > "/>
> > > > > >     <wsdl:operation name="vinciOperation">
> > > > > >       <wsdlsoap:operation soapAction=""/>
> > > > > >       <wsdl:input name="vinciOperationRequest">
> > > > > >         <wsdlsoap:body use="literal"/>
> > > > > >       </wsdl:input>
> > > > > >       <wsdl:output name="vinciOperationResponse">
> > > > > >         <wsdlsoap:body use="literal"/>
> > > > > >       </wsdl:output>
> > > > > >     </wsdl:operation>
> > > > > >   </wsdl:binding>
> > > > > >   <wsdl:service name="VinciService">
> > > > > >     <wsdl:port binding="tns:VinciServiceJBIBinding"
> > > > > > name="VinciServiceJBIPort">
> > > > > >       <wsdlsoap:address
> > > > > > location="jbi://{http://vinci.test.iif.imolinfo.it}VinciService"/>
> > > > > >     </wsdl:port>
> > > > > >
> > > > > > For what I understand (and is not much yet) of the jbi
> > specification
> > > > > > this is ok and means that my component is listening on the NMR
> > message
> > > > > > bus. Now I want to expose my service to external clients via SOAP
> > > > > > binding (lets say SOAP over HTTP).
> > > > > > I think this should be possible just configuring a SOAP endpoint
> > to
> > > > > > route the messages it receives to my jbi endpoint. I didn't find a
> > > > > > standard way to do it. Is it possible and how?
> > > > >
> > > > >
> > > > > The servicemix-http component can do this for you.
> > > > > See soap-binding example in the distribution and the test cases for
> > this
> > > > > component.
> > > > > You can deploy WSDL or simple xml describing the endpoints.
> > > > > I hope we can provide some "automatic" way do create
> > > > > a proxy endpoint on a binding component in the future.
> > > > >
> > > > > I was able to exposte my endpoint on a http trasport using the non
> > > > > > standard jbi component provided by service mix adding this
> > > > configuration
> > > > > > to the servicemix.xml:
> > > > > >
> > > > > > <sm:activationSpec componentName="httpReceiver"
> > > > > >
> > > > > >
> > > >
> > service="foo:httpBinding"                                          endpoint="httpReceiver"
> > > > > > destinationService="im:VinciService">
> > > > > >   <sm:component>
> > > > > >     <bean class="
> > org.apache.servicemix.components.http.HttpConnector">
> > > > > >        <property name="host" value="localhost"/>
> > > > > >        <property name="port" value="8912"/>
> > > > > >     </bean>
> > > > > >   </sm:component>
> > > > > > </sm:activationSpec>
> > > > > >
> > > > > > The problem is that this work only if I send to this endpoint just
> > the
> > > > > > content of the SOAP body i.e. I must delete the Envelope and the
> > Body
> > > > > > from the message. Probably this is what the jbi bindig requires.
> > > > >
> > > > >
> > > > > If you use the servicemix-http component, you will be able to
> > configure
> > > > > if you want to use soap or not.
> > > > > Else you may want to try the HttpSoapConnector instead.
> > > > > Note that there is no reason why the soap enveloppe should be sent
> > > > > inside the NMR.  Soap is a protocol and should be handled by the
> > binding
> > > > > component, not the service engine.  The HttpConnector does not care
> > > > about
> > > > > soap
> > > > > and so will send the whole content of the message in the http
> > request
> > > > (and
> > > > > same thing
> > > > > the other way), whereas the HttpSoapConnector will add/remove the
> > soap
> > > > > enveloppe.
> > > > >
> > > > > Cheers,
> > > > > Guillaume Nodet
> > > > >
> > > > > thank in advance
> > > > > > Raffaele
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> >
> >


Re: exposing a jbi endpoint as a SOAP endpoint

Posted by Guillaume Nodet <gn...@gmail.com>.
We use maven 1 to build ServiceMix.
The maven 2 build is not stable.
Btw, you can use nightly snapshots also (but you have to wait 24 hours) ...

For the xfire stuff, I 'm not sure to understand how you use it.
Could you please explain ?
The transport is in the servicemix-jsr181.jar available at
http://cvs.apache.org/repository/incubator-servicemix/jars/

Cheers,
Guillaume Nodet

On 3/15/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
>
> I'm having problems building servicemix so I can't try your update. I
> have the following errors
> [WARNING] POM for 'incubator-activemq:activemq-core:pom:4.0-SNAPSHOT' is
> invalid. It will be ignored for artifact resolution. Reason: Not a
> v4.0.0 POM.
> Downloading:
>
> http://repo1.maven.org/maven2/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
> [WARNING] Unable to get resource from repository central
> (http://repo1.maven.org/maven2)
> Downloading:
>
> http://snapshots.maven.codehaus.org/maven2/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
> [WARNING] Unable to get resource from repository maven2-snapshots
> (http://snapshots.maven.codehaus.org/maven2)
> Downloading:
>
> http://servicemix.org/m2-repo/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
> [WARNING] Unable to get resource from repository servicemix-m2-repo
> (http://servicemix.org/m2-repo)
> Downloading:
>
> http://cvs.apache.org/maven-snapshot-repository/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
> [WARNING] Unable to get resource from repository apache-m2
> (http://cvs.apache.org/maven-snapshot-repository)
> Downloading:
>
> http://cvs.apache.org/repository/org.apache.db.ddlutils/poms/ddlutils-1.0-20060223.pom
> [WARNING] Unable to get resource from repository apache
> (http://cvs.apache.org/repository)
> Downloading:
>
> http://dist.codehaus.org/org.apache.db.ddlutils/poms/ddlutils-1.0-20060223.pom
> [WARNING] Unable to get resource from repository codehaus
> (http://dist.codehaus.org)
> Downloading:
>
> http://repo.logicblaze.com/maven1/org.apache.db.ddlutils/poms/ddlutils-1.0-20060223.pom
> [WARNING] Unable to get resource from repository logicblaze
> (http://repo.logicblaze.com/maven1)
>
> and so on ...
> Maven seems to have problems with active-mq and its depencies, I know is
> not a problem of servicemix, but do you know a workaround?
>
> Another issue: writing my component I used xfire for web service
> runtime, wrapping it as a JBI component I had to import the following
> class: org.apache.servicemix.jsr181.xfire.JbiTransport, which is located
> in the jsr181 component. Do you think it could be moved to common? or am
> I doing something wrong?
>
> thanks
> Raffaele
>
>
>
>
> On Mon, 2006-03-13 at 17:28 +0100, Guillaume Nodet wrote:
> > On 3/13/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
> > >
> > > I did as you said and it worked, thanks.
> > > There are still a couple of issue that I'd like to understand:
> > > 1. the SOAP-Http proxy service doesn't provide a wsdl. Do you think
> that
> > > could be possible to take the wsdl of the proxied service strip the
> jbi
> > > binding and put a SOAP-http binding?
> >
> >
> > Done. You should give it a try.  It does not currenly generate the
> binding
> > informations,
> > only the http or soap address for the endpoint.
> >
> > 2. I configured the routing using the xbean file:
> > > <http:endpoint service="im:VinciService"
> > >                            endpoint="imhttp:VinciService"
> > >                role="consumer"
> > >                locationURI="http://localhost:8192/Service/VinciService
> "
> > >                defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> > >                soap="true" />
> > > I'd like to do the same using the standard connection definitions of
> the
> > > jbi deployment descriptor of the service assembly. Does it make sense
> > > and is it supported in serivicemix?
> >
> >
> > Connections are now fully supported, but I'm not really sure how
> you  could
> > use them.
> > They have been rewritten last week.
> >
> > A connection defines that when a component will send a message to the
> > consumer
> > endpoint (or interface), it will be routed to the given provider
> endpoint.
> > The main goal
> > is to be able to define service units that are independant of the
> provider
> > endpoints.
> > These endpoints are thus defined in the service assembly with
> connections.
> >
> >
> > <connection>
> > >   <consumer endpoint-name="im:VinciServiceHttpPort"
> > > service-name="im:VinciService">
> > >   </consumer>
> > > <provider endpoint-name="im:VinciServiceJBIPort"
> > > service-name="im:VinciService">
> > >   </provider>
> > > </connection>
> > >
> > > If I try to do it servicemix complains that it can't find the cosumer
> > > service (the proxy), I believe it does is because the proxy service
> > > doesn't register a wsdl, so back to the previous point.
> > >
> > > About the service-common library I found it useful but not much
> > > documented, it took me a couple of days of code reading to understand
> > > what it could do for me.
> >
> >
> > Yeah, i know.  I will try to put write some doc in the following weeks.
> >
> > Last thing I suggest to add to the maven-servicemix-plugin a couple of
> goal
> > > to help the deploy of install zip and service assemblies.
> > > supposing to have a directory structure that mirrors the service
> assembly,
> > > I did the following scripts that could be a start:
> > >
> > >   <goal name="jbi:install" prereqs="jbi:jbi" description="install
> > > installer in deploy directory of esb">
> > >
> > >      <ant:echo>installing installer</ant:echo>
> > >      <ant:delete file="${maven.jbi.esb.dir}/install/${
> maven.jbi.final.name
> > > }"/>
> > >      <ant:copy file="${maven.build.dir}/${maven.jbi.final.name}"
> todir="${
> > > maven.jbi.esb.dir}/install" />
> > >
> > >   </goal>
> > >
> > >   <goal name="jbi:deploy"
> > >         prereqs="jbi:create-sa"
> > >         description="deploy the serice assembies">
> > >
> > >      <ant:echo>deploying sa</ant:echo>
> > >      <ant:delete file="${maven.jbi.esb.dir}/deploy/${jbi.assembly.name
> > > }.zip"/>
> > >      <ant:copy file="${basedir}/target/${jbi.assembly.name}.zip"
> todir="${
> > > maven.jbi.esb.dir}/deploy" />
> > >
> > >   </goal>
> > >
> > >   <goal name="jbi:create-sa" description="create the service
> assembly">
> > >         <j:set var="saname" value="${jbi.assembly.name}" />
> > >         <j:set var="keysaname" value="jbi.assembly.unitname.${saname}"
> />
> > >         <util:tokenize var="sus" delim=",">${context.getVariable
> > > (keysaname)}</util:tokenize>
> > >         <ant:mkdir dir="${basedir}/target/jbi_sa_${saname}" />
> > >         <j:forEach var="su" items="${sus}">
> > >         <log:info>generate service unit zip file for ${su}</log:info>
> > >                                 <ant:zip
> > > destfile="${basedir}/target/jbi_sa_${saname}/${su}.zip"
> > >                                 basedir="${jbi.assembly.dir}/${
> > > jbi.assembly.name}/${su}"/>
> > >                         </j:forEach>
> > >
> > >                         <ant:zip destfile="${basedir}/target/${
> > > jbi.assembly.name}.zip">
> > >                                 <ant:zipfileset dir="${
> jbi.assembly.dir
> > > }/${jbi.assembly.name}/META-INF" prefix="META-INF"/>
> > >                 <ant:zipfileset
> dir="${basedir}/target/jbi_sa_${saname}"
> > > includes="*.zip"/>
> > >                 </ant:zip>
> > >   </goal>
> >
> >
> > Good idea.
> > Thanks for the goals definitions ...
> >
> > Cheers,
> > Guillaume Nodet
> >
> > bye
> > > Raffaele
> > >
> > >
> > > On Thu, 2006-03-09 at 12:22 +0100, Guillaume Nodet wrote:
> > > > See comments inline
> > > >
> > > > On 3/9/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
> > > > >
> > > > > I'm developing a binding component using the sericemix-common
> library
> > > > > and taking inspiration (i.e. coping :-) )from the jsr181
> component.
> > > >
> > > >
> > > > If you have concerns with the existing component (missing features,
> > > > bugs...),
> > > > please raise them.
> > > >
> > > > It works and when I generate the wsdl for my deployed service I
> obtain a
> > > > > jbi binding:
> > > > >
> > > > >   <wsdl:binding name="VinciServiceJBIBinding"
> > > > > type="tns:VinciServicePortType">
> > > > >     <wsdlsoap:binding style="document"
> > > > > transport="http://java.sun.com/xml/ns/jbi/binding/service+engine
> "/>
> > > > >     <wsdl:operation name="vinciOperation">
> > > > >       <wsdlsoap:operation soapAction=""/>
> > > > >       <wsdl:input name="vinciOperationRequest">
> > > > >         <wsdlsoap:body use="literal"/>
> > > > >       </wsdl:input>
> > > > >       <wsdl:output name="vinciOperationResponse">
> > > > >         <wsdlsoap:body use="literal"/>
> > > > >       </wsdl:output>
> > > > >     </wsdl:operation>
> > > > >   </wsdl:binding>
> > > > >   <wsdl:service name="VinciService">
> > > > >     <wsdl:port binding="tns:VinciServiceJBIBinding"
> > > > > name="VinciServiceJBIPort">
> > > > >       <wsdlsoap:address
> > > > > location="jbi://{http://vinci.test.iif.imolinfo.it}VinciService"/>
> > > > >     </wsdl:port>
> > > > >
> > > > > For what I understand (and is not much yet) of the jbi
> specification
> > > > > this is ok and means that my component is listening on the NMR
> message
> > > > > bus. Now I want to expose my service to external clients via SOAP
> > > > > binding (lets say SOAP over HTTP).
> > > > > I think this should be possible just configuring a SOAP endpoint
> to
> > > > > route the messages it receives to my jbi endpoint. I didn't find a
> > > > > standard way to do it. Is it possible and how?
> > > >
> > > >
> > > > The servicemix-http component can do this for you.
> > > > See soap-binding example in the distribution and the test cases for
> this
> > > > component.
> > > > You can deploy WSDL or simple xml describing the endpoints.
> > > > I hope we can provide some "automatic" way do create
> > > > a proxy endpoint on a binding component in the future.
> > > >
> > > > I was able to exposte my endpoint on a http trasport using the non
> > > > > standard jbi component provided by service mix adding this
> > > configuration
> > > > > to the servicemix.xml:
> > > > >
> > > > > <sm:activationSpec componentName="httpReceiver"
> > > > >
> > > > >
> > >
> service="foo:httpBinding"                                          endpoint="httpReceiver"
> > > > > destinationService="im:VinciService">
> > > > >   <sm:component>
> > > > >     <bean class="
> org.apache.servicemix.components.http.HttpConnector">
> > > > >        <property name="host" value="localhost"/>
> > > > >        <property name="port" value="8912"/>
> > > > >     </bean>
> > > > >   </sm:component>
> > > > > </sm:activationSpec>
> > > > >
> > > > > The problem is that this work only if I send to this endpoint just
> the
> > > > > content of the SOAP body i.e. I must delete the Envelope and the
> Body
> > > > > from the message. Probably this is what the jbi bindig requires.
> > > >
> > > >
> > > > If you use the servicemix-http component, you will be able to
> configure
> > > > if you want to use soap or not.
> > > > Else you may want to try the HttpSoapConnector instead.
> > > > Note that there is no reason why the soap enveloppe should be sent
> > > > inside the NMR.  Soap is a protocol and should be handled by the
> binding
> > > > component, not the service engine.  The HttpConnector does not care
> > > about
> > > > soap
> > > > and so will send the whole content of the message in the http
> request
> > > (and
> > > > same thing
> > > > the other way), whereas the HttpSoapConnector will add/remove the
> soap
> > > > enveloppe.
> > > >
> > > > Cheers,
> > > > Guillaume Nodet
> > > >
> > > > thank in advance
> > > > > Raffaele
> > > > >
> > > > >
> > > > >
> > >
> > >
>
>

Re: exposing a jbi endpoint as a SOAP endpoint

Posted by Raffaele Spazzoli <rs...@imolinfo.it>.
I'm having problems building servicemix so I can't try your update. I
have the following errors
[WARNING] POM for 'incubator-activemq:activemq-core:pom:4.0-SNAPSHOT' is
invalid. It will be ignored for artifact resolution. Reason: Not a
v4.0.0 POM.
Downloading:
http://repo1.maven.org/maven2/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
[WARNING] Unable to get resource from repository central
(http://repo1.maven.org/maven2)
Downloading:
http://snapshots.maven.codehaus.org/maven2/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
[WARNING] Unable to get resource from repository maven2-snapshots
(http://snapshots.maven.codehaus.org/maven2)
Downloading:
http://servicemix.org/m2-repo/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
[WARNING] Unable to get resource from repository servicemix-m2-repo
(http://servicemix.org/m2-repo)
Downloading:
http://cvs.apache.org/maven-snapshot-repository/org/apache/db/ddlutils/ddlutils/1.0-20060223/ddlutils-1.0-20060223.pom
[WARNING] Unable to get resource from repository apache-m2
(http://cvs.apache.org/maven-snapshot-repository)
Downloading:
http://cvs.apache.org/repository/org.apache.db.ddlutils/poms/ddlutils-1.0-20060223.pom
[WARNING] Unable to get resource from repository apache
(http://cvs.apache.org/repository)
Downloading:
http://dist.codehaus.org/org.apache.db.ddlutils/poms/ddlutils-1.0-20060223.pom
[WARNING] Unable to get resource from repository codehaus
(http://dist.codehaus.org)
Downloading:
http://repo.logicblaze.com/maven1/org.apache.db.ddlutils/poms/ddlutils-1.0-20060223.pom
[WARNING] Unable to get resource from repository logicblaze
(http://repo.logicblaze.com/maven1)

and so on ... 
Maven seems to have problems with active-mq and its depencies, I know is
not a problem of servicemix, but do you know a workaround?

Another issue: writing my component I used xfire for web service
runtime, wrapping it as a JBI component I had to import the following
class: org.apache.servicemix.jsr181.xfire.JbiTransport, which is located
in the jsr181 component. Do you think it could be moved to common? or am
I doing something wrong?

thanks
Raffaele




On Mon, 2006-03-13 at 17:28 +0100, Guillaume Nodet wrote:
> On 3/13/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
> >
> > I did as you said and it worked, thanks.
> > There are still a couple of issue that I'd like to understand:
> > 1. the SOAP-Http proxy service doesn't provide a wsdl. Do you think that
> > could be possible to take the wsdl of the proxied service strip the jbi
> > binding and put a SOAP-http binding?
> 
> 
> Done. You should give it a try.  It does not currenly generate the binding
> informations,
> only the http or soap address for the endpoint.
> 
> 2. I configured the routing using the xbean file:
> > <http:endpoint service="im:VinciService"
> >                            endpoint="imhttp:VinciService"
> >                role="consumer"
> >                locationURI="http://localhost:8192/Service/VinciService"
> >                defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> >                soap="true" />
> > I'd like to do the same using the standard connection definitions of the
> > jbi deployment descriptor of the service assembly. Does it make sense
> > and is it supported in serivicemix?
> 
> 
> Connections are now fully supported, but I'm not really sure how you  could
> use them.
> They have been rewritten last week.
> 
> A connection defines that when a component will send a message to the
> consumer
> endpoint (or interface), it will be routed to the given provider endpoint.
> The main goal
> is to be able to define service units that are independant of the provider
> endpoints.
> These endpoints are thus defined in the service assembly with connections.
> 
> 
> <connection>
> >   <consumer endpoint-name="im:VinciServiceHttpPort"
> > service-name="im:VinciService">
> >   </consumer>
> > <provider endpoint-name="im:VinciServiceJBIPort"
> > service-name="im:VinciService">
> >   </provider>
> > </connection>
> >
> > If I try to do it servicemix complains that it can't find the cosumer
> > service (the proxy), I believe it does is because the proxy service
> > doesn't register a wsdl, so back to the previous point.
> >
> > About the service-common library I found it useful but not much
> > documented, it took me a couple of days of code reading to understand
> > what it could do for me.
> 
> 
> Yeah, i know.  I will try to put write some doc in the following weeks.
> 
> Last thing I suggest to add to the maven-servicemix-plugin a couple of goal
> > to help the deploy of install zip and service assemblies.
> > supposing to have a directory structure that mirrors the service assembly,
> > I did the following scripts that could be a start:
> >
> >   <goal name="jbi:install" prereqs="jbi:jbi" description="install
> > installer in deploy directory of esb">
> >
> >      <ant:echo>installing installer</ant:echo>
> >      <ant:delete file="${maven.jbi.esb.dir}/install/${maven.jbi.final.name
> > }"/>
> >      <ant:copy file="${maven.build.dir}/${maven.jbi.final.name}" todir="${
> > maven.jbi.esb.dir}/install" />
> >
> >   </goal>
> >
> >   <goal name="jbi:deploy"
> >         prereqs="jbi:create-sa"
> >         description="deploy the serice assembies">
> >
> >      <ant:echo>deploying sa</ant:echo>
> >      <ant:delete file="${maven.jbi.esb.dir}/deploy/${jbi.assembly.name
> > }.zip"/>
> >      <ant:copy file="${basedir}/target/${jbi.assembly.name}.zip" todir="${
> > maven.jbi.esb.dir}/deploy" />
> >
> >   </goal>
> >
> >   <goal name="jbi:create-sa" description="create the service assembly">
> >         <j:set var="saname" value="${jbi.assembly.name}" />
> >         <j:set var="keysaname" value="jbi.assembly.unitname.${saname}" />
> >         <util:tokenize var="sus" delim=",">${context.getVariable
> > (keysaname)}</util:tokenize>
> >         <ant:mkdir dir="${basedir}/target/jbi_sa_${saname}" />
> >         <j:forEach var="su" items="${sus}">
> >         <log:info>generate service unit zip file for ${su}</log:info>
> >                                 <ant:zip
> > destfile="${basedir}/target/jbi_sa_${saname}/${su}.zip"
> >                                 basedir="${jbi.assembly.dir}/${
> > jbi.assembly.name}/${su}"/>
> >                         </j:forEach>
> >
> >                         <ant:zip destfile="${basedir}/target/${
> > jbi.assembly.name}.zip">
> >                                 <ant:zipfileset dir="${jbi.assembly.dir
> > }/${jbi.assembly.name}/META-INF" prefix="META-INF"/>
> >                 <ant:zipfileset dir="${basedir}/target/jbi_sa_${saname}"
> > includes="*.zip"/>
> >                 </ant:zip>
> >   </goal>
> 
> 
> Good idea.
> Thanks for the goals definitions ...
> 
> Cheers,
> Guillaume Nodet
> 
> bye
> > Raffaele
> >
> >
> > On Thu, 2006-03-09 at 12:22 +0100, Guillaume Nodet wrote:
> > > See comments inline
> > >
> > > On 3/9/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
> > > >
> > > > I'm developing a binding component using the sericemix-common library
> > > > and taking inspiration (i.e. coping :-) )from the jsr181 component.
> > >
> > >
> > > If you have concerns with the existing component (missing features,
> > > bugs...),
> > > please raise them.
> > >
> > > It works and when I generate the wsdl for my deployed service I obtain a
> > > > jbi binding:
> > > >
> > > >   <wsdl:binding name="VinciServiceJBIBinding"
> > > > type="tns:VinciServicePortType">
> > > >     <wsdlsoap:binding style="document"
> > > > transport="http://java.sun.com/xml/ns/jbi/binding/service+engine"/>
> > > >     <wsdl:operation name="vinciOperation">
> > > >       <wsdlsoap:operation soapAction=""/>
> > > >       <wsdl:input name="vinciOperationRequest">
> > > >         <wsdlsoap:body use="literal"/>
> > > >       </wsdl:input>
> > > >       <wsdl:output name="vinciOperationResponse">
> > > >         <wsdlsoap:body use="literal"/>
> > > >       </wsdl:output>
> > > >     </wsdl:operation>
> > > >   </wsdl:binding>
> > > >   <wsdl:service name="VinciService">
> > > >     <wsdl:port binding="tns:VinciServiceJBIBinding"
> > > > name="VinciServiceJBIPort">
> > > >       <wsdlsoap:address
> > > > location="jbi://{http://vinci.test.iif.imolinfo.it}VinciService"/>
> > > >     </wsdl:port>
> > > >
> > > > For what I understand (and is not much yet) of the jbi specification
> > > > this is ok and means that my component is listening on the NMR message
> > > > bus. Now I want to expose my service to external clients via SOAP
> > > > binding (lets say SOAP over HTTP).
> > > > I think this should be possible just configuring a SOAP endpoint to
> > > > route the messages it receives to my jbi endpoint. I didn't find a
> > > > standard way to do it. Is it possible and how?
> > >
> > >
> > > The servicemix-http component can do this for you.
> > > See soap-binding example in the distribution and the test cases for this
> > > component.
> > > You can deploy WSDL or simple xml describing the endpoints.
> > > I hope we can provide some "automatic" way do create
> > > a proxy endpoint on a binding component in the future.
> > >
> > > I was able to exposte my endpoint on a http trasport using the non
> > > > standard jbi component provided by service mix adding this
> > configuration
> > > > to the servicemix.xml:
> > > >
> > > > <sm:activationSpec componentName="httpReceiver"
> > > >
> > > >
> > service="foo:httpBinding"                                          endpoint="httpReceiver"
> > > > destinationService="im:VinciService">
> > > >   <sm:component>
> > > >     <bean class="org.apache.servicemix.components.http.HttpConnector">
> > > >        <property name="host" value="localhost"/>
> > > >        <property name="port" value="8912"/>
> > > >     </bean>
> > > >   </sm:component>
> > > > </sm:activationSpec>
> > > >
> > > > The problem is that this work only if I send to this endpoint just the
> > > > content of the SOAP body i.e. I must delete the Envelope and the Body
> > > > from the message. Probably this is what the jbi bindig requires.
> > >
> > >
> > > If you use the servicemix-http component, you will be able to configure
> > > if you want to use soap or not.
> > > Else you may want to try the HttpSoapConnector instead.
> > > Note that there is no reason why the soap enveloppe should be sent
> > > inside the NMR.  Soap is a protocol and should be handled by the binding
> > > component, not the service engine.  The HttpConnector does not care
> > about
> > > soap
> > > and so will send the whole content of the message in the http request
> > (and
> > > same thing
> > > the other way), whereas the HttpSoapConnector will add/remove the soap
> > > enveloppe.
> > >
> > > Cheers,
> > > Guillaume Nodet
> > >
> > > thank in advance
> > > > Raffaele
> > > >
> > > >
> > > >
> >
> >


Re: exposing a jbi endpoint as a SOAP endpoint

Posted by Guillaume Nodet <gn...@gmail.com>.
On 3/13/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
>
> I did as you said and it worked, thanks.
> There are still a couple of issue that I'd like to understand:
> 1. the SOAP-Http proxy service doesn't provide a wsdl. Do you think that
> could be possible to take the wsdl of the proxied service strip the jbi
> binding and put a SOAP-http binding?


Done. You should give it a try.  It does not currenly generate the binding
informations,
only the http or soap address for the endpoint.

2. I configured the routing using the xbean file:
> <http:endpoint service="im:VinciService"
>                            endpoint="imhttp:VinciService"
>                role="consumer"
>                locationURI="http://localhost:8192/Service/VinciService"
>                defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>                soap="true" />
> I'd like to do the same using the standard connection definitions of the
> jbi deployment descriptor of the service assembly. Does it make sense
> and is it supported in serivicemix?


Connections are now fully supported, but I'm not really sure how you  could
use them.
They have been rewritten last week.

A connection defines that when a component will send a message to the
consumer
endpoint (or interface), it will be routed to the given provider endpoint.
The main goal
is to be able to define service units that are independant of the provider
endpoints.
These endpoints are thus defined in the service assembly with connections.


<connection>
>   <consumer endpoint-name="im:VinciServiceHttpPort"
> service-name="im:VinciService">
>   </consumer>
> <provider endpoint-name="im:VinciServiceJBIPort"
> service-name="im:VinciService">
>   </provider>
> </connection>
>
> If I try to do it servicemix complains that it can't find the cosumer
> service (the proxy), I believe it does is because the proxy service
> doesn't register a wsdl, so back to the previous point.
>
> About the service-common library I found it useful but not much
> documented, it took me a couple of days of code reading to understand
> what it could do for me.


Yeah, i know.  I will try to put write some doc in the following weeks.

Last thing I suggest to add to the maven-servicemix-plugin a couple of goal
> to help the deploy of install zip and service assemblies.
> supposing to have a directory structure that mirrors the service assembly,
> I did the following scripts that could be a start:
>
>   <goal name="jbi:install" prereqs="jbi:jbi" description="install
> installer in deploy directory of esb">
>
>      <ant:echo>installing installer</ant:echo>
>      <ant:delete file="${maven.jbi.esb.dir}/install/${maven.jbi.final.name
> }"/>
>      <ant:copy file="${maven.build.dir}/${maven.jbi.final.name}" todir="${
> maven.jbi.esb.dir}/install" />
>
>   </goal>
>
>   <goal name="jbi:deploy"
>         prereqs="jbi:create-sa"
>         description="deploy the serice assembies">
>
>      <ant:echo>deploying sa</ant:echo>
>      <ant:delete file="${maven.jbi.esb.dir}/deploy/${jbi.assembly.name
> }.zip"/>
>      <ant:copy file="${basedir}/target/${jbi.assembly.name}.zip" todir="${
> maven.jbi.esb.dir}/deploy" />
>
>   </goal>
>
>   <goal name="jbi:create-sa" description="create the service assembly">
>         <j:set var="saname" value="${jbi.assembly.name}" />
>         <j:set var="keysaname" value="jbi.assembly.unitname.${saname}" />
>         <util:tokenize var="sus" delim=",">${context.getVariable
> (keysaname)}</util:tokenize>
>         <ant:mkdir dir="${basedir}/target/jbi_sa_${saname}" />
>         <j:forEach var="su" items="${sus}">
>         <log:info>generate service unit zip file for ${su}</log:info>
>                                 <ant:zip
> destfile="${basedir}/target/jbi_sa_${saname}/${su}.zip"
>                                 basedir="${jbi.assembly.dir}/${
> jbi.assembly.name}/${su}"/>
>                         </j:forEach>
>
>                         <ant:zip destfile="${basedir}/target/${
> jbi.assembly.name}.zip">
>                                 <ant:zipfileset dir="${jbi.assembly.dir
> }/${jbi.assembly.name}/META-INF" prefix="META-INF"/>
>                 <ant:zipfileset dir="${basedir}/target/jbi_sa_${saname}"
> includes="*.zip"/>
>                 </ant:zip>
>   </goal>


Good idea.
Thanks for the goals definitions ...

Cheers,
Guillaume Nodet

bye
> Raffaele
>
>
> On Thu, 2006-03-09 at 12:22 +0100, Guillaume Nodet wrote:
> > See comments inline
> >
> > On 3/9/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
> > >
> > > I'm developing a binding component using the sericemix-common library
> > > and taking inspiration (i.e. coping :-) )from the jsr181 component.
> >
> >
> > If you have concerns with the existing component (missing features,
> > bugs...),
> > please raise them.
> >
> > It works and when I generate the wsdl for my deployed service I obtain a
> > > jbi binding:
> > >
> > >   <wsdl:binding name="VinciServiceJBIBinding"
> > > type="tns:VinciServicePortType">
> > >     <wsdlsoap:binding style="document"
> > > transport="http://java.sun.com/xml/ns/jbi/binding/service+engine"/>
> > >     <wsdl:operation name="vinciOperation">
> > >       <wsdlsoap:operation soapAction=""/>
> > >       <wsdl:input name="vinciOperationRequest">
> > >         <wsdlsoap:body use="literal"/>
> > >       </wsdl:input>
> > >       <wsdl:output name="vinciOperationResponse">
> > >         <wsdlsoap:body use="literal"/>
> > >       </wsdl:output>
> > >     </wsdl:operation>
> > >   </wsdl:binding>
> > >   <wsdl:service name="VinciService">
> > >     <wsdl:port binding="tns:VinciServiceJBIBinding"
> > > name="VinciServiceJBIPort">
> > >       <wsdlsoap:address
> > > location="jbi://{http://vinci.test.iif.imolinfo.it}VinciService"/>
> > >     </wsdl:port>
> > >
> > > For what I understand (and is not much yet) of the jbi specification
> > > this is ok and means that my component is listening on the NMR message
> > > bus. Now I want to expose my service to external clients via SOAP
> > > binding (lets say SOAP over HTTP).
> > > I think this should be possible just configuring a SOAP endpoint to
> > > route the messages it receives to my jbi endpoint. I didn't find a
> > > standard way to do it. Is it possible and how?
> >
> >
> > The servicemix-http component can do this for you.
> > See soap-binding example in the distribution and the test cases for this
> > component.
> > You can deploy WSDL or simple xml describing the endpoints.
> > I hope we can provide some "automatic" way do create
> > a proxy endpoint on a binding component in the future.
> >
> > I was able to exposte my endpoint on a http trasport using the non
> > > standard jbi component provided by service mix adding this
> configuration
> > > to the servicemix.xml:
> > >
> > > <sm:activationSpec componentName="httpReceiver"
> > >
> > >
> service="foo:httpBinding"                                          endpoint="httpReceiver"
> > > destinationService="im:VinciService">
> > >   <sm:component>
> > >     <bean class="org.apache.servicemix.components.http.HttpConnector">
> > >        <property name="host" value="localhost"/>
> > >        <property name="port" value="8912"/>
> > >     </bean>
> > >   </sm:component>
> > > </sm:activationSpec>
> > >
> > > The problem is that this work only if I send to this endpoint just the
> > > content of the SOAP body i.e. I must delete the Envelope and the Body
> > > from the message. Probably this is what the jbi bindig requires.
> >
> >
> > If you use the servicemix-http component, you will be able to configure
> > if you want to use soap or not.
> > Else you may want to try the HttpSoapConnector instead.
> > Note that there is no reason why the soap enveloppe should be sent
> > inside the NMR.  Soap is a protocol and should be handled by the binding
> > component, not the service engine.  The HttpConnector does not care
> about
> > soap
> > and so will send the whole content of the message in the http request
> (and
> > same thing
> > the other way), whereas the HttpSoapConnector will add/remove the soap
> > enveloppe.
> >
> > Cheers,
> > Guillaume Nodet
> >
> > thank in advance
> > > Raffaele
> > >
> > >
> > >
>
>

Re: exposing a jbi endpoint as a SOAP endpoint

Posted by Raffaele Spazzoli <rs...@imolinfo.it>.
I did as you said and it worked, thanks.
There are still a couple of issue that I'd like to understand:
1. the SOAP-Http proxy service doesn't provide a wsdl. Do you think that
could be possible to take the wsdl of the proxied service strip the jbi
binding and put a SOAP-http binding?
2. I configured the routing using the xbean file:
<http:endpoint service="im:VinciService"
			   endpoint="imhttp:VinciService"
               role="consumer" 
               locationURI="http://localhost:8192/Service/VinciService"
               defaultMep="http://www.w3.org/2004/08/wsdl/in-out" 
               soap="true" />
I'd like to do the same using the standard connection definitions of the
jbi deployment descriptor of the service assembly. Does it make sense
and is it supported in serivicemix?
<connection>
  <consumer endpoint-name="im:VinciServiceHttpPort"
service-name="im:VinciService">	
  </consumer>     	
 <provider endpoint-name="im:VinciServiceJBIPort"
service-name="im:VinciService">	
  </provider>   
</connection>

 If I try to do it servicemix complains that it can't find the cosumer
service (the proxy), I believe it does is because the proxy service
doesn't register a wsdl, so back to the previous point.

About the service-common library I found it useful but not much
documented, it took me a couple of days of code reading to understand
what it could do for me. 

Last thing I suggest to add to the maven-servicemix-plugin a couple of goal to help the deploy of install zip and service assemblies.
supposing to have a directory structure that mirrors the service assembly, I did the following scripts that could be a start:

  <goal name="jbi:install" prereqs="jbi:jbi" description="install installer in deploy directory of esb">
     
     <ant:echo>installing installer</ant:echo>
     <ant:delete file="${maven.jbi.esb.dir}/install/${maven.jbi.final.name}"/>
     <ant:copy file="${maven.build.dir}/${maven.jbi.final.name}" todir="${maven.jbi.esb.dir}/install" />  
          
  </goal>
  
  <goal name="jbi:deploy"
        prereqs="jbi:create-sa"
        description="deploy the serice assembies">
     
     <ant:echo>deploying sa</ant:echo>
     <ant:delete file="${maven.jbi.esb.dir}/deploy/${jbi.assembly.name}.zip"/>
     <ant:copy file="${basedir}/target/${jbi.assembly.name}.zip" todir="${maven.jbi.esb.dir}/deploy" />  
  
  </goal>  
  
  <goal name="jbi:create-sa" description="create the service assembly">
    	<j:set var="saname" value="${jbi.assembly.name}" />
    	<j:set var="keysaname" value="jbi.assembly.unitname.${saname}" />  
    	<util:tokenize var="sus" delim=",">${context.getVariable(keysaname)}</util:tokenize>
    	<ant:mkdir dir="${basedir}/target/jbi_sa_${saname}" />
    	<j:forEach var="su" items="${sus}">
      	<log:info>generate service unit zip file for ${su}</log:info> 
				<ant:zip destfile="${basedir}/target/jbi_sa_${saname}/${su}.zip" 
				basedir="${jbi.assembly.dir}/${jbi.assembly.name}/${su}"/>
			</j:forEach>
	
			<ant:zip destfile="${basedir}/target/${jbi.assembly.name}.zip"> 
				<ant:zipfileset dir="${jbi.assembly.dir}/${jbi.assembly.name}/META-INF" prefix="META-INF"/>
    		<ant:zipfileset dir="${basedir}/target/jbi_sa_${saname}" includes="*.zip"/>	
  		</ant:zip>	            
  </goal>

bye
Raffaele


On Thu, 2006-03-09 at 12:22 +0100, Guillaume Nodet wrote:
> See comments inline
> 
> On 3/9/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
> >
> > I'm developing a binding component using the sericemix-common library
> > and taking inspiration (i.e. coping :-) )from the jsr181 component.
> 
> 
> If you have concerns with the existing component (missing features,
> bugs...),
> please raise them.
> 
> It works and when I generate the wsdl for my deployed service I obtain a
> > jbi binding:
> >
> >   <wsdl:binding name="VinciServiceJBIBinding"
> > type="tns:VinciServicePortType">
> >     <wsdlsoap:binding style="document"
> > transport="http://java.sun.com/xml/ns/jbi/binding/service+engine"/>
> >     <wsdl:operation name="vinciOperation">
> >       <wsdlsoap:operation soapAction=""/>
> >       <wsdl:input name="vinciOperationRequest">
> >         <wsdlsoap:body use="literal"/>
> >       </wsdl:input>
> >       <wsdl:output name="vinciOperationResponse">
> >         <wsdlsoap:body use="literal"/>
> >       </wsdl:output>
> >     </wsdl:operation>
> >   </wsdl:binding>
> >   <wsdl:service name="VinciService">
> >     <wsdl:port binding="tns:VinciServiceJBIBinding"
> > name="VinciServiceJBIPort">
> >       <wsdlsoap:address
> > location="jbi://{http://vinci.test.iif.imolinfo.it}VinciService"/>
> >     </wsdl:port>
> >
> > For what I understand (and is not much yet) of the jbi specification
> > this is ok and means that my component is listening on the NMR message
> > bus. Now I want to expose my service to external clients via SOAP
> > binding (lets say SOAP over HTTP).
> > I think this should be possible just configuring a SOAP endpoint to
> > route the messages it receives to my jbi endpoint. I didn't find a
> > standard way to do it. Is it possible and how?
> 
> 
> The servicemix-http component can do this for you.
> See soap-binding example in the distribution and the test cases for this
> component.
> You can deploy WSDL or simple xml describing the endpoints.
> I hope we can provide some "automatic" way do create
> a proxy endpoint on a binding component in the future.
> 
> I was able to exposte my endpoint on a http trasport using the non
> > standard jbi component provided by service mix adding this configuration
> > to the servicemix.xml:
> >
> > <sm:activationSpec componentName="httpReceiver"
> >
> > service="foo:httpBinding"                                          endpoint="httpReceiver"
> > destinationService="im:VinciService">
> >   <sm:component>
> >     <bean class="org.apache.servicemix.components.http.HttpConnector">
> >        <property name="host" value="localhost"/>
> >        <property name="port" value="8912"/>
> >     </bean>
> >   </sm:component>
> > </sm:activationSpec>
> >
> > The problem is that this work only if I send to this endpoint just the
> > content of the SOAP body i.e. I must delete the Envelope and the Body
> > from the message. Probably this is what the jbi bindig requires.
> 
> 
> If you use the servicemix-http component, you will be able to configure
> if you want to use soap or not.
> Else you may want to try the HttpSoapConnector instead.
> Note that there is no reason why the soap enveloppe should be sent
> inside the NMR.  Soap is a protocol and should be handled by the binding
> component, not the service engine.  The HttpConnector does not care about
> soap
> and so will send the whole content of the message in the http request (and
> same thing
> the other way), whereas the HttpSoapConnector will add/remove the soap
> enveloppe.
> 
> Cheers,
> Guillaume Nodet
> 
> thank in advance
> > Raffaele
> >
> >
> >


Re: exposing a jbi endpoint as a SOAP endpoint

Posted by Guillaume Nodet <gn...@gmail.com>.
See comments inline

On 3/9/06, Raffaele Spazzoli <rs...@imolinfo.it> wrote:
>
> I'm developing a binding component using the sericemix-common library
> and taking inspiration (i.e. coping :-) )from the jsr181 component.


If you have concerns with the existing component (missing features,
bugs...),
please raise them.

It works and when I generate the wsdl for my deployed service I obtain a
> jbi binding:
>
>   <wsdl:binding name="VinciServiceJBIBinding"
> type="tns:VinciServicePortType">
>     <wsdlsoap:binding style="document"
> transport="http://java.sun.com/xml/ns/jbi/binding/service+engine"/>
>     <wsdl:operation name="vinciOperation">
>       <wsdlsoap:operation soapAction=""/>
>       <wsdl:input name="vinciOperationRequest">
>         <wsdlsoap:body use="literal"/>
>       </wsdl:input>
>       <wsdl:output name="vinciOperationResponse">
>         <wsdlsoap:body use="literal"/>
>       </wsdl:output>
>     </wsdl:operation>
>   </wsdl:binding>
>   <wsdl:service name="VinciService">
>     <wsdl:port binding="tns:VinciServiceJBIBinding"
> name="VinciServiceJBIPort">
>       <wsdlsoap:address
> location="jbi://{http://vinci.test.iif.imolinfo.it}VinciService"/>
>     </wsdl:port>
>
> For what I understand (and is not much yet) of the jbi specification
> this is ok and means that my component is listening on the NMR message
> bus. Now I want to expose my service to external clients via SOAP
> binding (lets say SOAP over HTTP).
> I think this should be possible just configuring a SOAP endpoint to
> route the messages it receives to my jbi endpoint. I didn't find a
> standard way to do it. Is it possible and how?


The servicemix-http component can do this for you.
See soap-binding example in the distribution and the test cases for this
component.
You can deploy WSDL or simple xml describing the endpoints.
I hope we can provide some "automatic" way do create
a proxy endpoint on a binding component in the future.

I was able to exposte my endpoint on a http trasport using the non
> standard jbi component provided by service mix adding this configuration
> to the servicemix.xml:
>
> <sm:activationSpec componentName="httpReceiver"
>
> service="foo:httpBinding"                                          endpoint="httpReceiver"
> destinationService="im:VinciService">
>   <sm:component>
>     <bean class="org.apache.servicemix.components.http.HttpConnector">
>        <property name="host" value="localhost"/>
>        <property name="port" value="8912"/>
>     </bean>
>   </sm:component>
> </sm:activationSpec>
>
> The problem is that this work only if I send to this endpoint just the
> content of the SOAP body i.e. I must delete the Envelope and the Body
> from the message. Probably this is what the jbi bindig requires.


If you use the servicemix-http component, you will be able to configure
if you want to use soap or not.
Else you may want to try the HttpSoapConnector instead.
Note that there is no reason why the soap enveloppe should be sent
inside the NMR.  Soap is a protocol and should be handled by the binding
component, not the service engine.  The HttpConnector does not care about
soap
and so will send the whole content of the message in the http request (and
same thing
the other way), whereas the HttpSoapConnector will add/remove the soap
enveloppe.

Cheers,
Guillaume Nodet

thank in advance
> Raffaele
>
>
>