Preventing staff service (server side) from sending response.

16 views
Skip to first unread message

Mike

unread,
Sep 26, 2014, 11:02:12 AM9/26/14
to wsf-...@googlegroups.com
Hi again,

Maybe I've missed something reading staff code but I cannot find the way to not to send soap response to the client.
My Staff based service should not to send a response with saop because it is supposed to handle notfications (ws-basenotifications).
According to what I found in StaffService.cpp there is following code that checks if response should be sent back:

if(!IsNeedReply(pMsgCtx, pEnv))
{
      return NULL;
}

I cannot figure out, if AXIS2_MEP_URI_OUT_ONLY or AXIS2_MEP_URI_ROBUST_OUT_ONLY could be set via staff client/operation objects.

Regards,
Mike

Dmitry Utkin

unread,
Sep 26, 2014, 2:02:06 PM9/26/14
to wsf-...@googlegroups.com
Hi,

There is a function in staff::ServiceClient:

    //! send payload and check result, returned by server
    /*! MEP: Robust Out-Only
        \param  rdoPayload - request to service
        */
    void SendRobust(DataObject& rdoPayload);



To change MEP from service interface you can use mep metacomment. Supported values are:
  • in-only
  • in-out
  • robust out-only

example of service interface with MEP:


    class MyWs: public staff::IService
    {
    public:
        // *mep: in-only
        virtual void test(const std::string& text) = 0;
    };



пятница, 26 сентября 2014 г., 19:02:12 UTC+4 пользователь Mike написал:
Message has been deleted
Message has been deleted
Message has been deleted

Mike

unread,
Sep 29, 2014, 6:28:41 AM9/29/14
to wsf-...@googlegroups.com
Hi,

Finally, I have managed to solve this issue. See solution below. For server side it has to be AXIS2_MEP_URI_ROBUST_IN_ONLY.

In my <MyServiceName>ServiceWrapper::Invoke method I added following code:

        staff::MessageContext &ctx = rOperation.GetMessageContext();
        axis2_op* pAxis2Op = axis2_msg_ctx_get_op(ctx, staff::Runtime::Inst().GetAxis2Env());

        assert(pAxis2Op);

        if (pAxis2Op) {
                axis2_op_set_msg_exchange_pattern(pAxis2Op, staff::Runtime::Inst().GetAxis2Env(), AXIS2_MEP_URI_ROBUST_IN_ONLY)
        }

Mike

----------------------------------------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages