You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by jweathers777 <jo...@gmail.com> on 2009/09/29 01:36:01 UTC

Sending messages via a file poller into a cxf-bc provider endpoint

I'm using ServiceMix 3.2.3 and am trying to send test messages from a file
into a web service and then ultimately (after getting past my current
hurdles) back out into another file. 

I've written the web service as a service assembly that uses a cxf-se
endpoint to provide a simple HelloWorld POJO as a web service and a cxf-bc
consumer endpoint to expose the web service to the outside world via
consuming HTTP+SOAP request.

The whole thing is essentially the product of following this tutorial:
http://servicemix.apache.org/4-beginner-web-services-with-servicemix-and-cxf.html
See this tutorial for the wsdl definition.

This part works fine for me. I've tested sending messages to it via SoapUI
as well as via a Ruby SOAP client.

I noted in the following info in the ServiceMix log file:
ServiceMix: broadcasting info for:
org.apache.servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service={http://example.com}HelloService,endpoint=HelloImplPort]]

And later when it successfully handles incoming messages from SoapUI, I see:
  interface: {http://example.com}Hello
  service: {http://example.com}HelloService
  endpoint: HelloImplPort
  operation: {http://example.com}SayHello

Then, I wrote a service assembly that has a file poller endpoint that
monitors a directory for files containing an example SOAP message that I
generated via SoapUI. The file poller is supposed to then send the message
to my web service. To that end, I've set up a cxf-bc provider endpoint that
I've configured to reference the above web service.

However, every configuration combination that I've tried has resulted in
problems.

Currently, I have the provider configured as follows:

<cxfbc:provider wsdl="http://localhost:8193/HelloService/?wsdl"
      service="hello:HelloService" 
      endpoint="HelloSOAPBinding" />

where hello="http://example.com" and the file poller is configured like
this:

<file:poller service="mock:TestMessageService"
      endpoint="FilePoller"
      targetService="hello:HelloService"
      targetEndpoint="HelloSOAPBinding"
      file="/temp/inbound" />

where mock="http://example.com/mock" and hello="http://example.com"

When I copy a file containing the following text into the folder
/temp/inbound:
<soapenv:Envelope 
   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
   xmlns:typ="http://example.com/types">
   <soapenv:Header/>
   <soapenv:Body>
      <typ:SayHello>
         <typ:name>World</typ:name>
      </typ:SayHello>
   </soapenv:Body>
</soapenv:Envelope>

I get the following error:
  status: Active
  role: provider
  service: {http://example.com}HelloService
  endpoint: HelloSOAPBinding
  in: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://example.com/types">   

<soapenv:Header/>   <soapenv:Body> <typ:SayHello>        
<typ:name>World</typ:name></typ:SayHello>  

 </soapenv:Body></soapenv:Envelope>
]17:26:22,733 | INFO  | pool-flow.seda.servicemix-cxf-bc-thread-1 |
PhaseInterceptorChain    | 

he.cxf.common.logging.LogUtils  345 | Interceptor has thrown exception,
unwinding 
noworg.apache.cxf.interceptor.Fault: Message wrapper element is 
'{http://schemas.xmlsoap.org/soap/envelope/}Envelope' but expected 
'{http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper}message'	at 
org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:97)


I also noticed:
Endpoint
ServiceEndpoint[service={http://example.com}HelloService,endpoint=HelloSOAPBinding]
has a service description, but no matching endpoint found in [soap]

when ServiceMix tries to load the cxf-bc su with the provider endpoint that
references the web service.

That suggests to me that it's not pointing at the correct endpoint, but if I
change it from HelloSOAPBinding to HelloImplPort then when I try to deploy
to ServiceMix, it fails with:
javax.jbi.JBIException: An internal endpoint for service
{http://example.com}HelloService and endpoint HelloImplPort is already
registered.

Any help on how to properly configure what I'm trying to achieve would be
appreciated.

Thanks!

-- 
View this message in context: http://www.nabble.com/Sending-messages-via-a-file-poller-into-a-cxf-bc-provider-endpoint-tp25654650p25654650.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Sending messages via a file poller into a cxf-bc provider endpoint

Posted by jweathers777 <jo...@gmail.com>.

Johan Edstrom-3 wrote:
> 
> By default, poller endpoints expect the content of the file to be in xml
> format. The filepoller can be provided a custom marshaller to
> provide binary transport as well, but yes it will deliver the XML as is,
> so
> an xslt or some sort of content enricher is what you'd need to generate
> the
> JBI message. If the file you deliver is a valid soap message, you can turn
> off the JBIWrapper in the other end, it'll then accept a soap message.
> 

But I have working example where I use a file poller to send a message to a
eip:wiretap which then sends the message to a jms provider endpoint and also
to an auditor. Wouldn't the jms provider be expecting a normalized message?
Would the wiretap expect to receive a normalized message? If so, then what
transforms it into a normalized message if not the file poller?

BTW, thanks for the assistance. It is helpful even if I haven't yet resolved
the issue.

In regards to my problem, I did set the useJBIWrapper to false in my
cxfbc:provider:

<cxfbc:provider wsdl="http://localhost:1234/HowdyWorld.svc?wsdl"
      service="howdy:HowdyWorld"
      endpoint="howdy:BasicHttpBinding_IHowdyWorld"
      locationURI="http://localhost:1234/HowdyWorld.svc"
      useJBIWrapper="false" />

And the result was:

  status: Active
  role: provider
  interface: {http://tempuri.org/}Howdy
  service: {http://tempuri.org/}HowdyWorld
  endpoint: howdy:BasicHttpBinding_IHowdyWorld
  in: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:Howdy>
         
         <tem:value>John Doe</tem:value>
      </tem:Howdy>
   </soapenv:Body>
</soapenv:Envelope>
]
10:59:08,570 | INFO  | pool-flow.seda.servicemix-cxf-bc-thread-14 |
PhaseInterceptorChain    | he.cxf.common.logging.LogUtils  345 | Interceptor
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: org.apache.xerces.dom.DeferredTextImpl
cannot be cast to org.w3c.dom.Element
	at
org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:149)
	at
org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:56)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
	at
org.apache.servicemix.cxfbc.CxfBcProvider.process(CxfBcProvider.java:245)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
	at
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
	at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
	at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
	at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
	at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException:
org.apache.xerces.dom.DeferredTextImpl cannot be cast to org.w3c.dom.Element
	at
org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:84)
	... 14 more
10:59:08,570 | ERROR | pool-flow.seda.servicemix-cxf-bc-thread-14 |
CxfBcComponent           | emix.common.AsyncBaseLifeCycle  537 | Error
processing exchange InOnly[
  id: ID:172.17.165.202-124062c87e0-6:6
  status: Active
  role: provider
  interface: {http://tempuri.org/}Howdy
  service: {http://tempuri.org/}HowdyWorld
  endpoint: howdy:BasicHttpBinding_IHowdyWorld
  in: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:Howdy>
         
         <tem:value>John Doe</tem:value>
      </tem:Howdy>
   </soapenv:Body>
</soapenv:Envelope>
]
javax.jbi.messaging.MessagingException: Fault not supported
	at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setMessage(MessageExchangeImpl.java:366)
	at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setFault(MessageExchangeImpl.java:290)
	at
org.apache.servicemix.cxfbc.CxfBcProvider.faultProcess(CxfBcProvider.java:277)
	at
org.apache.servicemix.cxfbc.CxfBcProvider.process(CxfBcProvider.java:261)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
	at
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
	at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
	at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
	at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
	at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)

-- 
View this message in context: http://www.nabble.com/Sending-messages-via-a-file-poller-into-a-cxf-bc-provider-endpoint-tp25654650p25665998.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Sending messages via a file poller into a cxf-bc provider endpoint

Posted by Johan Edstrom <jo...@opennms.org>.
By default, poller endpoints expect the content of the file to be in xml
format. The filepoller can be provided a custom marshaller to
provide binary transport as well, but yes it will deliver the XML as is, so
an xslt or some sort of content enricher is what you'd need to generate the
JBI message. If the file you deliver is a valid soap message, you can turn
off the JBIWrapper in the other end, it'll then accept a soap message.

On Tue, Sep 29, 2009 at 9:07 AM, jweathers777 <jo...@gmail.com>wrote:

>
> I'm afraid that doesn't solve the problem. To simply things, I've replaced
> my
> ServiceMix written service with a truly external web service written in
> .NET.
>
> Here's the WSDL:
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
> "
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
> xmlns:tns="http://tempuri.org/"
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
> xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
> xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> xmlns:wsa10="http://www.w3.org/2005/08/addressing"
> xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" name="HowdyWorld"
> targetNamespace="http://tempuri.org/">
>  <wsdl:types>
>    <xsd:schema targetNamespace="http://tempuri.org/Imports">
>      <xsd:import
> schemaLocation="http://localhost:1234/HowdyWorld.svc?xsd=xsd0"
> namespace="http://tempuri.org/"/>
>      <xsd:import
> schemaLocation="http://localhost:1234/HowdyWorld.svc?xsd=xsd1"
> namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
>    </xsd:schema>
>  </wsdl:types>
>  <wsdl:message name="IHowdyWorld_Howdy_InputMessage">
>    <wsdl:part name="parameters" element="tns:Howdy"/>
>  </wsdl:message>
>  <wsdl:message name="IHowdyWorld_Howdy_OutputMessage">
>    <wsdl:part name="parameters" element="tns:HowdyResponse"/>
>  </wsdl:message>
>  <wsdl:portType name="IHowdyWorld">
>    <wsdl:operation name="Howdy">
>      <wsdl:input wsaw:Action="http://tempuri.org/IHowdyWorld/Howdy"
> message="tns:IHowdyWorld_Howdy_InputMessage"/>
>      <wsdl:output
> wsaw:Action="http://tempuri.org/IHowdyWorld/HowdyResponse"
> message="tns:IHowdyWorld_Howdy_OutputMessage"/>
>    </wsdl:operation>
>  </wsdl:portType>
>  <wsdl:binding name="BasicHttpBinding_IHowdyWorld" type="tns:IHowdyWorld">
>    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
>    <wsdl:operation name="Howdy">
>      <soap:operation soapAction="http://tempuri.org/IHowdyWorld/Howdy"
> style="document"/>
>      <wsdl:input>
>        <soap:body use="literal"/>
>      </wsdl:input>
>      <wsdl:output>
>        <soap:body use="literal"/>
>      </wsdl:output>
>    </wsdl:operation>
>  </wsdl:binding>
>  <wsdl:service name="HowdyWorld">
>    <wsdl:port name="BasicHttpBinding_IHowdyWorld"
> binding="tns:BasicHttpBinding_IHowdyWorld">
>      <soap:address location="http://localhost:1234/HowdyWorld.svc"/>
>    </wsdl:port>
>  </wsdl:service>
> </wsdl:definitions>
>
> When I use a cxf-bc consumer component to consume incoming responses via
> SOAP and forward them on to a cxf-bc provider component that references
> this
> external web service, it works when I test via SoapUI.
>
> However, when I replace the cxf-bc consumer with a file poller and send
> messages in via copying them to my directory it fails.
>
> Here are my latest configurations:
> <cxfbc:provider wsdl="http://localhost:1234/HowdyWorld.svc?wsdl"
>      service="howdy:HowdyWorld"
>      endpoint="howdy:BasicHttpBinding_IHowdyWorld"
>      locationURI="http://localhost:1234/HowdyWorld.svc"
>      useJBIWrapper="false" />
>
> <file:poller service="mock:TestMessageService"
>      endpoint="FilePoller"
>       targetService="howdy:HowdyWorld"
>      targetEndpoint="howdy:BasicHttpBinding_IHowdyWorld"
>      targetInterface="howdy:Howdy"
>      file="${mock.inbound}" />
>
> I'm using a file with this content:
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> "
> xmlns:tem="http://tempuri.org/">
>   <soapenv:Header/>
>   <soapenv:Body>
>      <tem:Howdy>
>         <!--Optional:-->
>         <tem:value>John Doe</tem:value>
>      </tem:Howdy>
>   </soapenv:Body>
> </soapenv:Envelope>
>
> I get this result in the log file:
> InOnly[
>  id: ID:172.17.165.202-124062c87e0-6:6
>  status: Active
>  role: provider
>  interface: {http://tempuri.org/}Howdy <http://tempuri.org/%7DHowdy>
>  service: {http://tempuri.org/}HowdyWorld<http://tempuri.org/%7DHowdyWorld>
>  endpoint: howdy:BasicHttpBinding_IHowdyWorld
>   in: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:tem="http://tempuri.org/">
>   <soapenv:Header/>
>   <soapenv:Body>
>      <tem:Howdy>
>         <tem:value>John Doe</tem:value>
>      </tem:Howdy>
>   </soapenv:Body>
> </soapenv:Envelope>
> ]
>
> 10:59:08,570 | INFO  | pool-flow.seda.servicemix-cxf-bc-thread-14 |
> PhaseInterceptorChain    | he.cxf.common.logging.LogUtils  345 |
> Interceptor
> has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: org.apache.xerces.dom.DeferredTextImpl
> cannot be cast to org.w3c.dom.Element at
>
> org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:149)
> at
>
> org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:56)
> ...
>
> My understanding was that an XML file that is fed to a file poller will get
> normalized and then passed on to its target JBI service and endpoint.
>
> Since I've hooked my file poller up to my cxf-bc provider, it should then
> receive normalized JBI messages and unwrap them and send the remaining SOAP
> message on to my external web service.
>
> Is my understanding incorrect?
>
> Thanks.
>
>
> Freeman Fang wrote:
> >
> > Just as Johan point out, add useJBIWrapper="false" attribute for your
> > cxf bc provider endpoint configuration.
> > Freeman
> > On 2009-9-29, at 上午8:03, Johan Edstrom wrote:
> >
> >> Either create a JBI message or set JBIWrapper to false on the
> >> binding component.
> >>
> >>
> > --
> > Freeman Fang
> > ------------------------
> > Open Source SOA: http://fusesource.com
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Sending-messages-via-a-file-poller-into-a-cxf-bc-provider-endpoint-tp25654650p25664884.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>

Re: Sending messages via a file poller into a cxf-bc provider endpoint

Posted by jweathers777 <jo...@gmail.com>.
I'm afraid that doesn't solve the problem. To simply things, I've replaced my
ServiceMix written service with a truly external web service written in
.NET.

Here's the WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
xmlns:tns="http://tempuri.org/"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:wsa10="http://www.w3.org/2005/08/addressing"
xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" name="HowdyWorld"
targetNamespace="http://tempuri.org/">
  <wsdl:types>
    <xsd:schema targetNamespace="http://tempuri.org/Imports">
      <xsd:import
schemaLocation="http://localhost:1234/HowdyWorld.svc?xsd=xsd0"
namespace="http://tempuri.org/"/>
      <xsd:import
schemaLocation="http://localhost:1234/HowdyWorld.svc?xsd=xsd1"
namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="IHowdyWorld_Howdy_InputMessage">
    <wsdl:part name="parameters" element="tns:Howdy"/>
  </wsdl:message>
  <wsdl:message name="IHowdyWorld_Howdy_OutputMessage">
    <wsdl:part name="parameters" element="tns:HowdyResponse"/>
  </wsdl:message>
  <wsdl:portType name="IHowdyWorld">
    <wsdl:operation name="Howdy">
      <wsdl:input wsaw:Action="http://tempuri.org/IHowdyWorld/Howdy"
message="tns:IHowdyWorld_Howdy_InputMessage"/>
      <wsdl:output
wsaw:Action="http://tempuri.org/IHowdyWorld/HowdyResponse"
message="tns:IHowdyWorld_Howdy_OutputMessage"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="BasicHttpBinding_IHowdyWorld" type="tns:IHowdyWorld">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="Howdy">
      <soap:operation soapAction="http://tempuri.org/IHowdyWorld/Howdy"
style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="HowdyWorld">
    <wsdl:port name="BasicHttpBinding_IHowdyWorld"
binding="tns:BasicHttpBinding_IHowdyWorld">
      <soap:address location="http://localhost:1234/HowdyWorld.svc"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

When I use a cxf-bc consumer component to consume incoming responses via
SOAP and forward them on to a cxf-bc provider component that references this
external web service, it works when I test via SoapUI.

However, when I replace the cxf-bc consumer with a file poller and send
messages in via copying them to my directory it fails.

Here are my latest configurations:
<cxfbc:provider wsdl="http://localhost:1234/HowdyWorld.svc?wsdl"
      service="howdy:HowdyWorld" 
      endpoint="howdy:BasicHttpBinding_IHowdyWorld"
      locationURI="http://localhost:1234/HowdyWorld.svc"
      useJBIWrapper="false" />

<file:poller service="mock:TestMessageService"
      endpoint="FilePoller"
      targetService="howdy:HowdyWorld"
      targetEndpoint="howdy:BasicHttpBinding_IHowdyWorld"
      targetInterface="howdy:Howdy"
      file="${mock.inbound}" />

I'm using a file with this content:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:Howdy>
         <!--Optional:-->
         <tem:value>John Doe</tem:value>
      </tem:Howdy>
   </soapenv:Body>
</soapenv:Envelope>

I get this result in the log file:
InOnly[
  id: ID:172.17.165.202-124062c87e0-6:6
  status: Active
  role: provider
  interface: {http://tempuri.org/}Howdy
  service: {http://tempuri.org/}HowdyWorld
  endpoint: howdy:BasicHttpBinding_IHowdyWorld
  in: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:Howdy>
         <tem:value>John Doe</tem:value>
      </tem:Howdy>
   </soapenv:Body>
</soapenv:Envelope>
]

10:59:08,570 | INFO  | pool-flow.seda.servicemix-cxf-bc-thread-14 |
PhaseInterceptorChain    | he.cxf.common.logging.LogUtils  345 | Interceptor
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: org.apache.xerces.dom.DeferredTextImpl
cannot be cast to org.w3c.dom.Element at
org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:149)
at
org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:56)
...

My understanding was that an XML file that is fed to a file poller will get
normalized and then passed on to its target JBI service and endpoint.

Since I've hooked my file poller up to my cxf-bc provider, it should then
receive normalized JBI messages and unwrap them and send the remaining SOAP
message on to my external web service.

Is my understanding incorrect?

Thanks.


Freeman Fang wrote:
> 
> Just as Johan point out, add useJBIWrapper="false" attribute for your  
> cxf bc provider endpoint configuration.
> Freeman
> On 2009-9-29, at 上午8:03, Johan Edstrom wrote:
> 
>> Either create a JBI message or set JBIWrapper to false on the  
>> binding component.
>>
>>
> -- 
> Freeman Fang
> ------------------------
> Open Source SOA: http://fusesource.com
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Sending-messages-via-a-file-poller-into-a-cxf-bc-provider-endpoint-tp25654650p25664884.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Sending messages via a file poller into a cxf-bc provider endpoint

Posted by Freeman Fang <fr...@gmail.com>.
Just as Johan point out, add useJBIWrapper="false" attribute for your  
cxf bc provider endpoint configuration.
Freeman
On 2009-9-29, at 上午8:03, Johan Edstrom wrote:

> Either create a JBI message or set JBIWrapper to false on the  
> binding component.
>
> On Sep 28, 2009, at 5:36 PM, jweathers777 wrote:
>
>>
>> I'm using ServiceMix 3.2.3 and am trying to send test messages from  
>> a file
>> into a web service and then ultimately (after getting past my current
>> hurdles) back out into another file.
>>
>> I've written the web service as a service assembly that uses a cxf-se
>> endpoint to provide a simple HelloWorld POJO as a web service and a  
>> cxf-bc
>> consumer endpoint to expose the web service to the outside world via
>> consuming HTTP+SOAP request.
>>
>> The whole thing is essentially the product of following this  
>> tutorial:
>> http://servicemix.apache.org/4-beginner-web-services-with-servicemix-and-cxf.html
>> See this tutorial for the wsdl definition.
>>
>> This part works fine for me. I've tested sending messages to it via  
>> SoapUI
>> as well as via a Ruby SOAP client.
>>
>> I noted in the following info in the ServiceMix log file:
>> ServiceMix: broadcasting info for:
>> org 
>> .apache 
>> .servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service={http://example.com 
>> }HelloService,endpoint=HelloImplPort]]
>>
>> And later when it successfully handles incoming messages from  
>> SoapUI, I see:
>> interface: {http://example.com}Hello
>> service: {http://example.com}HelloService
>> endpoint: HelloImplPort
>> operation: {http://example.com}SayHello
>>
>> Then, I wrote a service assembly that has a file poller endpoint that
>> monitors a directory for files containing an example SOAP message  
>> that I
>> generated via SoapUI. The file poller is supposed to then send the  
>> message
>> to my web service. To that end, I've set up a cxf-bc provider  
>> endpoint that
>> I've configured to reference the above web service.
>>
>> However, every configuration combination that I've tried has  
>> resulted in
>> problems.
>>
>> Currently, I have the provider configured as follows:
>>
>> <cxfbc:provider wsdl="http://localhost:8193/HelloService/?wsdl"
>>     service="hello:HelloService"
>>     endpoint="HelloSOAPBinding" />
>>
>> where hello="http://example.com" and the file poller is configured  
>> like
>> this:
>>
>> <file:poller service="mock:TestMessageService"
>>     endpoint="FilePoller"
>>     targetService="hello:HelloService"
>>     targetEndpoint="HelloSOAPBinding"
>>     file="/temp/inbound" />
>>
>> where mock="http://example.com/mock" and hello="http://example.com"
>>
>> When I copy a file containing the following text into the folder
>> /temp/inbound:
>> <soapenv:Envelope
>>  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>  xmlns:typ="http://example.com/types">
>>  <soapenv:Header/>
>>  <soapenv:Body>
>>     <typ:SayHello>
>>        <typ:name>World</typ:name>
>>     </typ:SayHello>
>>  </soapenv:Body>
>> </soapenv:Envelope>
>>
>> I get the following error:
>> status: Active
>> role: provider
>> service: {http://example.com}HelloService
>> endpoint: HelloSOAPBinding
>> in: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:typ="http://example.com/types">
>>
>> <soapenv:Header/>   <soapenv:Body> <typ:SayHello>
>> <typ:name>World</typ:name></typ:SayHello>
>>
>> </soapenv:Body></soapenv:Envelope>
>> ]17:26:22,733 | INFO  | pool-flow.seda.servicemix-cxf-bc-thread-1 |
>> PhaseInterceptorChain    |
>>
>> he.cxf.common.logging.LogUtils  345 | Interceptor has thrown  
>> exception,
>> unwinding
>> noworg.apache.cxf.interceptor.Fault: Message wrapper element is
>> '{http://schemas.xmlsoap.org/soap/envelope/}Envelope' but expected
>> '{http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper}message'	at
>> org 
>> .apache 
>> .servicemix 
>> .cxfbc 
>> .interceptors 
>> .JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:97)
>>
>>
>> I also noticed:
>> Endpoint
>> ServiceEndpoint[service={http:// 
>> example.com}HelloService,endpoint=HelloSOAPBinding]
>> has a service description, but no matching endpoint found in [soap]
>>
>> when ServiceMix tries to load the cxf-bc su with the provider  
>> endpoint that
>> references the web service.
>>
>> That suggests to me that it's not pointing at the correct endpoint,  
>> but if I
>> change it from HelloSOAPBinding to HelloImplPort then when I try to  
>> deploy
>> to ServiceMix, it fails with:
>> javax.jbi.JBIException: An internal endpoint for service
>> {http://example.com}HelloService and endpoint HelloImplPort is  
>> already
>> registered.
>>
>> Any help on how to properly configure what I'm trying to achieve  
>> would be
>> appreciated.
>>
>> Thanks!
>>
>> -- 
>> View this message in context: http://www.nabble.com/Sending-messages-via-a-file-poller-into-a-cxf-bc-provider-endpoint-tp25654650p25654650.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>
> Johan Edstrom
>
> joed@opennms.org
>
> They that can give up essential liberty to purchase a little  
> temporary safety, deserve neither liberty nor safety.
>
> Benjamin Franklin, Historical Review of Pennsylvania, 1759
>
>
>
>
>


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


Re: Sending messages via a file poller into a cxf-bc provider endpoint

Posted by Johan Edstrom <jo...@opennms.org>.
Either create a JBI message or set JBIWrapper to false on the binding  
component.

On Sep 28, 2009, at 5:36 PM, jweathers777 wrote:

>
> I'm using ServiceMix 3.2.3 and am trying to send test messages from  
> a file
> into a web service and then ultimately (after getting past my current
> hurdles) back out into another file.
>
> I've written the web service as a service assembly that uses a cxf-se
> endpoint to provide a simple HelloWorld POJO as a web service and a  
> cxf-bc
> consumer endpoint to expose the web service to the outside world via
> consuming HTTP+SOAP request.
>
> The whole thing is essentially the product of following this tutorial:
> http://servicemix.apache.org/4-beginner-web-services-with-servicemix-and-cxf.html
> See this tutorial for the wsdl definition.
>
> This part works fine for me. I've tested sending messages to it via  
> SoapUI
> as well as via a Ruby SOAP client.
>
> I noted in the following info in the ServiceMix log file:
> ServiceMix: broadcasting info for:
> org 
> .apache 
> .servicemix.jbi.event.EndpointEvent[source=ServiceEndpoint[service={http://example.com 
> }HelloService,endpoint=HelloImplPort]]
>
> And later when it successfully handles incoming messages from  
> SoapUI, I see:
>  interface: {http://example.com}Hello
>  service: {http://example.com}HelloService
>  endpoint: HelloImplPort
>  operation: {http://example.com}SayHello
>
> Then, I wrote a service assembly that has a file poller endpoint that
> monitors a directory for files containing an example SOAP message  
> that I
> generated via SoapUI. The file poller is supposed to then send the  
> message
> to my web service. To that end, I've set up a cxf-bc provider  
> endpoint that
> I've configured to reference the above web service.
>
> However, every configuration combination that I've tried has  
> resulted in
> problems.
>
> Currently, I have the provider configured as follows:
>
> <cxfbc:provider wsdl="http://localhost:8193/HelloService/?wsdl"
>      service="hello:HelloService"
>      endpoint="HelloSOAPBinding" />
>
> where hello="http://example.com" and the file poller is configured  
> like
> this:
>
> <file:poller service="mock:TestMessageService"
>      endpoint="FilePoller"
>      targetService="hello:HelloService"
>      targetEndpoint="HelloSOAPBinding"
>      file="/temp/inbound" />
>
> where mock="http://example.com/mock" and hello="http://example.com"
>
> When I copy a file containing the following text into the folder
> /temp/inbound:
> <soapenv:Envelope
>   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>   xmlns:typ="http://example.com/types">
>   <soapenv:Header/>
>   <soapenv:Body>
>      <typ:SayHello>
>         <typ:name>World</typ:name>
>      </typ:SayHello>
>   </soapenv:Body>
> </soapenv:Envelope>
>
> I get the following error:
>  status: Active
>  role: provider
>  service: {http://example.com}HelloService
>  endpoint: HelloSOAPBinding
>  in: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:typ="http://example.com/types">
>
> <soapenv:Header/>   <soapenv:Body> <typ:SayHello>
> <typ:name>World</typ:name></typ:SayHello>
>
> </soapenv:Body></soapenv:Envelope>
> ]17:26:22,733 | INFO  | pool-flow.seda.servicemix-cxf-bc-thread-1 |
> PhaseInterceptorChain    |
>
> he.cxf.common.logging.LogUtils  345 | Interceptor has thrown  
> exception,
> unwinding
> noworg.apache.cxf.interceptor.Fault: Message wrapper element is
> '{http://schemas.xmlsoap.org/soap/envelope/}Envelope' but expected
> '{http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper}message'	at
> org 
> .apache 
> .servicemix 
> .cxfbc 
> .interceptors 
> .JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:97)
>
>
> I also noticed:
> Endpoint
> ServiceEndpoint[service={http:// 
> example.com}HelloService,endpoint=HelloSOAPBinding]
> has a service description, but no matching endpoint found in [soap]
>
> when ServiceMix tries to load the cxf-bc su with the provider  
> endpoint that
> references the web service.
>
> That suggests to me that it's not pointing at the correct endpoint,  
> but if I
> change it from HelloSOAPBinding to HelloImplPort then when I try to  
> deploy
> to ServiceMix, it fails with:
> javax.jbi.JBIException: An internal endpoint for service
> {http://example.com}HelloService and endpoint HelloImplPort is already
> registered.
>
> Any help on how to properly configure what I'm trying to achieve  
> would be
> appreciated.
>
> Thanks!
>
> -- 
> View this message in context: http://www.nabble.com/Sending-messages-via-a-file-poller-into-a-cxf-bc-provider-endpoint-tp25654650p25654650.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>

Johan Edstrom

joed@opennms.org

They that can give up essential liberty to purchase a little temporary  
safety, deserve neither liberty nor safety.

Benjamin Franklin, Historical Review of Pennsylvania, 1759