Hi,
Actually, I do test it. Just check in the test to show how it works.
Basically, it's cxf bc provider and cxf bc consumer work together playing the role as bridge to connect the external client and external service

You can refer [1] and [2] to get more details

[1] https://svn.apache.org/repos/asf/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderConsumerTest.java [2] https://svn.apache.org/repos/asf/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/cxf_provider_consumer_bridge.xml

Other comments inline

Best Regards

Freeman
depstei2 wrote:
I tried something similar and I keep getting com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
  at [row,col {unknown-source}]: [1,0]
 and
javax.jbi.messaging.MessagingException: Out not supported

Also, in your example, the consumer wsdl is the same as your provider wsdl,
so where do you set the location for your service? Did the stockquote proxy

You can specify locationURI for cxf bc provider, which will overwrite the one defined in the wsdl. For cxf bc consumer, we just parse the service location from the wsdl, so if you want to change the location, just save the wsdl to your local site and modify it.


you posted work for you?
Thanks,
Daniel


Freeman Fang-2 wrote:
Try

<beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0";
       xmlns:ns1="http://swanandmokashi.com";>
<cxfbc:consumer wsdl="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL";
                      targetEndpoint="StockQuotesSoap"
                      targetService="ns1:StockQuotes"
                      targetInterface="ns1:StockQuotesSoap"
                      >
      </cxfbc:consumer>

<cxfbc:provider wsdl="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL""; locationURI="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx";
                      service="ns1:StockQuotes"
                         endpoint="StockQuotesSoap"
                   interfaceName="ns1:StockQuotesSoap"
                      >
      </cxfbc:provider>


</beans>


Freeman



depstei2 wrote:
I tried having just a cxfbc:cprovider and a cxfse:consumer, but I got a com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
and
javax.jbi.messaging.MessagingException: Out not supported

Here is an example of using the http bc as a proxy, notice how the
consumer
does not need a wsdl:

<beans xmlns:http="http://servicemix.apache.org/http/1.0";
       xmlns:ns1="http://swanandmokashi.com";>
    <http:endpoint service="ns1:StockQuotes"
                   endpoint="StockQuotesSoapHttpBC"
                   targetService="ns1:StockQuotes"
                   targetEndpoint="StockQuotesSoap"
                   interfaceName="ns1:StockQuotesSoap"
                   role="consumer"
                   soap="true"
locationURI="http://localhost:8192/services/StockQuotes";
                   defaultMep="http://www.w3.org/2004/08/wsdl/in-out"; />

    <http:endpoint service="ns1:StockQuotes"
                   endpoint="StockQuotesSoap"
                   interfaceName="ns1:StockQuotesSoap"
                   role="provider"
                   soap="true"
                   soapAction="http://swanandmokashi.com/GetQuotes";
                   soapVersion="1.1"
wsdlResource="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL"; locationURI="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx";
/>
</beans>



Freeman Fang wrote:
Hi,
Firstly, pojo is not compulsory here to call the proxied service, you can call from consumer endpoint as well. Btw, do you already have working example with http-bc, if possible, would you please post the configuration of your working example so that I can get your requirement more clearly and show you how to configure it with cxf bc.
Best Regards

Freeman

depstei2 wrote:
Hi, Thank you for your reply.  Is it necessary to have a pojo to call
the
proxied service?  Can I create a provider and consumer endpoint in
configuration without any java code like I could for the http-bc? If it
is
possible could you provide a short example of that?



Freeman Fang-2 wrote:
Hi,
The 3rd party service you mentioned here is outside the jbi bus?
If so, what you want  (creating a proxy using cxf)  here is cxf
binding component which play role as provider.
Yes, we support it.

You can get more details how it configured and used from a complete integration test from
[1]http://svn.apache.org/repos/asf/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java
[2]http://svn.apache.org/repos/asf/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/GreeterImplForProvider.java
[3]http://svn.apache.org/repos/asf/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider.xml
[4]http://svn.apache.org/repos/asf/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider/xbean.xml

I want explain how this test works since this test is a bit complex,
1. we start external webservice at http://localhost:9001/providertestdepstei2 in [1]
2.  we send request to pojo (defined as [2]) inside cxf se, this pojo
is configured in [4], this pojo is also injected proxy which actually is cxf bc provider configured in [3]
3. in the pojo [2], when the "greetMe" method is invoked, it invoke
the injected proxy which is cxf bc provider, and this invocation passed through the cxf bc provider to external web service

Best Regards
Freeman

wrote:
How would I go about creating a proxy using cxf?  Is this possible,
or
would
I have to still use the http binding component to expose a 3rd party
service
to the bus?

Reply via email to