Re: Which BC should i use in order to simulate a proxy between2machines?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Which BC should i use in order to simulate a proxy between2machines?

Jean-Baptiste Onofré
Hi Liav,

no problem for your question, the mailing list is here to help you :))

Concerning the POM, yes you can defined as you want.

For exemple, for your needs, an example follows :

1/ The SU POM.xml

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>mygroup</groupId>
  <artifactId>myartifact</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jbi-service-unit</packaging>
 
  <dependencies>
    <dependency>
       <groupId>org.apache.servicemix</groupId>
       <artifactId>servicemix-http</artifactId>
       <version>2008.01</version>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <directory>src/main/resources</directory>
      <includes>
        <include>**/*</include>
      </includes>
    </resources>
    <plugins>
      <plugin>
         <groupId>org.apache.servicemix.tooling</groupId>
         <artifactId>jbi-maven-plugin</artifactId>
         <version>4.0</version>
         <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>

</project>

2/ Now that we have the HTTP JBI BC Component in dependencies, we can use it in
the xbean.xml (located in resources) :

<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:my="http://www.example.com/my">

  <http:endpoint service="my:http-producer"
                 endpoint="myHttp"
                 role="provider"
                 locationURI="http://localhost:8192/remoteService/"
                 wsdlResource="classpath:provider.wsdl"/>


</beans>

I hope to have right understood that you want :)

Regards
JB
--
Jean-Baptiste Onofré
[hidden email]
BuildProcess/AutoDeploy Project Leader
http://buildprocess.sourceforge.net

On Sun 21/12/08 15:16, Liav Ezer [hidden email] wrote:
>
> Hi Jean,
>
> Thanks for you quick reply & excuse my ESB ignorance as i'm new to
> it...
> I'm back to the first pom.xml file (which resides in the root dir'):
>
> As i understand it, this file suppose to create my first SU & enrich
> my
local repository with missing plugins.
>
> Can i specify my own groupId & artifactId & run "mvn install":
>
> For example:
>
> <?xml version="1.0" encoding="utf-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
> <groupId>org.apache.servicemix.liav</groupId>
> <artifactId>liav</artifactId>
> <version>1.0-SNAPSHOT</version>
> <packaging>pom</packaging>
> <name>Tutorial</name>
> <url>http://servicemix.org</url>
</project>

>
> Then run the following maven command accordingly:
>
> mvn archetype:create -DarchetypeArtifactId=servicemix-service-unit
> -DarchetypeGroupId=org.apache.servicemix.liav
> -DartifactId=tutorial-file-su
> Thanks.
>
>
>
>
> Jean-Baptiste Onofré wrote:
> >
> > Hi Liav,
> >
> > there is no special groupId or artifactId to define
> on your SU pom.xml.
>
> > You can configure a http component based SU in
> producer mode.
>
> > A provider endpoint is a client-side jbi endpoint
> which can receive
> requests from
> > the NMR and send them to a given url where the
> service is provided.
>
> > You can setup a http producer like this
> :
>
> > <http:endpoint
> service="test:MyProviderService"
>                endpoint="myProvider"
> >                role="provider"
> >                locationURI="http://localhost:8192/Service/"
>>              
> wsdlResource="classpath:provider.wsdl" />
>
> > where locationURI is the service on the remote
> machine.
>
> > Regards
> > JB
> > --
> > Jean-Baptiste Onofré
> > [hidden email]
> et
> BuildProcess/AutoDeploy Project Leader
> > http://buildprocess.sourceforge.net
>>
> > On Sun 21/12/08 09:01, Liav Ezer liav.ezer
> @gmail.com wrote:
>>
> >> Hi,
> >>
> >> My aim is to consume a web service from machine
> A via an ESB installed
>> on
> > machine B.
> >>
> >> The web service is known only to machine B (He
> has the wsdl file). I, as
>> a
> > user from machine C want to consume this web service
> by asking it from
>> the
> > ESB.
> >>
> >> The ESB is acting as a relaying proxy between me
> (the client) & machine A
>> by
> > exposing a new wsdl which is the same as the
> original one beside the
>> <wsdlsoap:address location=...>
> attribute.
>>
> >> 1. When writing the root pom.xml file - which
> groupId & artifactId should
>> i
> > use ?
> >>
> >> 2. Which BC should i use in order to use
> serviceMix relay
>> functionality?
> >> Thanks.
> >> --
> >> View this message in context:
> > http://www.nabble.com/Which-BC-should-i-use-in-order-to-simulat
>
>>>
> e-a-proxy-between-2-machines--tp21112886p21112886.html
> Sent from the ServiceMix - User mailing list archive
> at Nabble.com.
>>
> >>
> >>
> >>
> >
> >
> >
> >
>
> --
> View this message in context:
http://www.nabble.com/Re%3A-Which-BC-should-i-use-in-order-to-s
> imulate-a-proxy-between-2machines--tp21113826p21115411.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Which BC should i use in order to simulate a proxy between2machines?

Liav Ezer
Hi Jean,

So far i did the following (in order to simulate a proxy via the http BC):

created 2 servicemix-http components, 1 for the provider & 1 for the consumer.

This is the provider xbean:

<beans xmlns:http="http://servicemix.apache.org/http/1.0" xmlns:my="http://www.example.com/my"> 
  <http:endpoint service="my:ForecastWeatherImpService"
                 endpoint="ForecastWeatherImp"
                 role="provider"
                 locationURI="http://localhost:8080/remoteService/" 
                 wsdlResource="classpath:ForecastWeatherImp.wsdl"/> 
</beans> 

This is the consumer xbean:

<beans xmlns:http="http://servicemix.apache.org/http/1.0" xmlns:my="http://www.example.com/my"> 
  <http:endpoint service="my:MyConsumerService"
                 endpoint="myConsumer"
                 role="consumer"
                 locationURI="http://localhost:8080/Service/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"/>
</beans> 

& generated a SA with those two SU's as its dependencies.

2 questions please:
1. Under my local tomcat installation folder i located two directories - remoteService & Service. The wsdl to my remote service is located in the remoteService direcftory. Should it be there?

2. I get the following error once running "mvn install" in the root directory (in the final step before deployment):

/PROXY/proxy-consumer-su/src/main/resources/xbean.xml]
[WARNING] Failed to generate jbi.xml: org.apache.servicemix.maven.plugin.jbi.JbiPluginException: Unable to generate service unit descriptor!org.apache.servicemix.maven.plugin.jbi.JbiPluginException: Unable to generate service unit descriptor!

It seems as if i defined something wrong in the consumer xbean file.

Please advice.

Thanks in advance.
Liav.

Jean-Baptiste Onofré wrote
Hi Liav,

no problem for your question, the mailing list is here to help you :))

Concerning the POM, yes you can defined as you want.

For exemple, for your needs, an example follows :

1/ The SU POM.xml

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>mygroup</groupId>
  <artifactId>myartifact</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jbi-service-unit</packaging>
 
  <dependencies>
    <dependency>
       <groupId>org.apache.servicemix</groupId>
       <artifactId>servicemix-http</artifactId>
       <version>2008.01</version>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <directory>src/main/resources</directory>
      <includes>
        <include>**/*</include>
      </includes>
    </resources>
    <plugins>
      <plugin>
         <groupId>org.apache.servicemix.tooling</groupId>
         <artifactId>jbi-maven-plugin</artifactId>
         <version>4.0</version>
         <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>

