You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by divakar <di...@india.altair.com> on 2007/10/01 13:21:46 UTC

Problem with invoking a https based service

Hi All,

             I am facing some problems with invoking a https based .Net 
webservice using the axis2c client. It is giving the error " Error code: 
82 :: Input stream is NULL in msg_ctx" in the client log file. I am 
attaching the axis2.xml, client log file & sample program for your 
reference. Please check the same and let me know, if i am making any 
mistakes in my client program.


Thanks & Regards,

Murali Krishna K

Re: Problem with invoking a https based service

Posted by Dinesh Premalal <xy...@gmail.com>.
Divakar,
divakar <di...@india.altair.com> writes:

>               If I change axis2.xml like removing message out http
> protocol and enable https it is giveing rampart security  error. I am
> sending axis2.xml and log.
Why are you using rampart? Do you have WS-Security requirement? Or it
is just HTTPS.

thanks,
Dinesh


-- 
Dinesh Premalal
http://xydinesh.wordpress.com/

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


Re: Problem with invoking a https based service

Posted by Dinesh Premalal <xy...@gmail.com>.
Divakar,

divakar <di...@india.altair.com> writes:

> Hi Manju,
>                  I  uncommented that got an error in rampart at first. I
> removed that and retried than got different Error code: 4 :: cannot infer
> transport from URL. I am sending log and axis.xml.
This happens because axis2/c engine is unable to determine HTTPS
transport sender from your url. You have kept https transport
sender commented in the axis2.xml. You need to uncomment and fill up 
required details with respect to https transport.

     <transportSender name="https" class="axis2_http_sender">
         <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
     </transportSender>
     <parameter name="SERVER_CERT">/path/to/ca/certificate</parameter>
     <parameter name="KEY_FILE">/path/to/client/certificate/chain/file</parameter>
     <parameter name="SSL_PASSPHRASE">passphrase</parameter>

thanks,
Dinesh

-- 
Dinesh Premalal
http://xydinesh.wordpress.com/

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


Re: Problem with invoking a https based service

Posted by divakar <di...@india.altair.com>.
Hi Manju,
                 I  uncommented that got an error in rampart at first. I 
removed that and retried than got different Error code: 4 :: cannot 
infer transport from URL. I am sending log and axis.xml.
Please check the same.

Thanks&Regards
  Divakar





Manjula Peiris wrote:

