Hi,

It is possible very easily by setting the second WSDL Service Host/Port to
be localhost:xxxx and then creating and launching it in Servicemix. The
invocation from the first service would be a local invcation albeit not
using the NMR directly.

However doing this purely using the NMR is more involved and may involve an
intermediate component such as Routing Slip between the first CXF-BC and
CXF-SE to direct the payload of the first CXF-SE to the second JBI
Service/Endpoint such as an SMX-Bean.

                                          |--> CXF-SE
        CXF-BC --> Routing Slip -|        |
                                          |        v
                                          |<-- SMX-Bean (behaving as Impl
for Second Service)

The reason I chose SMX-Bean is that dynamic Invocation from within the
CXF-SE  directly without using the Routing Slip as a conduit is convoluted
and bad practise since the CXF_SE then is neither pure JBI nor a pure
JAX-WS.

In Servicemix 4.0 OSGi version there is direct access offered to the NMR and
an example of how to do so is available there. This NMR local invocation is
possible due to the Service being available as an Object that may be
registered in the OSGi registry and refered to by other services. This is
not possible in SMX 3.x

Hope this helps.

Cheers,

Ashwin...

    

melu wrote:
> 
> Hi,
> 
> Does it mean that all components have to be directly exposed to the world?
> Is it not possible to do such scenario: have one service and SU and BC and
> second service and... only SU and one want to that one service will
> communicate to these second service but second service is not exposed
> through the world and all communication between them is through NMR.
> 
> Thanks
> 
> 
> 
> Ashwin Karpe wrote:
>> 
>> Hi,
>> 
>> Yes, you need a second CXF-BC and CXF-SU for the second service. As for
>> invoking the second service, you need to add a proxy CXF-BC producer that
>> can be invoked from the first service to invoke the second service. Ther
>> should be junit test examples for the CXF component if you do a source
>> download.
>> 
>> Cheers,
>> 
>> Ashwin...
>> 
>> 
>> larjohn wrote:
>>> 
>>> Thanks, It seems good to me. My problem now is the URI's for the
>>> endpoints.
>>> Suppose I have a cxf-bc SU with the following xbean:
>>> 
>>> 
>>> <beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0";
>>>        xmlns:person="http://servicemix.apache.org/samples/wsdl-first";>
>>> 
>>>   <cxfbc:consumer endpoint="consumer" wsdl="classpath:person.wsdl"
>>>                       targetService="person:PersonService"
>>>                       targetInterface="person:Person"/>
>>> 
>>> </beans>
>>> 
>>> 
>>> Then I also have the example's cxf-se SU, with the xbean:
>>> <?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:cxfse="http://servicemix.apache.org/cxfse/1.0";>
>>> 
>>>     <cxfse:endpoint>
>>>         <cxfse:pojo>
>>>           <bean
>>> class="org.apache.servicemix.samples.wsdl_first.PersonImpl" />
>>>         </cxfse:pojo>
>>>     </cxfse:endpoint>
>>> 
>>> </beans>
>>> 
>>> 
>>> As you can see, they are directly taken from the wsdl-cxf example. The
>>> java and wsdl's are also included as they are in the example. 
>>> Now, I need to create another cxf-se to warp a pojo (is that a right
>>> approach?). The first cxf-se should request the second's service, so
>>> that it can return a specific response. That is where I get stuck! 
>>>  - Do I need another cxf-bc for the second cxf-se? 
>>>  - If I use Camel what endpoints should I enter in the from and the to
>>> strings? 
>>>  - Will the response return to the first cxf-se and when? Will it block?
>>> 
>>> 
>>> Ashwin Karpe wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I guess what you are looking for is described on the following Camel
>>>> link
>>>> 
>>>>  http://camel.apache.org/pipes-and-filters.html
>>>> http://camel.apache.org/pipes-and-filters.html 
>>>> 
>>>> Check this out. There is no need to write component code. You can use
>>>> the DSL described in the link
>>>> 
>>>> Hope this helps.
>>>> 
>>>> Cheers,
>>>> 
>>>> Ashwin...
>>>> 
>>> 
>> 
>> 
> 
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: 
http://www.nabble.com/Component-to-component-messaging-in-a-simple-way-tp21549001p21669141.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to