How can I set parameter's type?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I set parameter's type?

WangJ
Hi.

I use AXIS2C V0.96 invoke the service that has been encapsulated by Tuscany SCA M3. The service only accept float type parameter. I don't know how to send a float type parameter in client. The received parameter's type of the service is always string type. 

The request's code is:
axiom_node_t *
build_om_request(const axis2_env_t *env)
{
    axiom_node_t* greet_om_node = NULL;
    axiom_element_t * greet_om_ele = NULL;
    axiom_node_t* arg0_node = NULL;
    axiom_element_t * arg0_ele = NULL;
    axiom_node_t* arg1_node = NULL;
    axiom_element_t * arg1_ele = NULL;

    greet_om_ele = axiom_element_create(env, NULL, "add", NULL, &greet_om_node);
    arg0_ele =  axiom_element_create(env, greet_om_node, "arg0", NULL, &arg0_node);
    arg1_ele =  axiom_element_create(env, greet_om_node, "arg1", NULL, &arg1_node);
    AXIOM_ELEMENT_SET_TEXT(arg0_ele, env, "12.0", arg0_node);
    AXIOM_ELEMENT_SET_TEXT(arg1_ele, env, "23.0", arg1_node);

    return greet_om_node;
}

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: How can I set parameter's type?

Rajika Kumarasiri-2
What's the SOAP message that's required by the service ? Just construct the required message using axiom api. Take a look at the echo and math examples. 

Rajika


On Sat, Jul 6, 2013 at 8:57 PM, WangJ <[hidden email]> wrote:
Hi.

I use AXIS2C V0.96 invoke the service that has been encapsulated by Tuscany SCA M3. The service only accept float type parameter. I don't know how to send a float type parameter in client. The received parameter's type of the service is always string type. 

The request's code is:
axiom_node_t *
build_om_request(const axis2_env_t *env)
{
    axiom_node_t* greet_om_node = NULL;
    axiom_element_t * greet_om_ele = NULL;
    axiom_node_t* arg0_node = NULL;
    axiom_element_t * arg0_ele = NULL;
    axiom_node_t* arg1_node = NULL;
    axiom_element_t * arg1_ele = NULL;

    greet_om_ele = axiom_element_create(env, NULL, "add", NULL, &greet_om_node);
    arg0_ele =  axiom_element_create(env, greet_om_node, "arg0", NULL, &arg0_node);
    arg1_ele =  axiom_element_create(env, greet_om_node, "arg1", NULL, &arg1_node);
    AXIOM_ELEMENT_SET_TEXT(arg0_ele, env, "12.0", arg0_node);
    AXIOM_ELEMENT_SET_TEXT(arg1_ele, env, "23.0", arg1_node);

    return greet_om_node;
}

Thanks!

Reply | Threaded
Open this post in threaded view
|

RE: How can I set parameter's type?

WangJ
I have look the echo and math examples.  The parameter's type is string in these examples. Interger parameter is converted string type, then is sent to service.

Thanks!