axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Murali Konnipati" <murali.konnip...@altair.com>
Subject cannot infer transport from URL
Date Mon, 24 Sep 2007 13:14:50 GMT
Hi All,

       When i try to execute my webservice client program, it is giving the following error
in the axis2 generated log file

        ----------
         PBS LOG file
        ------------
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(324) This handler is                 
      trying to added to system pre defined phases , but those                        handlers
are already added to global chain which run                        irrespective of the service
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(231) module name is:addressing
[Mon Sep 24 23:15:24 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to
phase MessageOut
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(231) module name is:addressing
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(231) module name is:addressing
[Mon Sep 24 23:15:24 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to
phase MessageOut
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(231) module name is:addressing
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(324) This handler is                 
      trying to added to system pre defined phases , but those                        handlers
are already added to global chain which run                        irrespective of the service
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(231) module name is:addressing
[Mon Sep 24 23:15:24 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to
phase MessageOut
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(231) module name is:addressing
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(231) module name is:addressing
[Mon Sep 24 23:15:24 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to
phase MessageOut
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(231) module name is:addressing
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(324) This handler is                 
      trying to added to system pre defined phases , but those                        handlers
are already added to global chain which run                        irrespective of the service
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(231) module name is:addressing
[Mon Sep 24 23:15:24 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to
phase MessageOut
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(231) module name is:addressing
[Mon Sep 24 23:15:24 2007] [debug] phase_resolver.c(231) module name is:addressing
[Mon Sep 24 23:15:24 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to
phase MessageOut
[Mon Sep 24 23:15:24 2007] [error] xmltest.c(308) Stub invoke FAILED: Error code: 4 :: cannot
infer transport from URL

 ------------My code ----------------

void createActivity()
{
	const axutil_env_t *env=NULL;
	const axis2_char_t *address=NULL;
	axis2_endpoint_ref_t *endpoint_reference=NULL;
	axis2_options_t *options=NULL;
	const axis2_char_t *client_home=NULL;
	axis2_svc_client_t *svc_client = NULL;
	axis2_op_client_t *op_client = NULL;
	axis2_op_t *op=NULL;

	/* Setup the environment */
	
	env = axutil_env_create_all("PBSHPCP.log",AXIS2_LOG_LEVEL_TRACE);
	
	/* Set end point reference of HPCP webservice */

	address="http://altair-winccss0/HPCBasicProfile";
	printf("Using Endpoint : %s \n", address);
	
	/* Create EPR with given address */
	
	endpoint_reference = axis2_endpoint_ref_create(env,address);
	
	/* Setup options */
	
	options = axis2_options_create(env);
	axis2_options_set_to(options,env,endpoint_reference);
	axis2_options_set_action(options,env,"http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/CreateActivity");
	
	axutil_property_t *server_certificate=axutil_property_create(env);
	axutil_property_set_value(server_certificate,env,axutil_strdup(env,"/home/murali/murali.cer"));
	axis2_options_set_property(options,env,"SERVER_CERT",server_certificate);
	
	/* Reading the Client Home from environment */
	client_home=AXIS2_GETENV("AXIS2C_HOME");
	if (!client_home || !strcmp (client_home, ""))
        client_home = "../..";

	/* Creating Service Client */
	
	svc_client = axis2_svc_client_create(env, client_home);
	if (!svc_client)
        {
        	printf("Error creating service client, Please check AXIS2C_HOME again\n");
        	AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Stub invoke FAILED: Error code:"
                " %d :: %s", env->error->error_number,
                AXIS2_ERROR_GET_MESSAGE(env->error));
                return -1;
    	}
	/*	printf("Creating Operation Client : \n");
	op=axis2_op_create(env);
	op_client=axis2_op_client_create(env,op,svc_client,options);
	printf("Creating an envelope \n");
	axis2_msg_ctx_t *request = axis2_op_client_prepare_soap_envelope(op_client,env,activitydocument);
	printf("Sending SOAP response\n");
	axis2_status_t *status=axis2_op_client_execute(op_client,env,NULL);
	axis2_msg_ctx_t *response=axis2_op_client_two_way_send(env,request);
	
	printf("Completed sending the soap request");
	axiom_soap_envelope_t *ret = axis2_msg_ctx_get_soap_envelope(response,env);
	printf("SOAP response received \n"); */

	axiom_node_t *header_node=getHeaderNode(env);
	axis2_status_t *status = axis2_svc_client_add_header(svc_client,env,header_node);
	if(status==AXIS2_FAILURE)
	{
		printf("Unable to add the header");
		return -1;
	}
	else
	{
		printf (" \n Sucessfully Added the Header \n");
	}
	axiom_node_t *to_node=ToElement(env);
	status=axis2_svc_client_add_header(svc_client,env,to_node);
	if(status==AXIS2_FAILURE)
        {
                printf("Unable to add To element to the Header");
                return -1;
        }
        else
        {
                printf (" \n TO Element added sucessfully to Header \n");
        }
	axiom_node_t *payload=convertPBSToJSDL(env);
	axiom_node_t *ret=axis2_svc_client_send_receive(svc_client,env,payload);
	if(ret)
	{
		axis2_char_t *om_str=NULL;
		om_str = axiom_node_to_string(ret,env);
		if(om_str)
		{
			 printf("\nReceived OM : %s\n", om_str);
       			 printf("\necho client invoke SUCCESSFUL!\n");

		        AXIS2_FREE(env->allocator, om_str);
		}        ret = NULL;

       }
       else
       {
       	 AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Stub invoke FAILED: Error code:"
                " %d :: %s", env->error->error_number,
                AXIS2_ERROR_GET_MESSAGE(env->error));
        	printf("echo client invoke FAILED!\n");

	}	

	if (svc_client)
    	{
       		 axis2_svc_client_free(svc_client, env);
     		 svc_client = NULL;
	}

   	 if (env)
	{
        	axutil_env_free((axutil_env_t *) env);
	        env = NULL;
	}

    return 0;

}


Please check my code and let me know, if there are any mistakes in the program.

Thanks & Regards,

Murali Krishna K

Mime
View raw message