in src/util/msg_init.c [466:530]
static void add_op_if_null(
const axutil_env_t *env,
axis2_msg_ctx_t *msg_ctx)
{
axis2_op_t *op = NULL;
op = axis2_msg_ctx_get_op(msg_ctx, env);
if(!op)
{
axis2_svc_t *svc = NULL;
axutil_qname_t *tmp_qname = NULL;
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
"[sandesha2]Message context operation is NULL. So adding default operation");
tmp_qname = axutil_qname_create(env, "__OPERATION_OUT_IN__", NULL, NULL);
if (!tmp_qname)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return;
}
svc = axis2_msg_ctx_get_svc(msg_ctx, env);
if(svc)
{
op = axis2_svc_get_op_with_qname(svc, env, tmp_qname);
}
if(!op)
{
axis2_status_t status = AXIS2_FAILURE;
axis2_conf_ctx_t *conf_ctx = NULL;
axis2_conf_t *conf = NULL;
axis2_phases_info_t *info = NULL;
op = axis2_op_create_with_qname(env, tmp_qname);
axis2_op_set_msg_exchange_pattern(op, env, AXIS2_MEP_URI_OUT_IN);
conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
conf = axis2_conf_ctx_get_conf(conf_ctx, env);
info = axis2_conf_get_phases_info(conf, env);
axis2_phases_info_set_op_phases(info, env, op);
status = axis2_svc_add_op(svc, env, op);
if(AXIS2_SUCCESS == status)
{
status = axis2_msg_ctx_set_op(msg_ctx, env, op);
if(AXIS2_SUCCESS != status)
{
axis2_op_free(op, env);
op = NULL;
}
}
else
{
axis2_op_free(op, env);
op = NULL;
}
}
if(tmp_qname)
{
axutil_qname_free(tmp_qname, env);
}
axis2_msg_ctx_set_op(msg_ctx, env, op);
}
}