axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Senaka Fernando" <sen...@wso2.com>
Subject Re: Problem with proper service client set up?
Date Tue, 04 Mar 2008 18:28:51 GMT
Hi Frank,

We do have several working samples that are shipped with each distribution
and is also available on the svn head.

Please check inside the samples directory for an echo sample. I hope that
might solve your issue.

If not, you simply can call this method.

node = axis2_svc_client_send_receive(_wsf_service_client, _env, payload);

And, it should work I believe.

Regards,
Senaka

> Hi, All,
>
> I am trying to set up a web service client using
> AXIS2/c. I was able to compile the source code and
> call APIs in my C++ application. However, it seems
> that I made some mistakes in setting up the client
> properly, so that when I try to send a request, I
> always get NULL response. I debugged the code and it
> is clear to me that the request has never been sent
> out. The problem is that I AXIS2/ tries to find the
> operation from the service client I created with a
> given operation name, but I never created the
> operation. Here is my API call:
>
> string operation = "TestOrder";
> axutil_qname_t * qname = axutil_qname_create(_env,
> operation.c_str(), "", ");
> axiom_node_t * node =
> axis2_svc_client_send_receive_with_op_qname(_wsf_service_client,
> _env, qname, payload);
>
> The returned node is all null. And the problem seems
> to occur in the file svc_client.c at the following
> lines:
>
> op = axis2_svc_get_op_with_qname(svc_client->svc, env,
> op_qname);
> if (!op)
> {
> return NULL;
> }
>
> How do I create the operation and set it properly in
> the service client? I thought by calling the APIs the
> opreation is automatically created.
>
> Thanks much in advance.
> V.
>
> Here is my code snippet in greater detail:
> ============================
> string action = "job=TestOrder";
> string operation = "TestOrder";
> const axis2_char_t* endpoint_address =
> "http://ss-w-01-xxxx:8088/Data/servlet/webservices?ver=2.0";
> const axis2_char_t *client_home =
> AXIS2_GETENV("CLIENT_HOME");
>
> axis2_svc_client_t *_wsf_service_client =
> axis2_svc_client_create(_env, client_home);
>
> axis2_endpoint_ref_t *endpoint_ref =
> axis2_endpoint_ref_create(_env, endpoint_address);
> /* Setup options */
> axis2_options_t * _options =
> axis2_options_create(_env);
> axis2_options_set_to(_options, _env, endpoint_ref);
> axis2_options_set_soap_version(_options, _env,
> AXIOM_SOAP11);
> axis2_options_set_enable_rest(_options, _env,
> AXIS2_FALSE);
> axiom_node_t * payload = root_node;
> axis2_status_t status = AXIS2_FAILURE;
>
> if (action != "")
> {
>     if (axis2_options_get_soap_version(_options, _env)
> == AXIOM_SOAP11)
>     {
>         axutil_string_t * soap_action =
> axutil_string_create(_env, action.c_str());
>         status =
> axis2_options_set_soap_action(_options, _env,
> soap_action);
>         axutil_string_free(soap_action, _env);
>
>     }
>     else
>     {
>         axutil_qname_t * qname =
> axutil_qname_create(_env, AXIS2_MODULE_ADDRESSING,
> NULL, NULL);
>         axis2_bool_t engaged =
>
> axis2_svc_is_module_engaged(axis2_svc_client_get_svc(_wsf_service_client,
> _env), _env, qname);
>         axutil_qname_free(qname, _env);
>         if (engaged)
>         {
>             status =
> axis2_options_set_action(_options, _env,
> action.c_str());
>
>         }
>     }
> }
>
> status =
> axis2_svc_client_set_options(_wsf_service_client,
> _env, _options);
> axiom_node_t * node;
>
> axutil_qname_t * qname = axutil_qname_create(_env,
> operation.c_str(), "", NULL);
> node =
> axis2_svc_client_send_receive_with_op_qname(_wsf_service_client,
> _env, qname, payload);
> axutil_qname_free(qname, _env);
>
>
>
>
>       ____________________________________________________________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Mime
View raw message