Example #1
0
File: util.c Project: AdrianRys/wsf
axis2_status_t
wsclient_set_https_transport_parameretes (const axutil_env_t *env,
										  axis2_svc_client_t *svc_client)
{
	axis2_conf_ctx_t *conf_ctx;
	axis2_svc_ctx_t *svc_ctx;
	axis2_conf_t *conf;
	axutil_qname_t *qname;
	axis2_transport_out_desc_t *transport_out;
	axis2_transport_sender_t *transport_sender;
	axutil_param_t *param;
	AXIS2_TRANSPORT_ENUMS transport_enum=AXIS2_TRANSPORT_ENUM_HTTP;

	if (svc_client)
		svc_ctx = axis2_svc_client_get_svc_ctx (svc_client, env);
	else 
		return AXIS2_FAILURE;

	if (svc_ctx)
		conf_ctx = axis2_svc_ctx_get_conf_ctx(svc_ctx, env);
	else 
		return AXIS2_FAILURE;

	if (conf_ctx)
		conf = axis2_conf_ctx_get_conf(conf_ctx, env);
	else 
		return AXIS2_FAILURE;


	qname = axutil_qname_create (env, "https", NULL, NULL);
	if (qname)
		transport_out = axis2_transport_out_desc_create(env, transport_enum);
	else 
		return AXIS2_FAILURE;

	transport_sender = (axis2_transport_sender_t *)axis2_http_transport_sender_create (env);

	param = axutil_param_create (env, NULL, NULL);
	if (param)
	{
		axutil_param_set_name(param, env, (void *)axutil_strdup (env, AXIS2_HTTP_PROTOCOL_VERSION));
		axutil_param_set_value(param, env, (void *)axutil_strdup (env, AXIS2_HTTP_HEADER_PROTOCOL_11));
		axutil_param_set_locked(param, env, AXIS2_FALSE);
	}
	else 
		return AXIS2_FAILURE;

	if (transport_out && conf)
	{
        axis2_transport_out_desc_add_param (transport_out, env, param);
		axis2_transport_out_desc_set_sender(transport_out, env, transport_sender);
		axis2_conf_add_transport_out (conf, env, transport_out, AXIS2_TRANSPORT_ENUM_HTTP);
	}
	else
		return AXIS2_FAILURE;

	return AXIS2_SUCCESS;
}
Example #2
0
const axis2_char_t *AXIS2_CALL
axis2_stub_get_svc_ctx_id(
    const axis2_stub_t * stub,
    const axutil_env_t * env)
{
    const axis2_svc_ctx_t *svc_ctx = NULL;
    const axis2_char_t *svc_ctx_id = NULL;

    AXIS2_PARAM_CHECK (env->error, stub, NULL);

    svc_ctx = axis2_svc_client_get_svc_ctx(stub->svc_client, env);
    svc_ctx_id = axis2_svc_ctx_get_svc_id(svc_ctx, env);
    return svc_ctx_id;
}
Example #3
0
axiom_soap_envelope_t *
wsdl_util_send_receive_soap_envelope_with_op_client(
    const axutil_env_t* env,
    axis2_svc_client_t* svc_client,
    axis2_options_t* options,
    axis2_char_t* buffer)
{
    axiom_soap_envelope_t *res_envelope = NULL, *req_envelope = NULL;
    axis2_svc_ctx_t *svc_ctx = NULL;
    axis2_conf_ctx_t *conf_ctx = NULL;
    axis2_msg_ctx_t *req_msg_ctx = NULL, *res_msg_ctx = NULL;
    axutil_qname_t *op_qname = NULL;
    axis2_op_client_t *op_client = NULL;
    axis2_char_t *soap_version_uri = NULL;

    svc_ctx = axis2_svc_client_get_svc_ctx (svc_client, env);

    conf_ctx = axis2_svc_ctx_get_conf_ctx (svc_ctx, env);

    req_msg_ctx = axis2_msg_ctx_create (env, conf_ctx, NULL, NULL);

    op_qname = axutil_qname_create (env, AXIS2_ANON_OUT_IN_OP, NULL, NULL);

    op_client = axis2_svc_client_create_op_client (svc_client, env, op_qname);

    soap_version_uri = (axis2_char_t *) axis2_options_get_soap_version_uri (options, env);

    req_envelope = wsdl_util_create_soap_envelope_from_buffer (env, buffer, soap_version_uri);
    
    axis2_msg_ctx_set_soap_envelope (req_msg_ctx, env, req_envelope);
    
    axis2_op_client_add_msg_ctx (op_client, env, req_msg_ctx);
    
    axis2_op_client_execute (op_client, env, AXIS2_TRUE);
    
    res_msg_ctx =
       (axis2_msg_ctx_t *)axis2_op_client_get_msg_ctx (op_client, env, AXIS2_WSDL_MESSAGE_LABEL_IN);
    
    if (res_msg_ctx) 
    {        
        res_envelope = axis2_msg_ctx_get_soap_envelope (res_msg_ctx, env);
    } 
    else 
    {
        res_envelope = NULL;
    }
    
    return res_envelope;
}
Example #4
0
axis2_status_t
wsf_wsdl_util_add_security_to_svc_client_configuration(
    const axutil_env_t* env,
    axutil_hash_t* security_token_hash,
    axis2_svc_client_t* svc_client)
{
    rampart_context_t* rampart_ctx = NULL;
    axis2_svc_ctx_t *svc_ctx = NULL;
    axis2_conf_ctx_t *conf_ctx = NULL;
    axis2_conf_t *conf = NULL;
    axutil_param_t *security_param = NULL;

    svc_ctx = axis2_svc_client_get_svc_ctx (svc_client, env);
    conf_ctx = axis2_svc_ctx_get_conf_ctx (svc_ctx, env);
    conf = axis2_conf_ctx_get_conf (conf_ctx, env);
    
    rampart_ctx = rampart_context_create(env);

    wsf_wsdl_util_set_security_token_options_to_rampart_ctx (env, security_token_hash, rampart_ctx);
    
    security_param = axutil_param_create (env, WSF_WSDL_RAMPART_CONFIGURATION, (void *)rampart_ctx);

    return axis2_conf_add_param (conf, env, security_param);
}