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?