</project>

2/ Now that we have the HTTP JBI BC Component in dependencies, we can use it in
the xbean.xml (located in resources) :

<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:my="http://www.example.com/my">

  <http:endpoint service="my:http-producer"
                 endpoint="myHttp"
                 role="provider"
                 locationURI="http://localhost:8192/remoteService/"
                 wsdlResource="classpath:provider.wsdl"/>


</beans>

I hope to have right understood that you want :)

Regards
JB
--
Jean-Baptiste Onofré
jb@nanthrax.net
BuildProcess/AutoDeploy Project Leader
http://buildprocess.sourceforge.net

On Sun 21/12/08 15:16, Liav Ezer liav.ezer@gmail.com wrote:
>
> Hi Jean,
>
> Thanks for you quick reply & excuse my ESB ignorance as i'm new to
> it...
> I'm back to the first pom.xml file (which resides in the root dir'):
>
> As i understand it, this file suppose to create my first SU & enrich
> my
local repository with missing plugins.
>
> Can i specify my own groupId & artifactId & run "mvn install":
>
> For example:
>
> <?xml version="1.0" encoding="utf-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
> <groupId>org.apache.servicemix.liav</groupId>
> <artifactId>liav</artifactId>
> <version>1.0-SNAPSHOT</version>
> <packaging>pom</packaging>
> <name>Tutorial</name>
> <url>http://servicemix.org</url>
</project>
>
> Then run the following maven command accordingly:
>
> mvn archetype:create -DarchetypeArtifactId=servicemix-service-unit
> -DarchetypeGroupId=org.apache.servicemix.liav
> -DartifactId=tutorial-file-su
> Thanks.
>
>
>
>
> Jean-Baptiste Onofré wrote:
> >
> > Hi Liav,
> >
> > there is no special groupId or artifactId to define
> on your SU pom.xml.
>
> > You can configure a http component based SU in
> producer mode.
>
> > A provider endpoint is a client-side jbi endpoint
> which can receive
> requests from
> > the NMR and send them to a given url where the
> service is provided.
>
> > You can setup a http producer like this
> :
>
> > <http:endpoint
> service="test:MyProviderService"
>                endpoint="myProvider"
> >                role="provider"
> >                locationURI="http://localhost:8192/Service/"
>>              
> wsdlResource="classpath:provider.wsdl" />
>
> > where locationURI is the service on the remote
> machine.
>
> > Regards
> > JB
> > --
> > Jean-Baptiste Onofré
> > jb@nanthrax.n
> et
> BuildProcess/AutoDeploy Project Leader
> > http://buildprocess.sourceforge.net
>>
> > On Sun 21/12/08 09:01, Liav Ezer liav.ezer
> @gmail.com wrote:
>>
> >> Hi,
> >>
> >> My aim is to consume a web service from machine
> A via an ESB installed
>> on
> > machine B.
> >>
> >> The web service is known only to machine B (He
> has the wsdl file). I, as
>> a
> > user from machine C want to consume this web service
> by asking it from
>> the
> > ESB.
> >>
> >> The ESB is acting as a relaying proxy between me
> (the client) & machine A
>> by
> > exposing a new wsdl which is the same as the
> original one beside the
>> <wsdlsoap:address location=...>
> attribute.
>>
> >> 1. When writing the root pom.xml file - which
> groupId & artifactId should
>> i
> > use ?
> >>
> >> 2. Which BC should i use in order to use
> serviceMix relay
>> functionality?
> >> Thanks.
> >> --
> >> View this message in context:
> > http://www.nabble.com/Which-BC-should-i-use-in-order-to-simulat
>
>>>
> e-a-proxy-between-2-machines--tp21112886p21112886.html
> Sent from the ServiceMix - User mailing list archive
> at Nabble.com.
>>
> >>
> >>
> >>
> >
> >
> >
> >
>
> --
> View this message in context:
http://www.nabble.com/Re%3A-Which-BC-should-i-use-in-order-to-s
> imulate-a-proxy-between-2machines--tp21113826p21115411.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>
>
>