Announcement Announcement Module
Collapse
No announcement yet.
cxf ws inbound gateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • cxf ws inbound gateway

    Hi, are there any detailed tutorials/samples for cxf endpoint as frontend and invoking the ws inbound gateway with an non empty response going back to the requestor of the web service?

    many thanks

  • #2
    There are no samples that I know off, but I can't imagine it to be hard at all. All you need is to simply inject the reference to a Messaging Gateway (e.g., <gateway>) to your CXF component and you got the integration you are looking for.

    Of course having a specialized adapter would help as well, so if any of you (CXF experts) interested in contributing read this blog http://blog.springsource.org/2012/08...on-extensions/ We would love to have such contribution.

    Comment


    • #3
      I am experimenting with this right now. We are trying to leave our business services free of cxf annotations, which means creating a separate SEI/implementation that would in turn call the business services. Without SI that involves the implementation method calling the relevant business service method directly. To link this with SI, unfortunately it looks like it might require editing each method in the SEI's implementation to manually put a message on a channel. This would in turn probably invoke a service-activator for the business service with a reply channel. Then the SEI implementation method would receive the message from the reply channel to return it, for CXF to handle.

      This seems ugly and it would be preferable to be able to edit the jaxws configuration to call an SI gateway directly. But the part I'm stuck on is that it seems that is a one-way trip and I'm not sure how to make it automatically return the response that the business service would eventually return.

      Comment


      • #4
        ". . .it might require editing each method in the SEI's implementation to manually put a message on a channel. . ."

        No, no, no, you don't have to do that. THat is what the Messaging Gateway is for. It give you a complete POJO way of interacting with SI. IN other words you don't have to rely or depend on SI API at all. http://static.springsource.org/sprin...ingle/#gateway

        Let me know if you need more details

        Comment


        • #5
          ". . .automatically return the response that the business service would eventually return..."

          You can define gateway's signature to return whatever type you want right?

          Comment


          • #6
            Thanks Olef, I had completely missed that. Still familiarizing.

            Here's a very simple example of a cxf to SI configuration on the services side:

            Code:
                <jaxws:endpoint id="soapContainer" implementor="#profileSoapServiceGateway" address="/soap"
                        serviceName="profileSoapService" />
            
                <int:channel id="requestChannel"/>
            
                <int:service-activator input-channel="requestChannel" ref="profileServiceImpl" method="get"/>
            
                <int:gateway id="profileSoapServiceGateway"
                             service-interface="com.(...).ProfileSoapService"
                             default-request-channel="requestChannel">
                    <int:method name="get" payload-expression="#method"/>
                </int:gateway>
            By doing that I was able to remove our implementation for our SEI. The part that is non-obvious in the implementation is that the business service method's response gets passed back on a temporary channel to the SEI's implementation (the gateway), which is then returned for CXF to handle.
            Last edited by tunesmith; Oct 3rd, 2012, 06:51 PM.

            Comment

            Working...
            X