>Hi divakar,
>
>In your axis2.xml you have commented the following and still engaged
>rampart.
><!--phase name="Security"/-->
>
>Please uncomment it and try.
>
>-Manjula.
>
>On Fri, 2007-10-05 at 22:54 +0530, divakar wrote:
>  
>
>>Hi All,
>>               If I change axis2.xml like removing message out http 
>>protocol and enable https it is giveing rampart security  error. I am 
>>sending axis2.xml and log.
>>    
>>
>
>  
>
>>Thanks
>>divakar
>>
>>
>>
>>divakar wrote:
>>
>>    
>>
>>>Manjula Peiris:
>>>                   Hi,
>>>                   I changed as you guided but still getting same. I 
>>>am attaching those files log and code please correct me. I think in 
>>>log file it showing http error.
>>>                  thank
>>>               Divakar
>>>            
>>>
>>>Manjula Peiris wrote:
>>>
>>>      
>>>
>>>>Hi Divakr,
>>>>
>>>>Looking at your client code I have some problems. In Your client why are
>>>>you building the security header on your own? Because if you engage
>>>>rampart/c it will do all the necessary things reguarding soap message
>>>>security. IMHO following are things you need to do for your scenario.
>>>>
>>>>1. Specify CA-Cert as you done in the client code.
>>>>2. Use the policy file as in the
>>>>rampart_src_dir/samples/secpolicy/scenario2/policy.xml 3. put it into 
>>>>your client-repo
>>>>4. To set policy in your client code please refer to the client code at
>>>>rampart_src_dir/samples/client/sec_echo/echo.c
>>>>
>>>>Thanks,
>>>>-Manjula.
>>>>
>>>>
>>>>On Tue, 2007-10-02 at 13:08 +0530, Dumindu Pallewela wrote:
>>>> 
>>>>
>>>>        
>>>>
>>>>>Hi Divakar,
>>>>>
>>>>>I could not find why it didn't work for you, according to the logs.
>>>>>If you can build Axis2/C from source, you can test if the SSL
>>>>>transport (i.e., without any SOAP stuff) is working using the
>>>>>test/core/transport/http/test_http_transport.c test case.
>>>>>
>>>>>Regards,
>>>>>Dumindu.
>>>>>
>>>>>divakar wrote:
>>>>>  
>>>>>
>>>>>          
>>>>>
>>>>>>Hi All,
>>>>>>
>>>>>>           I am facing some problems with invoking a https based .Net
>>>>>>webservice using the axis2c client. It is giving the error " Error 
>>>>>>code:
>>>>>>82 :: Input stream is NULL in msg_ctx" in the client log file. I am
>>>>>>attaching the axis2.xml, client log file & sample program for your
>>>>>>reference. Please check the same and let me know, if i am making any
>>>>>>mistakes in my client program.
>>>>>>
>>>>>>
>>>>>>Thanks & Regards,
>>>>>>
>>>>>>Murali Krishna K
>>>>>>
>>>>>>
>>>>>>------------------------------------------------------------------------ 
>>>>>>
>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>>>>>>For additional commands, e-mail: axis-c-user-help@ws.apache.org
>>>>>>    
>>>>>>            
>>>>>>
>>>>>  
>>>>>          
>>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>>>>For additional commands, e-mail: axis-c-user-help@ws.apache.org
>>>>
>>>> 
>>>>
>>>>        
>>>>
>>>------------------------------------------------------------------------
>>>
>>>#include <axiom.h>
>>>#include <axis2_util.h>
>>>#include <axis2_const.h>
>>>#include <axutil_env.h>
>>>#include <axutil_log_default.h>
>>>#include <axutil_error_default.h>
>>>#include <axiom_output.h>
>>>#include <axiom_xml_writer.h>
>>>#include <stdio.h>
>>>#include <axis2_client.h>
>>>#include <axiom_soap.h>
>>>#include <axiom_soap_envelope.h>
>>>#include <rampart_context.h>
>>>#include <rampart_username_token.h>
>>>#include <axiom_soap_envelope.h>
>>>#include <rampart_constants.h>
>>>#include <neethi_util.h>
>>>#include <neethi_policy.h>
>>>
>>>axiom_node_t *getHeaderNode(const axutil_env_t *env)
>>>{
>>>       /* Namespace element declarations */
>>>
>>>       axiom_namespace_t *wsa_ns= NULL;
>>>       axiom_namespace_t *wsse_ns=NULL;
>>>       axiom_namespace_t *wsu_ns=NULL;
>>>
>>>       axiom_node_t *header_node=NULL,*to_node=NULL,*action_node=NULL;
>>>	axiom_element_t *header_element=NULL,*to_element=NULL,*action_element=NULL;
>>>
>>>	axiom_text_t *om_text=NULL;
>>>       axiom_node_t *text_node=NULL;
>>>       axiom_node_t *security_node=NULL,*usernametoken_node=NULL,*username_node=NULL,*password_node=NULL;
>>>       axiom_element_t *security_element=NULL,*usernametoken_element=NULL,*username_element=NULL,*password_element=NULL;
>>>       axiom_attribute_t *password_attribute=NULL,*body_attribute=NULL,*to_attribute=NULL;
>>>
>>>        /* Creating all the namespace elements */
>>>
>>>       wsa_ns= axiom_namespace_create(env,"http://www.w3.org/2005/08/addressing","wsa");
>>>       wsse_ns=axiom_namespace_create(env,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd","wsse");
>>>       wsu_ns=axiom_namespace_create(env,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd","wsu");
>>>
>>>       /* SOAP Header element */
>>>	header_element=axiom_element_create(env,NULL,"Header",NULL,&header_node);
>>>       security_element=axiom_element_create(env,NULL,"Security",wsse_ns,&security_node);
>>>
>>>       /* Usernametoken element to pass the username, password to HPCPwebservice */
>>>
>>>       usernametoken_element=axiom_element_create(env,NULL,"UsernameToken",wsse_ns,&usernametoken_node);
>>>       axiom_element_set_namespace(usernametoken_element,env,wsse_ns,usernametoken_node);
>>>       username_element=axiom_element_create(env,NULL,"Username",wsse_ns,&username_node);
>>>       om_text=axiom_text_create(env,username_node,"PBSGRIDWORKS\\administrator",&text_node);
>>>       password_element=axiom_element_create(env,NULL,"Password",wsse_ns,&password_node);
>>>       password_attribute=axiom_attribute_create(env,"Type","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText",NULL);
>>>       axiom_element_add_attribute(password_element,env,password_attribute,password_node);
>>>       om_text=axiom_text_create(env,password_node,"dummy@786",&text_node);
>>>       axiom_node_add_child(usernametoken_node,env,username_node);
>>>       axiom_node_add_child(usernametoken_node,env,password_node);
>>>       axiom_node_add_child(security_node,env,usernametoken_node);
>>>
>>>       /* End of Usernametoken element */
>>>
>>>	/*
>>>
>>>       action_element=axiom_element_create(env,NULL,"Action",wsa_ns,&action_node);
>>>       om_text=axiom_text_create(env,action_node,"http://schemas.ggf.org/bes/2006/08/bes-factory/CreateActivity",&text_node);
>>>       axiom_node_add_child(header_node,env,action_node);
>>>
>>>
>>>       to_element=axiom_element_create(env,NULL,"To",wsa_ns,&to_node);
>>>       to_attribute=axiom_attribute_create(env,"mustUnderstand","1",NULL);
>>>       axiom_element_add_attribute(to_element,env,to_attribute,to_node);
>>>       om_text=axiom_text_create(env,to_node,"http://OpenSuSe10:8081",&text_node);
>>>       
>>>	axiom_node_add_child(header_node,env,to_node);
>>>	*/
>>>	
>>>	axis2_char_t *om_str=NULL;
>>>       om_str = axiom_node_to_string(security_node,env);
>>>        if(om_str)
>>>        {
>>>                        printf("\n Header Element : %s\n", om_str);
>>>                        AXIS2_FREE(env->allocator, om_str);
>>>       }
>>>
>>>
>>>
>>>       return security_node;
>>>}
>>>
>>>axiom_node_t *ToElement(const axutil_env_t *env)
>>>{
>>>	axiom_namespace_t *wsa_ns=NULL;
>>>	axiom_node_t *to_node=NULL;
>>>	axiom_element_t *to_element=NULL;
>>>	axiom_attribute_t *to_attribute=NULL;
>>>	axiom_node_t *text_node=NULL;
>>>	wsa_ns= axiom_namespace_create(env,"http://www.w3.org/2005/08/addressing","wsa");
>>>	to_element=axiom_element_create(env,NULL,"To",wsa_ns,&to_node);
>>>       to_attribute=axiom_attribute_create(env,"mustUnderstand","1",NULL);
>>>       axiom_element_add_attribute(to_element,env,to_attribute,to_node);
>>>       axiom_text_t *om_text=axiom_text_create(env,to_node,"http://www.murali.com/BESFactory",&text_node);
>>>	axis2_char_t *om_str = axiom_node_to_string(to_node,env);
>>>        if(om_str)
>>>        {
>>>                        printf("\n To Element : %s\n", om_str);
>>>                        AXIS2_FREE(env->allocator, om_str);
>>>       }
>>>	return to_node;
>>>}
>>>
>>>
>>>
>>>
>>>axiom_node_t* convertPBSToJSDL(const axutil_env_t *env)
>>>{
>>>
>>>
>>>	/* Namespace element declarations */
>>>
>>>	axiom_namespace_t *jsdl_ns = NULL;
>>>	axiom_namespace_t *bes_factory_ns= NULL;
>>>	axiom_namespace_t *hpcp_ns=NULL;
>>>	axiom_namespace_t *xml_ns=NULL;
>>>		
>>>	axiom_text_t *om_text=NULL;
>>>	axiom_node_t *text_node=NULL;
>>>	
>>>	/* Body elements */
>>>	
>>>
>>>	axiom_node_t *createactivity_node=NULL,*activity_node=NULL;
>>>	axiom_element_t *createactivity_element=NULL,*activity_element=NULL;
>>>	
>>>	/* JSDL document element declarations */
>>>
>>>	axiom_node_t *jobdefinition_node=NULL,*jobidentification_node=NULL,*jobdescription_node=NULL,*jobname_node=NULL;
>>>	axiom_element_t *jobdefinition_element=NULL,*jobidentification_element=NULL,*jobdescription_element=NULL,*jobname_element=NULL;
>>>
>>>	/* HPCP - Application profile element declarations */
>>>	axiom_node_t *application_node=NULL,*applicationname_node=NULL,*executable_node=NULL,*stdout_node=NULL,*stderr_node=NULL,*working_node=NULL;
>>>	axiom_element_t *application_element=NULL,*applicationname_element=NULL,*executable_element=NULL,*stdout_element=NULL,*stderr_element=NULL,*working_element=NULL;
>>>	axiom_attribute_t *applicationname_attribute=NULL;
>>>
>>>	
>>>	/* Creating all the namespace elements */
>>>
>>>	jsdl_ns=axiom_namespace_create(env,"http://schemas.ggf.org/jsdl/2005/11/jsdl","jsdl");
>>>	bes_factory_ns=axiom_namespace_create(env,"http://schemas.ggf.org/bes/2006/08/bes-factory","bes-factory");
>>>	hpcp_ns=axiom_namespace_create(env,"http://schemas.ggf.org/jsdl/2006/07/jsdl-hpcp","jsdl-hpcp");
>>>	xml_ns=axiom_namespace_create(env,"http://www.w3.org/2001/XMLSchema-instance","xsi");
>>>	
>>>	/* CreateActivity Element */	
>>>
>>>	createactivity_element=axiom_element_create(env,NULL,"CreateActivity",bes_factory_ns,&createactivity_node);
>>>
>>>	/* ActivityDocument element */
>>>
>>>	activity_element=axiom_element_create(env,NULL,"ActivityDocument",bes_factory_ns,&activity_node);
>>>
>>>	jobdefinition_element=axiom_element_create(env,NULL,"JobDefinition",jsdl_ns,&jobdefinition_node);
>>>	jobdescription_element=axiom_element_create(env,NULL,"JobDescription",jsdl_ns,&jobdescription_node);
>>>	
>>>	/* Job Identification element */
>>>
>>>	jobidentification_element=axiom_element_create(env,NULL,"JobIdentifiction",jsdl_ns,&jobidentification_node);
>>>	jobname_element=axiom_element_create(env,NULL,"JObName",jsdl_ns,&jobname_node);
>>>	//jobname_element to jobname_node
>>>       om_text=axiom_text_create(env,jobname_node,"PBSToCCS",&text_node);
>>>	axiom_node_add_child(jobidentification_node,env,jobname_node);
>>>	axiom_node_add_child(jobdescription_node,env,jobidentification_node);
>>>	
>>>	
>>>	application_element=axiom_element_create(env,NULL,"Application",jsdl_ns,&application_node);
>>>	applicationname_element=axiom_element_create(env,NULL,"HPCProfileApplication",hpcp_ns,&applicationname_node);
>>>	applicationname_attribute=axiom_attribute_create(env,"name","Example",NULL);
>>>	axiom_element_add_attribute(applicationname_element,env,applicationname_attribute,applicationname_node);
>>>	
>>>	/* Executable Element */
>>>	
>>>	executable_element=axiom_element_create(env,NULL,"Executable",hpcp_ns,&executable_node);
>>>	om_text=axiom_text_create(env,executable_node,"dir",&text_node);
>>>	axiom_node_add_child(applicationname_node,env,executable_node);
>>>
>>>	/* Stdout element */
>>>	
>>>	stdout_element=axiom_element_create(env,NULL,"Output",hpcp_ns,&stdout_node);
>>>	om_text=axiom_text_create(env,stdout_node,"example.out",&text_node);
>>>	axiom_node_add_child(applicationname_node,env,stdout_node);
>>>
>>>	/* Stderr element */
>>>
>>>	stderr_element= axiom_element_create(env,NULL,"Error",hpcp_ns,&stderr_node);
>>>	om_text=axiom_text_create(env,stderr_node,"example.err",&text_node);
>>>	axiom_node_add_child(applicationname_node,env,stderr_node);
>>>
>>>	/* Working Directory Element */
>>>
>>>	working_element=axiom_element_create(env,NULL,"WorkingDirectory",hpcp_ns,&working_node);
>>>	om_text=axiom_text_create(env,working_node,"c:\\",&text_node);
>>>	axiom_node_add_child(applicationname_node,env,working_node);
>>>	
>>>	
>>>
>>>	axiom_node_add_child(application_node,env,applicationname_node);
>>>	
>>>	axiom_node_add_child(jobdescription_node,env,application_node);
>>>
>>>	
>>>	axiom_node_add_child(jobdefinition_node,env,jobdescription_node);
>>>	
>>>	axiom_node_add_child(activity_node,env,jobdefinition_node);
>>>
>>>
>>>	axiom_node_add_child(createactivity_node,env,activity_node);
>>>	
>>>	axis2_char_t *om_str=NULL;
>>>       om_str = axiom_node_to_string(createactivity_node,env);
>>>	 if(om_str)
>>>        {
>>>                        printf("\n Body Element : %s\n", om_str);
>>>                       AXIS2_FREE(env->allocator, om_str);
>>>	}
>>>	return createactivity_node;
>>>
>>>}
>>>
>>>
>>>int createActivity()
>>>{      	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;
>>>       
>>>       const axutil_env_t *env = NULL;
>>>      const axis2_char_t *address = NULL;
>>>      axis2_char_t *file_name = NULL;
>>>      axis2_char_t *file_name2 = NULL;
>>>      axiom_node_t *payload = NULL;
>>>      axiom_node_t *ret_node = NULL;
>>>      axis2_status_t status = AXIS2_FAILURE;
>>>      neethi_policy_t *policy = NULL;
>>>
>>>
>>>
>>>
>>>
>>>	/* Setup the environment */
>>>	printf("\n1111111111\n");
>>>env = axutil_env_create_all("PBSHPCP.log",AXIS2_LOG_LEVEL_TRACE);
>>>	
>>>	/* Set end point reference of HPCP webservice */
>>>
>>>	address = "https://altair-winccss0.pbsgridworks/HPCBasicProfile/HPCBasicProfile.svc";
>>>	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/divakar/Desktop/examples/murali.cer"));
>>>	axis2_options_set_property(options,env,"SERVER_CERT",server_certificate); 
>>>	
>>>	/* Reading the Client Home from environment */
>>>	client_home = "/usr/local/axis2c";
>>>        
>>>	if (!client_home || !strcmp (client_home, ""))
>>>          client_home=AXIS2_GETENV("AXIS2C_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;
>>>   	}
>>>
>>>	/* Set service client options */
>>>	axis2_svc_client_set_options(svc_client,env,options);
>>>//modifies by div
>>>       printf("\nyour client home %s\n",client_home);
>>>  if(client_home)
>>>   {    
>>>       file_name = axutil_stracat(env, client_home, AXIS2_PATH_SEP_STR);
>>>       printf("%s",file_name);
>>>       file_name2 = axutil_stracat(env, file_name, "examples/client-policy.xml" );
>>>        printf("%s",file_name2);
>>>       AXIS2_FREE(env->allocator, file_name);
>>>       file_name = NULL;        
>>>   }else{
>>>       printf("Client Home not Specified\n");
>>>       printf("echo client invoke FAILED!\n");
>>>       return 0;
>>>   }
>>>   /*Create the policy, from file*/   
>>>   policy =neethi_util_create_policy_from_file(env,file_name2);
>>>   if(file_name2){
>>>       AXIS2_FREE(env->allocator, file_name2);
>>>       file_name2 = NULL;
>>>   }
>>>   if(!policy)
>>>   {
>>>       printf("\nPolicy creation failed from the file. %s\n", file_name2);
>>>       /*printf("echo client invoke FAILED!\n");
>>>       return 0;*/
>>>   }
>>>
>>>   status = axis2_svc_client_set_policy(svc_client, env, policy);
>>>  
>>>   if(status == AXIS2_FAILURE)
>>>   {
>>>       printf("Policy setting failed\n");
>>>   }
>>>   else
>>>     printf("policy setting done"); 
>>>
>>>//end
>>>
>>>
>>>
>>>
>>>
>>>
>>>/*	axis2_svc_client_disengage_module(svc_client,env,AXIS2_MODULE_ADDRESSING); */
>>>	
>>>	
>>>/*	axiom_node_t *header_node=getHeaderNode(env);
>>>	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");
>>>       }
>>>	status=axis2_svc_client_set_target_endpoint_ref(svc_client,env,endpoint_reference);
>>>	if(status==AXIS2_FAILURE)
>>>	{
>>>		printf("Unable to set the endpoint reference");
>>>		return -1;
>>>	}*/
>>>	status=axis2_svc_client_engage_module(svc_client,env,AXIS2_MODULE_RAMPART);
>>>     //axis2_status_t *status=axis2_svc_client_engage_module(svc_client,env,AXIS2_MODULE_ADDRESSING);  
>>>      if(status==AXIS2_FAILURE)
>>>       {
>>>               printf("Unable to add RAMPART element \n");
>>>               return -1;
>>>       }
>>>
>>>	rampart_context_t *rampart=rampart_context_create(env);
>>>	status=rampart_context_set_user(rampart,env,"administrator");
>>>	if(status==AXIS2_FAILURE)
>>>       {
>>>               printf("Unable to set user element ");
>>>               return -1;
>>>       }
>>>
>>>	
>>>	status=rampart_context_set_password(rampart,env,"dummy@786");
>>>	 if(status==AXIS2_FAILURE)
>>>       {
>>>               printf("Unable to set password element ");
>>>               return -1;
>>>       }
>>>
>>>	axiom_node_t *security_node=NULL;
>>>	axiom_namespace_t *wsse_ns=NULL;
>>>	axiom_element_t *security_element=NULL;
>>>	wsse_ns=axiom_namespace_create(env,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd","wsse");	
>>>	security_element=axiom_element_create(env,NULL,"Security",wsse_ns,&security_node);
>>>	status = rampart_username_token_build(env,rampart,security_node,wsse_ns);
>>>	if(status==AXIS2_FAILURE)
>>>       {
>>>               printf("Unable to Add usernametoken element \n");
>>>               return -1;
>>>       }
>>>
>>>	payload=convertPBSToJSDL(env);
>>>
>>>     if(payload==NULL)puts("no pay load");
>>>
>>>	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 FAILED0!\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;
>>>
>>>}
>>>
>>>
>>>
>>>	
>>>int main()
>>>{
>>>	createActivity();
>>>}
>>>	
>>>	
>>>
>>>
>>>	
>>>	
>>>
>>>
>>>
>>>
>>>
>>> 
>>>
>>>------------------------------------------------------------------------
>>>
>>>
>>>[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *request_uri_based_dispatcher added to the index 0 of the phase Transport
>>>[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *addressing_based_dispatcher added to the index 1 of the phase Transport
>>>[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *soap_message_body_based_dispatcher added to the index 0 of the phase Dispatch
>>>[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *soap_action_based_dispatcher added to the index 2 of the phase Dispatch
>>>[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *dispatch_post_conditions_evaluator added to the index 0 of the phase PostDispatch
>>>[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *context_handler added to the index 1 of the phase PostDispatch
>>>[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(220) no custom dispatching order found continue with default dispatching order
>>>[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(326) module addressing found in axis2.xml
>>>[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(326) module rampart found in axis2.xml
>>>[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(672) Transport name:http
>>>[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
>>>[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(672) Transport name:https
>>>[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
>>>[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
>>>[Fri Oct  5 22:08:52 2007] [debug] dir_handler.c(195) No files in the path /usr/local/axis2c/services.
>>>[Fri Oct  5 22:08:52 2007] [debug] dep_engine.c(1042) axis2_dep_engine_load_module_dll: DLL path is : /usr/local/axis2c/modules/addressing/libaxis2_mod_addr.so
>>>[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
>>>[Fri Oct  5 22:08:52 2007] [debug] dep_engine.c(1042) axis2_dep_engine_load_module_dll: DLL path is : /usr/local/axis2c/modules/logging/libaxis2_mod_log.so
>>>[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
>>>[Fri Oct  5 22:08:52 2007] [debug] dep_engine.c(1042) axis2_dep_engine_load_module_dll: DLL path is : /usr/local/axis2c/modules/rampart/libmod_rampart.so
>>>[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingInHandler to phase Transport
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler RampartInHandler to phase PreDispatch
>>>[Fri Oct  5 22:08:52 2007] [info]  [rampart][mod_rampart] mod_rampart initialized
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(117) Service name is : __ANONYMOUS_SERVICE__
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler RampartOutHandler to phase MessageOut
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler RampartOutHandler to phase MessageOut
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler RampartOutHandler to phase MessageOut
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1253) Start:axis2_phase_resolver_engage_module_to_svc
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1257) Module rampart will be engaged to __ANONYMOUS_SERVICE__
>>>[Fri Oct  5 22:08:52 2007] [debug] svc.c(713) Start:axis2_svc_add_module_ops
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(117) Service name is : __ANONYMOUS_SERVICE__
>>>[Fri Oct  5 22:08:52 2007] [debug] svc.c(790) End:axis2_svc_add_module_ops
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1304) Module rampart already engaged to __OPERATION_ROBUST_OUT_ONLY__ of __ANONYMOUS_SERVICE__
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1304) Module rampart already engaged to __OPERATION_OUT_ONLY__ of __ANONYMOUS_SERVICE__
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1304) Module rampart already engaged to __OPERATION_OUT_IN__ of __ANONYMOUS_SERVICE__
>>>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1328) End:axis2_phase_resolver_engage_module_to_svc
>>>[Fri Oct  5 22:08:52 2007] [debug] op_client.c(817) Start:axis2_op_client_infer_transport
>>>[Fri Oct  5 22:08:52 2007] [debug] op_client.c(872) End:axis2_op_client_infer_transport
>>>[Fri Oct  5 22:08:52 2007] [debug] engine.c(654) Start:axis2_engine_invoke_phases
>>>[Fri Oct  5 22:08:52 2007] [debug] engine.c(667) Invoking phase MessageOut
>>>[Fri Oct  5 22:08:52 2007] [debug] phase.c(198) Invoke the handler AddressingOutHandler within the phase MessageOut
>>>[Fri Oct  5 22:08:52 2007] [debug] engine.c(677) End:axis2_engine_invoke_phases
>>>[Fri Oct  5 22:08:52 2007] [info]  [ssl client] Client certificate chain file not specified
>>>[Fri Oct  5 22:08:52 2007] [error] ssl/ssl_utils.c(102) [ssl client] Loading CA certificate failed
>>>[Fri Oct  5 22:08:52 2007] [debug] http_client.c(408) [axis2c] client data stream  null or socket error
>>>[Fri Oct  5 22:08:52 2007] [error] http_sender.c(652) status_code < 0
>>>[Fri Oct  5 22:08:52 2007] [debug] http_transport_sender.c(571) OP name axutil_qname_get_localpart = http://www.w3.org/2004/08/wsdl/out-in
>>>[Fri Oct  5 22:08:52 2007] [error] xmltest.c(424) Stub invoke FAILED: Error code: 82 :: Input stream is NULL in msg_ctx
>>>[Fri Oct  5 22:08:52 2007] [info]  [rampart][mod_rampart] mod_rampart shutdown
>>>
>>> 
>>>
>>>------------------------------------------------------------------------
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>>>For additional commands, e-mail: axis-c-user-help@ws.apache.org
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>>For additional commands, e-mail: axis-c-user-help@ws.apache.org
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>  
>


Re: Problem with invoking a https based service

Posted by Manjula Peiris <ma...@wso2.com>.
Hi divakar,

In your axis2.xml you have commented the following and still engaged
rampart.
<!--phase name="Security"/-->

Please uncomment it and try.

-Manjula.

On Fri, 2007-10-05 at 22:54 +0530, divakar wrote:
> Hi All,
>                If I change axis2.xml like removing message out http 
> protocol and enable https it is giveing rampart security  error. I am 
> sending axis2.xml and log.

> Thanks
> divakar
> 
> 
> 
> divakar wrote:
> 
> > Manjula Peiris:
> >                    Hi,
> >                    I changed as you guided but still getting same. I 
> > am attaching those files log and code please correct me. I think in 
> > log file it showing http error.
> >                   thank
> >                Divakar
> >             
> >
> > Manjula Peiris wrote:
> >
> >> Hi Divakr,
> >>
> >> Looking at your client code I have some problems. In Your client why are
> >> you building the security header on your own? Because if you engage
> >> rampart/c it will do all the necessary things reguarding soap message
> >> security. IMHO following are things you need to do for your scenario.
> >>
> >> 1. Specify CA-Cert as you done in the client code.
> >> 2. Use the policy file as in the
> >> rampart_src_dir/samples/secpolicy/scenario2/policy.xml 3. put it into 
> >> your client-repo
> >> 4. To set policy in your client code please refer to the client code at
> >> rampart_src_dir/samples/client/sec_echo/echo.c
> >>
> >> Thanks,
> >> -Manjula.
> >>
> >>
> >> On Tue, 2007-10-02 at 13:08 +0530, Dumindu Pallewela wrote:
> >>  
> >>
> >>> Hi Divakar,
> >>>
> >>> I could not find why it didn't work for you, according to the logs.
> >>> If you can build Axis2/C from source, you can test if the SSL
> >>> transport (i.e., without any SOAP stuff) is working using the
> >>> test/core/transport/http/test_http_transport.c test case.
> >>>
> >>> Regards,
> >>> Dumindu.
> >>>
> >>> divakar wrote:
> >>>   
> >>>
> >>>> Hi All,
> >>>>
> >>>>            I am facing some problems with invoking a https based .Net
> >>>> webservice using the axis2c client. It is giving the error " Error 
> >>>> code:
> >>>> 82 :: Input stream is NULL in msg_ctx" in the client log file. I am
> >>>> attaching the axis2.xml, client log file & sample program for your
> >>>> reference. Please check the same and let me know, if i am making any
> >>>> mistakes in my client program.
> >>>>
> >>>>
> >>>> Thanks & Regards,
> >>>>
> >>>> Murali Krishna K
> >>>>
> >>>>
> >>>> ------------------------------------------------------------------------ 
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> >>>> For additional commands, e-mail: axis-c-user-help@ws.apache.org
> >>>>     
> >>>
> >>>   
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: axis-c-user-help@ws.apache.org
> >>
> >>  
> >>
> >
> >------------------------------------------------------------------------
> >
> >#include <axiom.h>
> >#include <axis2_util.h>
> >#include <axis2_const.h>
> >#include <axutil_env.h>
> >#include <axutil_log_default.h>
> >#include <axutil_error_default.h>
> >#include <axiom_output.h>
> >#include <axiom_xml_writer.h>
> >#include <stdio.h>
> >#include <axis2_client.h>
> >#include <axiom_soap.h>
> >#include <axiom_soap_envelope.h>
> >#include <rampart_context.h>
> >#include <rampart_username_token.h>
> >#include <axiom_soap_envelope.h>
> >#include <rampart_constants.h>
> >#include <neethi_util.h>
> >#include <neethi_policy.h>
> >
> >axiom_node_t *getHeaderNode(const axutil_env_t *env)
> >{
> >        /* Namespace element declarations */
> >
> >        axiom_namespace_t *wsa_ns= NULL;
> >        axiom_namespace_t *wsse_ns=NULL;
> >        axiom_namespace_t *wsu_ns=NULL;
> >
> >        axiom_node_t *header_node=NULL,*to_node=NULL,*action_node=NULL;
> >	axiom_element_t *header_element=NULL,*to_element=NULL,*action_element=NULL;
> >
> >	axiom_text_t *om_text=NULL;
> >        axiom_node_t *text_node=NULL;
> >        axiom_node_t *security_node=NULL,*usernametoken_node=NULL,*username_node=NULL,*password_node=NULL;
> >        axiom_element_t *security_element=NULL,*usernametoken_element=NULL,*username_element=NULL,*password_element=NULL;
> >        axiom_attribute_t *password_attribute=NULL,*body_attribute=NULL,*to_attribute=NULL;
> >
> >         /* Creating all the namespace elements */
> >
> >        wsa_ns= axiom_namespace_create(env,"http://www.w3.org/2005/08/addressing","wsa");
> >        wsse_ns=axiom_namespace_create(env,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd","wsse");
> >        wsu_ns=axiom_namespace_create(env,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd","wsu");
> >
> >        /* SOAP Header element */
> >	header_element=axiom_element_create(env,NULL,"Header",NULL,&header_node);
> >        security_element=axiom_element_create(env,NULL,"Security",wsse_ns,&security_node);
> >
> >        /* Usernametoken element to pass the username, password to HPCPwebservice */
> >
> >        usernametoken_element=axiom_element_create(env,NULL,"UsernameToken",wsse_ns,&usernametoken_node);
> >        axiom_element_set_namespace(usernametoken_element,env,wsse_ns,usernametoken_node);
> >        username_element=axiom_element_create(env,NULL,"Username",wsse_ns,&username_node);
> >        om_text=axiom_text_create(env,username_node,"PBSGRIDWORKS\\administrator",&text_node);
> >        password_element=axiom_element_create(env,NULL,"Password",wsse_ns,&password_node);
> >        password_attribute=axiom_attribute_create(env,"Type","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText",NULL);
> >        axiom_element_add_attribute(password_element,env,password_attribute,password_node);
> >        om_text=axiom_text_create(env,password_node,"dummy@786",&text_node);
> >        axiom_node_add_child(usernametoken_node,env,username_node);
> >        axiom_node_add_child(usernametoken_node,env,password_node);
> >        axiom_node_add_child(security_node,env,usernametoken_node);
> >
> >        /* End of Usernametoken element */
> >
> >	/*
> >
> >        action_element=axiom_element_create(env,NULL,"Action",wsa_ns,&action_node);
> >        om_text=axiom_text_create(env,action_node,"http://schemas.ggf.org/bes/2006/08/bes-factory/CreateActivity",&text_node);
> >        axiom_node_add_child(header_node,env,action_node);
> >
> >
> >        to_element=axiom_element_create(env,NULL,"To",wsa_ns,&to_node);
> >        to_attribute=axiom_attribute_create(env,"mustUnderstand","1",NULL);
> >        axiom_element_add_attribute(to_element,env,to_attribute,to_node);
> >        om_text=axiom_text_create(env,to_node,"http://OpenSuSe10:8081",&text_node);
> >        
> >	axiom_node_add_child(header_node,env,to_node);
> >	*/
> >	
> >	axis2_char_t *om_str=NULL;
> >        om_str = axiom_node_to_string(security_node,env);
> >         if(om_str)
> >         {
> >                         printf("\n Header Element : %s\n", om_str);
> >                         AXIS2_FREE(env->allocator, om_str);
> >        }
> >
> >
> >
> >        return security_node;
> >}
> >
> >axiom_node_t *ToElement(const axutil_env_t *env)
> >{
> >	axiom_namespace_t *wsa_ns=NULL;
> >	axiom_node_t *to_node=NULL;
> >	axiom_element_t *to_element=NULL;
> >	axiom_attribute_t *to_attribute=NULL;
> >	axiom_node_t *text_node=NULL;
> >	wsa_ns= axiom_namespace_create(env,"http://www.w3.org/2005/08/addressing","wsa");
> >	to_element=axiom_element_create(env,NULL,"To",wsa_ns,&to_node);
> >        to_attribute=axiom_attribute_create(env,"mustUnderstand","1",NULL);
> >        axiom_element_add_attribute(to_element,env,to_attribute,to_node);
> >        axiom_text_t *om_text=axiom_text_create(env,to_node,"http://www.murali.com/BESFactory",&text_node);
> >	axis2_char_t *om_str = axiom_node_to_string(to_node,env);
> >         if(om_str)
> >         {
> >                         printf("\n To Element : %s\n", om_str);
> >                         AXIS2_FREE(env->allocator, om_str);
> >        }
> >	return to_node;
> >}
> >
> >
> >
> >
> >axiom_node_t* convertPBSToJSDL(const axutil_env_t *env)
> >{
> >
> >
> >	/* Namespace element declarations */
> >
> >	axiom_namespace_t *jsdl_ns = NULL;
> >	axiom_namespace_t *bes_factory_ns= NULL;
> >	axiom_namespace_t *hpcp_ns=NULL;
> >	axiom_namespace_t *xml_ns=NULL;
> >		
> >	axiom_text_t *om_text=NULL;
> >	axiom_node_t *text_node=NULL;
> >	
> >	/* Body elements */
> >	
> >
> >	axiom_node_t *createactivity_node=NULL,*activity_node=NULL;
> >	axiom_element_t *createactivity_element=NULL,*activity_element=NULL;
> >	
> >	/* JSDL document element declarations */
> >
> >	axiom_node_t *jobdefinition_node=NULL,*jobidentification_node=NULL,*jobdescription_node=NULL,*jobname_node=NULL;
> >	axiom_element_t *jobdefinition_element=NULL,*jobidentification_element=NULL,*jobdescription_element=NULL,*jobname_element=NULL;
> >
> >	/* HPCP - Application profile element declarations */
> >	axiom_node_t *application_node=NULL,*applicationname_node=NULL,*executable_node=NULL,*stdout_node=NULL,*stderr_node=NULL,*working_node=NULL;
> >	axiom_element_t *application_element=NULL,*applicationname_element=NULL,*executable_element=NULL,*stdout_element=NULL,*stderr_element=NULL,*working_element=NULL;
> >	axiom_attribute_t *applicationname_attribute=NULL;
> >
> >	
> >	/* Creating all the namespace elements */
> >
> >	jsdl_ns=axiom_namespace_create(env,"http://schemas.ggf.org/jsdl/2005/11/jsdl","jsdl");
> >	bes_factory_ns=axiom_namespace_create(env,"http://schemas.ggf.org/bes/2006/08/bes-factory","bes-factory");
> >	hpcp_ns=axiom_namespace_create(env,"http://schemas.ggf.org/jsdl/2006/07/jsdl-hpcp","jsdl-hpcp");
> >	xml_ns=axiom_namespace_create(env,"http://www.w3.org/2001/XMLSchema-instance","xsi");
> >	
> >	/* CreateActivity Element */	
> >
> >	createactivity_element=axiom_element_create(env,NULL,"CreateActivity",bes_factory_ns,&createactivity_node);
> >
> >	/* ActivityDocument element */
> >
> >	activity_element=axiom_element_create(env,NULL,"ActivityDocument",bes_factory_ns,&activity_node);
> >
> >	jobdefinition_element=axiom_element_create(env,NULL,"JobDefinition",jsdl_ns,&jobdefinition_node);
> >	jobdescription_element=axiom_element_create(env,NULL,"JobDescription",jsdl_ns,&jobdescription_node);
> >	
> >	/* Job Identification element */
> >
> >	jobidentification_element=axiom_element_create(env,NULL,"JobIdentifiction",jsdl_ns,&jobidentification_node);
> >	jobname_element=axiom_element_create(env,NULL,"JObName",jsdl_ns,&jobname_node);
> >	//jobname_element to jobname_node
> >        om_text=axiom_text_create(env,jobname_node,"PBSToCCS",&text_node);
> >	axiom_node_add_child(jobidentification_node,env,jobname_node);
> >	axiom_node_add_child(jobdescription_node,env,jobidentification_node);
> >	
> >	
> >	application_element=axiom_element_create(env,NULL,"Application",jsdl_ns,&application_node);
> >	applicationname_element=axiom_element_create(env,NULL,"HPCProfileApplication",hpcp_ns,&applicationname_node);
> >	applicationname_attribute=axiom_attribute_create(env,"name","Example",NULL);
> >	axiom_element_add_attribute(applicationname_element,env,applicationname_attribute,applicationname_node);
> >	
> >	/* Executable Element */
> >	
> >	executable_element=axiom_element_create(env,NULL,"Executable",hpcp_ns,&executable_node);
> >	om_text=axiom_text_create(env,executable_node,"dir",&text_node);
> >	axiom_node_add_child(applicationname_node,env,executable_node);
> >
> >	/* Stdout element */
> >	
> >	stdout_element=axiom_element_create(env,NULL,"Output",hpcp_ns,&stdout_node);
> >	om_text=axiom_text_create(env,stdout_node,"example.out",&text_node);
> >	axiom_node_add_child(applicationname_node,env,stdout_node);
> >
> >	/* Stderr element */
> >
> >	stderr_element= axiom_element_create(env,NULL,"Error",hpcp_ns,&stderr_node);
> >	om_text=axiom_text_create(env,stderr_node,"example.err",&text_node);
> >	axiom_node_add_child(applicationname_node,env,stderr_node);
> >
> >	/* Working Directory Element */
> >
> >	working_element=axiom_element_create(env,NULL,"WorkingDirectory",hpcp_ns,&working_node);
> >	om_text=axiom_text_create(env,working_node,"c:\\",&text_node);
> >	axiom_node_add_child(applicationname_node,env,working_node);
> >	
> >	
> >
> >	axiom_node_add_child(application_node,env,applicationname_node);
> >	
> >	axiom_node_add_child(jobdescription_node,env,application_node);
> >
> >	
> >	axiom_node_add_child(jobdefinition_node,env,jobdescription_node);
> >	
> >	axiom_node_add_child(activity_node,env,jobdefinition_node);
> >
> >
> >	axiom_node_add_child(createactivity_node,env,activity_node);
> >	
> >	axis2_char_t *om_str=NULL;
> >        om_str = axiom_node_to_string(createactivity_node,env);
> >	 if(om_str)
> >         {
> >                         printf("\n Body Element : %s\n", om_str);
> >                        AXIS2_FREE(env->allocator, om_str);
> >	}
> >	return createactivity_node;
> >
> >}
> >
> >
> >int createActivity()
> >{      	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;
> >        
> >        const axutil_env_t *env = NULL;
> >       const axis2_char_t *address = NULL;
> >       axis2_char_t *file_name = NULL;
> >       axis2_char_t *file_name2 = NULL;
> >       axiom_node_t *payload = NULL;
> >       axiom_node_t *ret_node = NULL;
> >       axis2_status_t status = AXIS2_FAILURE;
> >       neethi_policy_t *policy = NULL;
> >
> >
> >
> >
> > 
> >	/* Setup the environment */
> >	printf("\n1111111111\n");
> >env = axutil_env_create_all("PBSHPCP.log",AXIS2_LOG_LEVEL_TRACE);
> >	
> >	/* Set end point reference of HPCP webservice */
> >
> >	address = "https://altair-winccss0.pbsgridworks/HPCBasicProfile/HPCBasicProfile.svc";
> >	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/divakar/Desktop/examples/murali.cer"));
> >	axis2_options_set_property(options,env,"SERVER_CERT",server_certificate); 
> >	
> >	/* Reading the Client Home from environment */
> >	client_home = "/usr/local/axis2c";
> >         
> >	if (!client_home || !strcmp (client_home, ""))
> >           client_home=AXIS2_GETENV("AXIS2C_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;
> >    	}
> >
> >	/* Set service client options */
> >	axis2_svc_client_set_options(svc_client,env,options);
> >//modifies by div
> >        printf("\nyour client home %s\n",client_home);
> >   if(client_home)
> >    {    
> >        file_name = axutil_stracat(env, client_home, AXIS2_PATH_SEP_STR);
> >        printf("%s",file_name);
> >        file_name2 = axutil_stracat(env, file_name, "examples/client-policy.xml" );
> >         printf("%s",file_name2);
> >        AXIS2_FREE(env->allocator, file_name);
> >        file_name = NULL;        
> >    }else{
> >        printf("Client Home not Specified\n");
> >        printf("echo client invoke FAILED!\n");
> >        return 0;
> >    }
> >    /*Create the policy, from file*/   
> >    policy =neethi_util_create_policy_from_file(env,file_name2);
> >    if(file_name2){
> >        AXIS2_FREE(env->allocator, file_name2);
> >        file_name2 = NULL;
> >    }
> >    if(!policy)
> >    {
> >        printf("\nPolicy creation failed from the file. %s\n", file_name2);
> >        /*printf("echo client invoke FAILED!\n");
> >        return 0;*/
> >    }
> >
> >    status = axis2_svc_client_set_policy(svc_client, env, policy);
> >   
> >    if(status == AXIS2_FAILURE)
> >    {
> >        printf("Policy setting failed\n");
> >    }
> >    else
> >      printf("policy setting done"); 
> >
> >//end
> >
> >
> >
> >
> >
> >
> >/*	axis2_svc_client_disengage_module(svc_client,env,AXIS2_MODULE_ADDRESSING); */
> >	
> >	
> >/*	axiom_node_t *header_node=getHeaderNode(env);
> >	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");
> >        }
> >	status=axis2_svc_client_set_target_endpoint_ref(svc_client,env,endpoint_reference);
> >	if(status==AXIS2_FAILURE)
> >	{
> >		printf("Unable to set the endpoint reference");
> >		return -1;
> >	}*/
> >	status=axis2_svc_client_engage_module(svc_client,env,AXIS2_MODULE_RAMPART);
> >      //axis2_status_t *status=axis2_svc_client_engage_module(svc_client,env,AXIS2_MODULE_ADDRESSING);  
> >       if(status==AXIS2_FAILURE)
> >        {
> >                printf("Unable to add RAMPART element \n");
> >                return -1;
> >        }
> >
> >	rampart_context_t *rampart=rampart_context_create(env);
> >	status=rampart_context_set_user(rampart,env,"administrator");
> >	if(status==AXIS2_FAILURE)
> >        {
> >                printf("Unable to set user element ");
> >                return -1;
> >        }
> >
> >	
> >	status=rampart_context_set_password(rampart,env,"dummy@786");
> >	 if(status==AXIS2_FAILURE)
> >        {
> >                printf("Unable to set password element ");
> >                return -1;
> >        }
> >
> >	axiom_node_t *security_node=NULL;
> >	axiom_namespace_t *wsse_ns=NULL;
> >	axiom_element_t *security_element=NULL;
> >	wsse_ns=axiom_namespace_create(env,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd","wsse");	
> >	security_element=axiom_element_create(env,NULL,"Security",wsse_ns,&security_node);
> >	status = rampart_username_token_build(env,rampart,security_node,wsse_ns);
> >	if(status==AXIS2_FAILURE)
> >        {
> >                printf("Unable to Add usernametoken element \n");
> >                return -1;
> >        }
> >
> >	payload=convertPBSToJSDL(env);
> >
> >      if(payload==NULL)puts("no pay load");
> >
> >	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 FAILED0!\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;
> >
> >}
> >
> >
> >
> >	
> >int main()
> >{
> >	createActivity();
> >}
> >	
> >	
> >
> >
> >	
> >	
> >
> >
> >
> >
> >
> >  
> >
> >------------------------------------------------------------------------
> >
> >
> >[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *request_uri_based_dispatcher added to the index 0 of the phase Transport
> >[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *addressing_based_dispatcher added to the index 1 of the phase Transport
> >[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *soap_message_body_based_dispatcher added to the index 0 of the phase Dispatch
> >[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *soap_action_based_dispatcher added to the index 2 of the phase Dispatch
> >[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *dispatch_post_conditions_evaluator added to the index 0 of the phase PostDispatch
> >[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *context_handler added to the index 1 of the phase PostDispatch
> >[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(220) no custom dispatching order found continue with default dispatching order
> >[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(326) module addressing found in axis2.xml
> >[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(326) module rampart found in axis2.xml
> >[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(672) Transport name:http
> >[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
> >[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(672) Transport name:https
> >[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
> >[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
> >[Fri Oct  5 22:08:52 2007] [debug] dir_handler.c(195) No files in the path /usr/local/axis2c/services.
> >[Fri Oct  5 22:08:52 2007] [debug] dep_engine.c(1042) axis2_dep_engine_load_module_dll: DLL path is : /usr/local/axis2c/modules/addressing/libaxis2_mod_addr.so
> >[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
> >[Fri Oct  5 22:08:52 2007] [debug] dep_engine.c(1042) axis2_dep_engine_load_module_dll: DLL path is : /usr/local/axis2c/modules/logging/libaxis2_mod_log.so
> >[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
> >[Fri Oct  5 22:08:52 2007] [debug] dep_engine.c(1042) axis2_dep_engine_load_module_dll: DLL path is : /usr/local/axis2c/modules/rampart/libmod_rampart.so
> >[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
> >[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingInHandler to phase Transport
> >[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler RampartInHandler to phase PreDispatch
> >[Fri Oct  5 22:08:52 2007] [info]  [rampart][mod_rampart] mod_rampart initialized
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(117) Service name is : __ANONYMOUS_SERVICE__
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
> >[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
> >[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
> >[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler RampartOutHandler to phase MessageOut
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
> >[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
> >[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
> >[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler RampartOutHandler to phase MessageOut
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
> >[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
> >[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
> >[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler RampartOutHandler to phase MessageOut
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1253) Start:axis2_phase_resolver_engage_module_to_svc
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1257) Module rampart will be engaged to __ANONYMOUS_SERVICE__
> >[Fri Oct  5 22:08:52 2007] [debug] svc.c(713) Start:axis2_svc_add_module_ops
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(117) Service name is : __ANONYMOUS_SERVICE__
> >[Fri Oct  5 22:08:52 2007] [debug] svc.c(790) End:axis2_svc_add_module_ops
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1304) Module rampart already engaged to __OPERATION_ROBUST_OUT_ONLY__ of __ANONYMOUS_SERVICE__
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1304) Module rampart already engaged to __OPERATION_OUT_ONLY__ of __ANONYMOUS_SERVICE__
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1304) Module rampart already engaged to __OPERATION_OUT_IN__ of __ANONYMOUS_SERVICE__
> >[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1328) End:axis2_phase_resolver_engage_module_to_svc
> >[Fri Oct  5 22:08:52 2007] [debug] op_client.c(817) Start:axis2_op_client_infer_transport
> >[Fri Oct  5 22:08:52 2007] [debug] op_client.c(872) End:axis2_op_client_infer_transport
> >[Fri Oct  5 22:08:52 2007] [debug] engine.c(654) Start:axis2_engine_invoke_phases
> >[Fri Oct  5 22:08:52 2007] [debug] engine.c(667) Invoking phase MessageOut
> >[Fri Oct  5 22:08:52 2007] [debug] phase.c(198) Invoke the handler AddressingOutHandler within the phase MessageOut
> >[Fri Oct  5 22:08:52 2007] [debug] engine.c(677) End:axis2_engine_invoke_phases
> >[Fri Oct  5 22:08:52 2007] [info]  [ssl client] Client certificate chain file not specified
> >[Fri Oct  5 22:08:52 2007] [error] ssl/ssl_utils.c(102) [ssl client] Loading CA certificate failed
> >[Fri Oct  5 22:08:52 2007] [debug] http_client.c(408) [axis2c] client data stream  null or socket error
> >[Fri Oct  5 22:08:52 2007] [error] http_sender.c(652) status_code < 0
> >[Fri Oct  5 22:08:52 2007] [debug] http_transport_sender.c(571) OP name axutil_qname_get_localpart = http://www.w3.org/2004/08/wsdl/out-in
> >[Fri Oct  5 22:08:52 2007] [error] xmltest.c(424) Stub invoke FAILED: Error code: 82 :: Input stream is NULL in msg_ctx
> >[Fri Oct  5 22:08:52 2007] [info]  [rampart][mod_rampart] mod_rampart shutdown
> >
> >  
> >
> >------------------------------------------------------------------------
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> >For additional commands, e-mail: axis-c-user-help@ws.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org


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


Re: Problem with invoking a https based service

Posted by divakar <di...@india.altair.com>.
Hi All,
               If I change axis2.xml like removing message out http 
protocol and enable https it is giveing rampart security  error. I am 
sending axis2.xml and log.

Thanks
divakar



divakar wrote:

> Manjula Peiris:
>                    Hi,
>                    I changed as you guided but still getting same. I 
> am attaching those files log and code please correct me. I think in 
> log file it showing http error.
>                   thank
>                Divakar
>             
>
> Manjula Peiris wrote:
>
>> Hi Divakr,
>>
>> Looking at your client code I have some problems. In Your client why are
>> you building the security header on your own? Because if you engage
>> rampart/c it will do all the necessary things reguarding soap message
>> security. IMHO following are things you need to do for your scenario.
>>
>> 1. Specify CA-Cert as you done in the client code.
>> 2. Use the policy file as in the
>> rampart_src_dir/samples/secpolicy/scenario2/policy.xml 3. put it into 
>> your client-repo
>> 4. To set policy in your client code please refer to the client code at
>> rampart_src_dir/samples/client/sec_echo/echo.c
>>
>> Thanks,
>> -Manjula.
>>
>>
>> On Tue, 2007-10-02 at 13:08 +0530, Dumindu Pallewela wrote:
>>  
>>
>>> Hi Divakar,
>>>
>>> I could not find why it didn't work for you, according to the logs.
>>> If you can build Axis2/C from source, you can test if the SSL
>>> transport (i.e., without any SOAP stuff) is working using the
>>> test/core/transport/http/test_http_transport.c test case.
>>>
>>> Regards,
>>> Dumindu.
>>>
>>> divakar wrote:
>>>   
>>>
>>>> Hi All,
>>>>
>>>>            I am facing some problems with invoking a https based .Net
>>>> webservice using the axis2c client. It is giving the error " Error 
>>>> code:
>>>> 82 :: Input stream is NULL in msg_ctx" in the client log file. I am
>>>> attaching the axis2.xml, client log file & sample program for your
>>>> reference. Please check the same and let me know, if i am making any
>>>> mistakes in my client program.
>>>>
>>>>
>>>> Thanks & Regards,
>>>>
>>>> Murali Krishna K
>>>>
>>>>
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>>>> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>>>>     
>>>
>>>   
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>>
>>  
>>
>
>------------------------------------------------------------------------
>
>#include <axiom.h>
>#include <axis2_util.h>
>#include <axis2_const.h>
>#include <axutil_env.h>
>#include <axutil_log_default.h>
>#include <axutil_error_default.h>
>#include <axiom_output.h>
>#include <axiom_xml_writer.h>
>#include <stdio.h>
>#include <axis2_client.h>
>#include <axiom_soap.h>
>#include <axiom_soap_envelope.h>
>#include <rampart_context.h>
>#include <rampart_username_token.h>
>#include <axiom_soap_envelope.h>
>#include <rampart_constants.h>
>#include <neethi_util.h>
>#include <neethi_policy.h>
>
>axiom_node_t *getHeaderNode(const axutil_env_t *env)
>{
>        /* Namespace element declarations */
>
>        axiom_namespace_t *wsa_ns= NULL;
>        axiom_namespace_t *wsse_ns=NULL;
>        axiom_namespace_t *wsu_ns=NULL;
>
>        axiom_node_t *header_node=NULL,*to_node=NULL,*action_node=NULL;
>	axiom_element_t *header_element=NULL,*to_element=NULL,*action_element=NULL;
>
>	axiom_text_t *om_text=NULL;
>        axiom_node_t *text_node=NULL;
>        axiom_node_t *security_node=NULL,*usernametoken_node=NULL,*username_node=NULL,*password_node=NULL;
>        axiom_element_t *security_element=NULL,*usernametoken_element=NULL,*username_element=NULL,*password_element=NULL;
>        axiom_attribute_t *password_attribute=NULL,*body_attribute=NULL,*to_attribute=NULL;
>
>         /* Creating all the namespace elements */
>
>        wsa_ns= axiom_namespace_create(env,"http://www.w3.org/2005/08/addressing","wsa");
>        wsse_ns=axiom_namespace_create(env,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd","wsse");
>        wsu_ns=axiom_namespace_create(env,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd","wsu");
>
>        /* SOAP Header element */
>	header_element=axiom_element_create(env,NULL,"Header",NULL,&header_node);
>        security_element=axiom_element_create(env,NULL,"Security",wsse_ns,&security_node);
>
>        /* Usernametoken element to pass the username, password to HPCPwebservice */
>
>        usernametoken_element=axiom_element_create(env,NULL,"UsernameToken",wsse_ns,&usernametoken_node);
>        axiom_element_set_namespace(usernametoken_element,env,wsse_ns,usernametoken_node);
>        username_element=axiom_element_create(env,NULL,"Username",wsse_ns,&username_node);
>        om_text=axiom_text_create(env,username_node,"PBSGRIDWORKS\\administrator",&text_node);
>        password_element=axiom_element_create(env,NULL,"Password",wsse_ns,&password_node);
>        password_attribute=axiom_attribute_create(env,"Type","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText",NULL);
>        axiom_element_add_attribute(password_element,env,password_attribute,password_node);
>        om_text=axiom_text_create(env,password_node,"dummy@786",&text_node);
>        axiom_node_add_child(usernametoken_node,env,username_node);
>        axiom_node_add_child(usernametoken_node,env,password_node);
>        axiom_node_add_child(security_node,env,usernametoken_node);
>
>        /* End of Usernametoken element */
>
>	/*
>
>        action_element=axiom_element_create(env,NULL,"Action",wsa_ns,&action_node);
>        om_text=axiom_text_create(env,action_node,"http://schemas.ggf.org/bes/2006/08/bes-factory/CreateActivity",&text_node);
>        axiom_node_add_child(header_node,env,action_node);
>
>
>        to_element=axiom_element_create(env,NULL,"To",wsa_ns,&to_node);
>        to_attribute=axiom_attribute_create(env,"mustUnderstand","1",NULL);
>        axiom_element_add_attribute(to_element,env,to_attribute,to_node);
>        om_text=axiom_text_create(env,to_node,"http://OpenSuSe10:8081",&text_node);
>        
>	axiom_node_add_child(header_node,env,to_node);
>	*/
>	
>	axis2_char_t *om_str=NULL;
>        om_str = axiom_node_to_string(security_node,env);
>         if(om_str)
>         {
>                         printf("\n Header Element : %s\n", om_str);
>                         AXIS2_FREE(env->allocator, om_str);
>        }
>
>
>
>        return security_node;
>}
>
>axiom_node_t *ToElement(const axutil_env_t *env)
>{
>	axiom_namespace_t *wsa_ns=NULL;
>	axiom_node_t *to_node=NULL;
>	axiom_element_t *to_element=NULL;
>	axiom_attribute_t *to_attribute=NULL;
>	axiom_node_t *text_node=NULL;
>	wsa_ns= axiom_namespace_create(env,"http://www.w3.org/2005/08/addressing","wsa");
>	to_element=axiom_element_create(env,NULL,"To",wsa_ns,&to_node);
>        to_attribute=axiom_attribute_create(env,"mustUnderstand","1",NULL);
>        axiom_element_add_attribute(to_element,env,to_attribute,to_node);
>        axiom_text_t *om_text=axiom_text_create(env,to_node,"http://www.murali.com/BESFactory",&text_node);
>	axis2_char_t *om_str = axiom_node_to_string(to_node,env);
>         if(om_str)
>         {
>                         printf("\n To Element : %s\n", om_str);
>                         AXIS2_FREE(env->allocator, om_str);
>        }
>	return to_node;
>}
>
>
>
>
>axiom_node_t* convertPBSToJSDL(const axutil_env_t *env)
>{
>
>
>	/* Namespace element declarations */
>
>	axiom_namespace_t *jsdl_ns = NULL;
>	axiom_namespace_t *bes_factory_ns= NULL;
>	axiom_namespace_t *hpcp_ns=NULL;
>	axiom_namespace_t *xml_ns=NULL;
>		
>	axiom_text_t *om_text=NULL;
>	axiom_node_t *text_node=NULL;
>	
>	/* Body elements */
>	
>
>	axiom_node_t *createactivity_node=NULL,*activity_node=NULL;
>	axiom_element_t *createactivity_element=NULL,*activity_element=NULL;
>	
>	/* JSDL document element declarations */
>
>	axiom_node_t *jobdefinition_node=NULL,*jobidentification_node=NULL,*jobdescription_node=NULL,*jobname_node=NULL;
>	axiom_element_t *jobdefinition_element=NULL,*jobidentification_element=NULL,*jobdescription_element=NULL,*jobname_element=NULL;
>
>	/* HPCP - Application profile element declarations */
>	axiom_node_t *application_node=NULL,*applicationname_node=NULL,*executable_node=NULL,*stdout_node=NULL,*stderr_node=NULL,*working_node=NULL;
>	axiom_element_t *application_element=NULL,*applicationname_element=NULL,*executable_element=NULL,*stdout_element=NULL,*stderr_element=NULL,*working_element=NULL;
>	axiom_attribute_t *applicationname_attribute=NULL;
>
>	
>	/* Creating all the namespace elements */
>
>	jsdl_ns=axiom_namespace_create(env,"http://schemas.ggf.org/jsdl/2005/11/jsdl","jsdl");
>	bes_factory_ns=axiom_namespace_create(env,"http://schemas.ggf.org/bes/2006/08/bes-factory","bes-factory");
>	hpcp_ns=axiom_namespace_create(env,"http://schemas.ggf.org/jsdl/2006/07/jsdl-hpcp","jsdl-hpcp");
>	xml_ns=axiom_namespace_create(env,"http://www.w3.org/2001/XMLSchema-instance","xsi");
>	
>	/* CreateActivity Element */	
>
>	createactivity_element=axiom_element_create(env,NULL,"CreateActivity",bes_factory_ns,&createactivity_node);
>
>	/* ActivityDocument element */
>
>	activity_element=axiom_element_create(env,NULL,"ActivityDocument",bes_factory_ns,&activity_node);
>
>	jobdefinition_element=axiom_element_create(env,NULL,"JobDefinition",jsdl_ns,&jobdefinition_node);
>	jobdescription_element=axiom_element_create(env,NULL,"JobDescription",jsdl_ns,&jobdescription_node);
>	
>	/* Job Identification element */
>
>	jobidentification_element=axiom_element_create(env,NULL,"JobIdentifiction",jsdl_ns,&jobidentification_node);
>	jobname_element=axiom_element_create(env,NULL,"JObName",jsdl_ns,&jobname_node);
>	//jobname_element to jobname_node
>        om_text=axiom_text_create(env,jobname_node,"PBSToCCS",&text_node);
>	axiom_node_add_child(jobidentification_node,env,jobname_node);
>	axiom_node_add_child(jobdescription_node,env,jobidentification_node);
>	
>	
>	application_element=axiom_element_create(env,NULL,"Application",jsdl_ns,&application_node);
>	applicationname_element=axiom_element_create(env,NULL,"HPCProfileApplication",hpcp_ns,&applicationname_node);
>	applicationname_attribute=axiom_attribute_create(env,"name","Example",NULL);
>	axiom_element_add_attribute(applicationname_element,env,applicationname_attribute,applicationname_node);
>	
>	/* Executable Element */
>	
>	executable_element=axiom_element_create(env,NULL,"Executable",hpcp_ns,&executable_node);
>	om_text=axiom_text_create(env,executable_node,"dir",&text_node);
>	axiom_node_add_child(applicationname_node,env,executable_node);
>
>	/* Stdout element */
>	
>	stdout_element=axiom_element_create(env,NULL,"Output",hpcp_ns,&stdout_node);
>	om_text=axiom_text_create(env,stdout_node,"example.out",&text_node);
>	axiom_node_add_child(applicationname_node,env,stdout_node);
>
>	/* Stderr element */
>
>	stderr_element= axiom_element_create(env,NULL,"Error",hpcp_ns,&stderr_node);
>	om_text=axiom_text_create(env,stderr_node,"example.err",&text_node);
>	axiom_node_add_child(applicationname_node,env,stderr_node);
>
>	/* Working Directory Element */
>
>	working_element=axiom_element_create(env,NULL,"WorkingDirectory",hpcp_ns,&working_node);
>	om_text=axiom_text_create(env,working_node,"c:\\",&text_node);
>	axiom_node_add_child(applicationname_node,env,working_node);
>	
>	
>
>	axiom_node_add_child(application_node,env,applicationname_node);
>	
>	axiom_node_add_child(jobdescription_node,env,application_node);
>
>	
>	axiom_node_add_child(jobdefinition_node,env,jobdescription_node);
>	
>	axiom_node_add_child(activity_node,env,jobdefinition_node);
>
>
>	axiom_node_add_child(createactivity_node,env,activity_node);
>	
>	axis2_char_t *om_str=NULL;
>        om_str = axiom_node_to_string(createactivity_node,env);
>	 if(om_str)
>         {
>                         printf("\n Body Element : %s\n", om_str);
>                        AXIS2_FREE(env->allocator, om_str);
>	}
>	return createactivity_node;
>
>}
>
>
>int createActivity()
>{      	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;
>        
>        const axutil_env_t *env = NULL;
>       const axis2_char_t *address = NULL;
>       axis2_char_t *file_name = NULL;
>       axis2_char_t *file_name2 = NULL;
>       axiom_node_t *payload = NULL;
>       axiom_node_t *ret_node = NULL;
>       axis2_status_t status = AXIS2_FAILURE;
>       neethi_policy_t *policy = NULL;
>
>
>
>
> 
>	/* Setup the environment */
>	printf("\n1111111111\n");
>env = axutil_env_create_all("PBSHPCP.log",AXIS2_LOG_LEVEL_TRACE);
>	
>	/* Set end point reference of HPCP webservice */
>
>	address = "https://altair-winccss0.pbsgridworks/HPCBasicProfile/HPCBasicProfile.svc";
>	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/divakar/Desktop/examples/murali.cer"));
>	axis2_options_set_property(options,env,"SERVER_CERT",server_certificate); 
>	
>	/* Reading the Client Home from environment */
>	client_home = "/usr/local/axis2c";
>         
>	if (!client_home || !strcmp (client_home, ""))
>           client_home=AXIS2_GETENV("AXIS2C_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;
>    	}
>
>	/* Set service client options */
>	axis2_svc_client_set_options(svc_client,env,options);
>//modifies by div
>        printf("\nyour client home %s\n",client_home);
>   if(client_home)
>    {    
>        file_name = axutil_stracat(env, client_home, AXIS2_PATH_SEP_STR);
>        printf("%s",file_name);
>        file_name2 = axutil_stracat(env, file_name, "examples/client-policy.xml" );
>         printf("%s",file_name2);
>        AXIS2_FREE(env->allocator, file_name);
>        file_name = NULL;        
>    }else{
>        printf("Client Home not Specified\n");
>        printf("echo client invoke FAILED!\n");
>        return 0;
>    }
>    /*Create the policy, from file*/   
>    policy =neethi_util_create_policy_from_file(env,file_name2);
>    if(file_name2){
>        AXIS2_FREE(env->allocator, file_name2);
>        file_name2 = NULL;
>    }
>    if(!policy)
>    {
>        printf("\nPolicy creation failed from the file. %s\n", file_name2);
>        /*printf("echo client invoke FAILED!\n");
>        return 0;*/
>    }
>
>    status = axis2_svc_client_set_policy(svc_client, env, policy);
>   
>    if(status == AXIS2_FAILURE)
>    {
>        printf("Policy setting failed\n");
>    }
>    else
>      printf("policy setting done"); 
>
>//end
>
>
>
>
>
>
>/*	axis2_svc_client_disengage_module(svc_client,env,AXIS2_MODULE_ADDRESSING); */
>	
>	
>/*	axiom_node_t *header_node=getHeaderNode(env);
>	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");
>        }
>	status=axis2_svc_client_set_target_endpoint_ref(svc_client,env,endpoint_reference);
>	if(status==AXIS2_FAILURE)
>	{
>		printf("Unable to set the endpoint reference");
>		return -1;
>	}*/
>	status=axis2_svc_client_engage_module(svc_client,env,AXIS2_MODULE_RAMPART);
>      //axis2_status_t *status=axis2_svc_client_engage_module(svc_client,env,AXIS2_MODULE_ADDRESSING);  
>       if(status==AXIS2_FAILURE)
>        {
>                printf("Unable to add RAMPART element \n");
>                return -1;
>        }
>
>	rampart_context_t *rampart=rampart_context_create(env);
>	status=rampart_context_set_user(rampart,env,"administrator");
>	if(status==AXIS2_FAILURE)
>        {
>                printf("Unable to set user element ");
>                return -1;
>        }
>
>	
>	status=rampart_context_set_password(rampart,env,"dummy@786");
>	 if(status==AXIS2_FAILURE)
>        {
>                printf("Unable to set password element ");
>                return -1;
>        }
>
>	axiom_node_t *security_node=NULL;
>	axiom_namespace_t *wsse_ns=NULL;
>	axiom_element_t *security_element=NULL;
>	wsse_ns=axiom_namespace_create(env,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd","wsse");	
>	security_element=axiom_element_create(env,NULL,"Security",wsse_ns,&security_node);
>	status = rampart_username_token_build(env,rampart,security_node,wsse_ns);
>	if(status==AXIS2_FAILURE)
>        {
>                printf("Unable to Add usernametoken element \n");
>                return -1;
>        }
>
>	payload=convertPBSToJSDL(env);
>
>      if(payload==NULL)puts("no pay load");
>
>	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 FAILED0!\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;
>
>}
>
>
>
>	
>int main()
>{
>	createActivity();
>}
>	
>	
>
>
>	
>	
>
>
>
>
>
>  
>
>------------------------------------------------------------------------
>
>
>[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *request_uri_based_dispatcher added to the index 0 of the phase Transport
>[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *addressing_based_dispatcher added to the index 1 of the phase Transport
>[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *soap_message_body_based_dispatcher added to the index 0 of the phase Dispatch
>[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *soap_action_based_dispatcher added to the index 2 of the phase Dispatch
>[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *dispatch_post_conditions_evaluator added to the index 0 of the phase PostDispatch
>[Fri Oct  5 22:08:52 2007] [debug] phase.c(116) axis2_handler_t *context_handler added to the index 1 of the phase PostDispatch
>[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(220) no custom dispatching order found continue with default dispatching order
>[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(326) module addressing found in axis2.xml
>[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(326) module rampart found in axis2.xml
>[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(672) Transport name:http
>[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
>[Fri Oct  5 22:08:52 2007] [debug] conf_builder.c(672) Transport name:https
>[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
>[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
>[Fri Oct  5 22:08:52 2007] [debug] dir_handler.c(195) No files in the path /usr/local/axis2c/services.
>[Fri Oct  5 22:08:52 2007] [debug] dep_engine.c(1042) axis2_dep_engine_load_module_dll: DLL path is : /usr/local/axis2c/modules/addressing/libaxis2_mod_addr.so
>[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
>[Fri Oct  5 22:08:52 2007] [debug] dep_engine.c(1042) axis2_dep_engine_load_module_dll: DLL path is : /usr/local/axis2c/modules/logging/libaxis2_mod_log.so
>[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
>[Fri Oct  5 22:08:52 2007] [debug] dep_engine.c(1042) axis2_dep_engine_load_module_dll: DLL path is : /usr/local/axis2c/modules/rampart/libmod_rampart.so
>[Fri Oct  5 22:08:52 2007] [debug] class_loader.c(135) Object loaded successfully
>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingInHandler to phase Transport
>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler RampartInHandler to phase PreDispatch
>[Fri Oct  5 22:08:52 2007] [info]  [rampart][mod_rampart] mod_rampart initialized
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(117) Service name is : __ANONYMOUS_SERVICE__
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler RampartOutHandler to phase MessageOut
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler RampartOutHandler to phase MessageOut
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(323) 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
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:addressing
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(230) module name is:rampart
>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler AddressingOutHandler to phase MessageOut
>[Fri Oct  5 22:08:52 2007] [debug] phase_holder.c(129) Add handler RampartOutHandler to phase MessageOut
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1253) Start:axis2_phase_resolver_engage_module_to_svc
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1257) Module rampart will be engaged to __ANONYMOUS_SERVICE__
>[Fri Oct  5 22:08:52 2007] [debug] svc.c(713) Start:axis2_svc_add_module_ops
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(117) Service name is : __ANONYMOUS_SERVICE__
>[Fri Oct  5 22:08:52 2007] [debug] svc.c(790) End:axis2_svc_add_module_ops
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1304) Module rampart already engaged to __OPERATION_ROBUST_OUT_ONLY__ of __ANONYMOUS_SERVICE__
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1304) Module rampart already engaged to __OPERATION_OUT_ONLY__ of __ANONYMOUS_SERVICE__
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1304) Module rampart already engaged to __OPERATION_OUT_IN__ of __ANONYMOUS_SERVICE__
>[Fri Oct  5 22:08:52 2007] [debug] phase_resolver.c(1328) End:axis2_phase_resolver_engage_module_to_svc
>[Fri Oct  5 22:08:52 2007] [debug] op_client.c(817) Start:axis2_op_client_infer_transport
>[Fri Oct  5 22:08:52 2007] [debug] op_client.c(872) End:axis2_op_client_infer_transport
>[Fri Oct  5 22:08:52 2007] [debug] engine.c(654) Start:axis2_engine_invoke_phases
>[Fri Oct  5 22:08:52 2007] [debug] engine.c(667) Invoking phase MessageOut
>[Fri Oct  5 22:08:52 2007] [debug] phase.c(198) Invoke the handler AddressingOutHandler within the phase MessageOut
>[Fri Oct  5 22:08:52 2007] [debug] engine.c(677) End:axis2_engine_invoke_phases
>[Fri Oct  5 22:08:52 2007] [info]  [ssl client] Client certificate chain file not specified
>[Fri Oct  5 22:08:52 2007] [error] ssl/ssl_utils.c(102) [ssl client] Loading CA certificate failed
>[Fri Oct  5 22:08:52 2007] [debug] http_client.c(408) [axis2c] client data stream  null or socket error
>[Fri Oct  5 22:08:52 2007] [error] http_sender.c(652) status_code < 0
>[Fri Oct  5 22:08:52 2007] [debug] http_transport_sender.c(571) OP name axutil_qname_get_localpart = http://www.w3.org/2004/08/wsdl/out-in
>[Fri Oct  5 22:08:52 2007] [error] xmltest.c(424) Stub invoke FAILED: Error code: 82 :: Input stream is NULL in msg_ctx
>[Fri Oct  5 22:08:52 2007] [info]  [rampart][mod_rampart] mod_rampart shutdown
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>For additional commands, e-mail: axis-c-user-help@ws.apache.org
>


Re: Problem with invoking a https based service

Posted by divakar <di...@india.altair.com>.
Manjula Peiris:
                    Hi,
                    I changed as you guided but still getting same. I am 
attaching those files log and code please correct me. I think in log 
file it showing http error.
                   thank
                Divakar
              


Manjula Peiris wrote:

>Hi Divakr,
>
>Looking at your client code I have some problems. In Your client why are
>you building the security header on your own? Because if you engage
>rampart/c it will do all the necessary things reguarding soap message
>security. IMHO following are things you need to do for your scenario.
>
>1. Specify CA-Cert as you done in the client code.
>2. Use the policy file as in the
>rampart_src_dir/samples/secpolicy/scenario2/policy.xml 
>3. put it into your client-repo
>4. To set policy in your client code please refer to the client code at
>rampart_src_dir/samples/client/sec_echo/echo.c
>
>Thanks,
>-Manjula.
>
>
>On Tue, 2007-10-02 at 13:08 +0530, Dumindu Pallewela wrote:
>  
>
>>Hi Divakar,
>>
>>I could not find why it didn't work for you, according to the logs.
>>If you can build Axis2/C from source, you can test if the SSL
>>transport (i.e., without any SOAP stuff) is working using the
>>test/core/transport/http/test_http_transport.c test case.
>>
>>Regards,
>>Dumindu.
>>
>>divakar wrote:
>>    
>>
>>>Hi All,
>>>
>>>            I am facing some problems with invoking a https based .Net
>>>webservice using the axis2c client. It is giving the error " Error code:
>>>82 :: Input stream is NULL in msg_ctx" in the client log file. I am
>>>attaching the axis2.xml, client log file & sample program for your
>>>reference. Please check the same and let me know, if i am making any
>>>mistakes in my client program.
>>>
>>>
>>>Thanks & Regards,
>>>
>>>Murali Krishna K
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>>>For additional commands, e-mail: axis-c-user-help@ws.apache.org
>>>      
>>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>  
>


Re: Problem with invoking a https based service

Posted by Manjula Peiris <ma...@wso2.com>.
Hi Divakr,

Looking at your client code I have some problems. In Your client why are
you building the security header on your own? Because if you engage
rampart/c it will do all the necessary things reguarding soap message
security. IMHO following are things you need to do for your scenario.

1. Specify CA-Cert as you done in the client code.
2. Use the policy file as in the
rampart_src_dir/samples/secpolicy/scenario2/policy.xml 
3. put it into your client-repo
4. To set policy in your client code please refer to the client code at
rampart_src_dir/samples/client/sec_echo/echo.c

Thanks,
-Manjula.


On Tue, 2007-10-02 at 13:08 +0530, Dumindu Pallewela wrote:
> Hi Divakar,
> 
> I could not find why it didn't work for you, according to the logs.
> If you can build Axis2/C from source, you can test if the SSL
> transport (i.e., without any SOAP stuff) is working using the
> test/core/transport/http/test_http_transport.c test case.
> 
> Regards,
> Dumindu.
> 
> divakar wrote:
> > Hi All,
> > 
> >             I am facing some problems with invoking a https based .Net
> > webservice using the axis2c client. It is giving the error " Error code:
> > 82 :: Input stream is NULL in msg_ctx" in the client log file. I am
> > attaching the axis2.xml, client log file & sample program for your
> > reference. Please check the same and let me know, if i am making any
> > mistakes in my client program.
> > 
> > 
> > Thanks & Regards,
> > 
> > Murali Krishna K
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-c-user-help@ws.apache.org
> 
> 


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


Re: Problem with invoking a https based service

Posted by Dumindu Pallewela <du...@wso2.com>.
Hi Divakar,

I could not find why it didn't work for you, according to the logs.
If you can build Axis2/C from source, you can test if the SSL
transport (i.e., without any SOAP stuff) is working using the
test/core/transport/http/test_http_transport.c test case.

Regards,
Dumindu.

divakar wrote:
> Hi All,
> 
>             I am facing some problems with invoking a https based .Net
> webservice using the axis2c client. It is giving the error " Error code:
> 82 :: Input stream is NULL in msg_ctx" in the client log file. I am
> attaching the axis2.xml, client log file & sample program for your
> reference. Please check the same and let me know, if i am making any
> mistakes in my client program.
> 
> 
> Thanks & Regards,
> 
> Murali Krishna K
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org


-- 
Dumindu Pallewela
http://blog.dumindu.com
GPG ID: 0x9E131672

WSO2 | http://wso2.com | "Oxygenating the Web Service Platform"


Re: Problem with invoking a https based service

Posted by Dumindu Pallewela <du...@wso2.com>.
Manjula Peiris wrote:
> Hi Divakar,
> 
> You have not set the ca-cert in the axis2.xml. You need to set the
> following parameter in the axis2.xml.
> <parameter name="SERVER_CERT">/path/to/ca/certificate</parameter>

This is not necessary as the SERVER_CERT has been set in the client
code.

-Dumindu.


Re: Problem with invoking a https based service

Posted by Manjula Peiris <ma...@wso2.com>.
Hi Divakar,

You have not set the ca-cert in the axis2.xml. You need to set the
following parameter in the axis2.xml.
<parameter name="SERVER_CERT">/path/to/ca/certificate</parameter>

Please refer to the link Dinesh has mentioned for more information.

-Manjula.

On Tue, 2007-10-02 at 12:44 +0530, Dinesh Premalal wrote:
> Hi Divakar,
> divakar <di...@india.altair.com> writes:
> 
> > Hi All,
> >
> >             I am facing some problems with invoking a https based .Net
> > webservice using the axis2c client. It is giving the error " Error
> > code: 82 :: Input stream is NULL in msg_ctx" in the client log file. I
> > am attaching the axis2.xml, client log file & sample program for your
> > reference. Please check the same and let me know, if i am making any
> > mistakes in my client program.
> If you need to use https then you may not need to have rampart
> module. Rampart is WS-Security implementation whereas https is
> implemented in the transport level. Please refer to axis2 manual for
> more information [1]. axis2
> 
> thanks,
> Dinesh
> 
> 1.http://ws.apache.org/axis2/c/docs/axis2c_manual.html#ssl_client


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


Re: Problem with invoking a https based service

Posted by Dinesh Premalal <xy...@gmail.com>.
Hi Divakar,
divakar <di...@india.altair.com> writes:

> Hi All,
>
>             I am facing some problems with invoking a https based .Net
> webservice using the axis2c client. It is giving the error " Error
> code: 82 :: Input stream is NULL in msg_ctx" in the client log file. I
> am attaching the axis2.xml, client log file & sample program for your
> reference. Please check the same and let me know, if i am making any
> mistakes in my client program.
If you need to use https then you may not need to have rampart
module. Rampart is WS-Security implementation whereas https is
implemented in the transport level. Please refer to axis2 manual for
more information [1]. 

thanks,
Dinesh

1.http://ws.apache.org/axis2/c/docs/axis2c_manual.html#ssl_client
-- 
Dinesh Premalal
http://xydinesh.wordpress.com/
GPG ID : A255955C
GPG Key Finger Print : C481 E5D4 C27E DC34 9257  0229 4F44 266E A255 955C

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