ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r398701 - in /webservices/axis2/trunk/c/include: axis2_op_client.h axis2_options.h axis2_svc_client.h
Date Mon, 01 May 2006 21:43:31 GMT
Author: damitha
Date: Mon May  1 14:43:29 2006
New Revision: 398701

URL: http://svn.apache.org/viewcvs?rev=398701&view=rev
Log:
Service Client API function prototypes are added


Added:
    webservices/axis2/trunk/c/include/axis2_op_client.h
    webservices/axis2/trunk/c/include/axis2_options.h
    webservices/axis2/trunk/c/include/axis2_svc_client.h

Added: webservices/axis2/trunk/c/include/axis2_op_client.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_op_client.h?rev=398701&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_op_client.h (added)
+++ webservices/axis2/trunk/c/include/axis2_op_client.h Mon May  1 14:43:29 2006
@@ -0,0 +1,224 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_OP_CLIENT_H
+#define AXIS2_OP_CLIENT_H
+
+/**
+ * An operation client is the way an advanced user interacts with Axis2. Actual
+ * operation clients understand a specific MEP and hence their behavior is
+ * defined by their MEP. To interact with an operation client, you first get one
+ * from a specific axis2_op_t. Then you set the messages into it one by one
+ * (whatever is available). Then, when you call execute() the client will
+ * execute what it can at that point. If executing the operation client results
+ * in a new message being created, then if a message receiver is registered with
+ * the client then the message will be delivered to that client.
+ */
+
+/**
+  * @file axis2_op_client.h
+  * @brief axis2 Operation Client interface
+  */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_options.h>
+#include <axis2_msg_ctx.h>
+#include <axis2_callback.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @defgroup axis2_op_client Operation Client 
+ * @ingroup axis2_core_clientapi
+ * @{
+ */
+    
+typedef struct axis2_op_client_ops axis2_op_client_ops_t;
+typedef struct axis2_op_client axis2_op_client_t; 
+
+    
+/** 
+ * @brief Operation Client ops struct
+ * Encapsulator struct for ops of axis2_op_client
+ */  
+struct axis2_op_client_ops
+{
+
+	/**
+     * Sets the options that should be used for this particular client. This
+     * resets the entire set of options to use the new options - so you'd lose
+     * any option cascading that may have been set up.
+     *
+     * @param options the options
+     */
+	axis2_status_t (AXIS2_CALL *
+	set_options)(struct axis2_op_client *op_client,
+					axis2_env_t **env,
+					axis2_options_t *options);
+
+
+    /**
+     * Return the options used by this client. If you want to set a single
+     * option, then the right way is to do get_options() and set specific
+     * options.
+     *
+     * @return the options, which will never be null.
+     */
+	axis2_options_t* (AXIS2_CALL *
+	get_options)(struct axis2_op_client *op_client,
+					axis2_env_t **env);
+
+    /**
+     * Add a message context to the client for processing. This method must not
+     * process the message - it only records it in the operation client.
+     * Processing only occurs when execute() is called.
+     *
+     * @param mc the message context
+     */
+	axis2_status_t (AXIS2_CALL *
+	add_msg_ctx)(struct axis2_op_client *op_client,
+						axis2_env_t **env,
+						axis2_msg_ctx_t *mc);
+
+	/**
+     * Return a message from the client - will return null if the requested
+     * message is not available.
+     *
+     * @param message_label the message label of the desired message context
+     * @return the desired message context or null if its not available.
+     */
+	axis2_msg_ctx_t* (AXIS2_CALL *
+	get_msg_ctx)(struct axis2_op_client *op_client,
+							axis2_env_t **env,
+							axis2_char_t *message_label);
+
+    /**
+     * Set the callback to be executed when a message comes into the MEP and the
+     * operation client is executed. This is the way the operation client
+     * provides notification that a message has been received by it. Exactly
+     * when its executed and under what conditions is a function of the specific
+     * operation client.
+     *
+     * @param callback the callback to be used when the client decides its time to
+     *                 use it
+     */
+	axis2_status_t (AXIS2_CALL *
+	set_callback)(struct axis2_op_client *op_client,
+					axis2_env_t **env,
+					axis2_callback_t *callback);
+
+	 /**
+     * Execute the MEP. What this does depends on the specific operation client.
+     * The basic idea is to have the operation client execute and do something
+     * with the messages that have been added to it so far. For example, if its
+     * an Out-In MEP, then if the Out message has been set, then executing the
+     * client asks it to send the message and get the In message, possibly using
+     * a different thread.
+     *
+     * @param block Indicates whether execution should block or return ASAP. What
+     *              block means is of course a function of the specific operation
+     *              client.
+     */
+	axis2_status_t (AXIS2_CALL *
+	execute)(struct axis2_op_client *op_client,
+				axis2_env_t **env,
+				axis2_bool_t block);
+
+    /**
+     * Reset the operation client to a clean status after the MEP has completed.
+     * This is how you can reuse an operation client. NOTE: this does not reset
+     * the options; only the internal state so the client can be used again.
+     *
+     */
+	axis2_status_t (AXIS2_CALL *
+	reset)(struct axis2_op_client *op_client,
+				axis2_env_t **env);
+
+    /**
+     * To close the tranport if necessary , can call this method. The most usage of thie
method
+     * when clinet use two tarnport for sending and receiving , there we need to remove entry
from
+     * waitings calls in the transport listener queue
+     * Note : DO NOT call this method if you are not using two transport send and receive
+     *
+     * @param mc : axis2_msg_ctx_t# which have all the trnport information
+     */
+	axis2_status_t (AXIS2_CALL *
+	compelete)(struct axis2_op_client *op_client,
+				axis2_env_t **env,
+				axis2_msg_ctx_t *mc);
+
+	/**
+     * To get the operation context of the operation cleint
+     * @return Operation Context
+     */
+	axis2_op_ctx_t* (AXIS2_CALL *
+	get_operation_context)(struct axis2_op_client *op_client);
+};
+
+/** 
+ * @brief Operation Client struct
+  *	Axis2 Operation Client
+ */
+struct axis2_op_client
+{
+    axis2_op_client_ops_t *ops;    
+};
+
+AXIS2_DECLARE(axis2_op_client_t*) axis2_op_client_create(axis2_env_t **env,
+														axis2_op_t *op,
+														axis2_svc_ctx_t *svc_ctx,
+														axis2_options_t *options);
+    
+/************************** Start of function macros **************************/
+
+#define AXIS2_OPERATION_CLIENT_SET_OPTIONS(op_client, env, options) \
+		((op_client)->ops->set_options(op_client, env, options))
+
+#define AXIS2_OPERATION_CLIENT_GET_OPTIONS(op_client, env) \
+		((op_client)->ops->get_options(op_client, env))
+
+#define AXIS2_OPERATION_CLIENT_ADD_MSG_CTX(op_client, env, mc) \
+		((op_client)->ops->add_msg_ctx(op_client, env, mc))
+
+#define AXIS2_OPERATION_CLIENT_GET_MSG_CTX(op_client, env, message_label) \
+		((op_client)->ops->get_msg_ctx(op_client, env, message_label))
+
+#define AXIS2_OPERATION_CLIENT_SET_CALLBACK(op_client, env, callback) \
+		((op_client)->ops->set_callback(op_client, env, callback))
+
+#define AXIS2_OPERATION_CLIENT_EXECUTE(op_client, env, block) \
+		((op_client)->ops->execute(op_client, env, block))
+
+#define AXIS2_OPERATION_CLIENT_RESET(op_client, env) \
+		((op_client)->ops->reset(op_client, env))
+
+#define AXIS2_OPERATION_CLIENT_COMPLETE(op_client, env, mc) \
+		((op_client)->ops->compelete(op_client, env, mc))
+
+#define AXIS2_OPERATION_CLIENT_GET_OPERATION_CONTEXT(op_client, env) \
+		((op_client)->ops->get_operation_context(op_client, env))
+
+/************************** End of function macros ****************************/    
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* AXIS2_CALLBACK_H */

Added: webservices/axis2/trunk/c/include/axis2_options.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_options.h?rev=398701&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_options.h (added)
+++ webservices/axis2/trunk/c/include/axis2_options.h Mon May  1 14:43:29 2006
@@ -0,0 +1,448 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_OPTIONS_H
+#define AXIS2_OPTIONS_H
+
+
+/**
+  * @file axis2_options.h
+  * @brief axis2 MEP client gets the parameters from this
+  */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_transport_in_desc.h>
+#include <axis2_endpoint_ref.h>
+#include <axis2_hash.h>
+#include <axis2_relates_to.h>
+#include <axis2_transport_out_desc.h>
+#include <axis2_transport_receiver.h> /*still in modules/core/transports*/
+#include <axis2_om_element.h>
+#include <axis2_msg_info_headers.h>
+
+#define AXIS2_DEFAULT_TIMEOUT_MILLISECONDS 5000
+#define AXIS2_COPY_PROPERTIES	"copy_properties"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @defgroup axis2_options Options 
+ * @ingroup axis2_core_clientapi
+ * @{
+ */
+    
+typedef struct axis2_options_ops axis2_options_ops_t;
+typedef struct axis2_options axis2_options_t; 
+
+/** 
+ * @brief Options ops struct
+ * Encapsulator struct for ops of axis2_options
+ */  
+struct axis2_options_ops
+{
+	axis2_char_t* (AXIS2_CALL *
+	get_action)(struct axis2_options *options,
+				axis2_env_t **env);
+
+	
+	axis2_endpoint_ref_t* (AXIS2_CALL *
+	get_fault_to)(struct axis2_options *options,
+					axis2_env_t **env);
+
+	
+	axis2_endpoint_ref_t* (AXIS2_CALL *
+	get_from)(struct axis2_options *options,
+			axis2_env_t **env);
+
+   	axis2_transport_receiver_t* (AXIS2_CALL *
+	get_transport_receiver)(struct axis2_options *options,
+							axis2_env_t **env);
+	
+							
+	axis2_transport_in_desc_t* (AXIS2_CALL *
+	get_transport_in)(struct axis2_options *options,
+							axis2_env_t **env);		
+
+	axis2_char_t* (AXIS2_CALL *
+	get_transport_in_protocol)(struct axis2_options *options,
+								axis2_env_t **env);
+
+	axis2_char_t* (AXIS2_CALL *
+	get_message_id)(struct axis2_options *options,
+					axis2_env_t **env);
+
+	axis2_hash_t* (AXIS2_CALL *
+	get_properties)(struct axis2_options *options,
+					axis2_env_t **env);	
+
+    /**
+      * @param key
+      * @return the value realeted to this key. Null, if not found.
+      */
+	void* (AXIS2_CALL *
+	get_property)(struct axis2_options *options,
+					axis2_env_t **env,
+					axis2_char_t *key);
+
+	axis2_relates_to_t* (AXIS2_CALL *
+	get_relates_to)(struct axis2_options *options,
+					axis2_env_t **env);
+
+	
+	axis2_endpoint_ref_t* (AXIS2_CALL *
+	get_reply_to)(struct axis2_options *options,
+					axis2_env_t **env);
+
+	axis2_transport_out_desc_t* (AXIS2_CALL *
+	get_transport_out)(struct axis2_options *options,
+						axis2_env_t **env);
+
+	axis2_char_t* (AXIS2_CALL *
+	get_sender_transport_protocol)(struct axis2_options *options,
+									axis2_env_t **env);
+
+	axis2_char_t* (AXIS2_CALL *
+	get_soap_version_uri)(struct axis2_options *options,
+							axis2_env_t **env);
+
+
+	/**
+     * Gets the wait time after which a client times out in a blocking scenario.
+     * The default is AXIS2_DEFAULT_TIMEOUT_MILLISECONDS
+     *
+     * @return timeOutInMilliSeconds
+     */
+	long (AXIS2_CALL *
+	get_timeout_in_milli_seconds)(struct axis2_options *options,
+									axis2_env_t **env);
+
+	axis2_endpoint_ref_t* (AXIS2_CALL *
+	get_to)(struct axis2_options *options,
+					axis2_env_t **env);
+
+	/**not added - is_exception_to_be_thrown_on_soap_fault*/
+
+	axis2_bool_t (AXIS2_CALL *
+	is_use_seperate_listener)(struct axis2_options *options,
+								axis2_env_t **env);
+
+	struct axis2_options * (AXIS2_CALL *
+	get_parent)(struct axis2_options *options,
+				axis2_env_t **env);
+
+	void (AXIS2_CALL *
+	set_parent)(struct axis2_options *options,
+					axis2_env_t **env,
+					struct axis2_options *parent);
+
+	void (AXIS2_CALL *
+	set_action)(struct axis2_options *options,
+				axis2_env_t **env,
+				axis2_char_t *action);
+
+	void (AXIS2_CALL *
+	set_fault_to)(struct axis2_options *options,
+				axis2_env_t **env,
+				axis2_endpoint_ref_t *fault_to);
+
+	void (AXIS2_CALL *
+	set_from)(struct axis2_options *options,
+				axis2_env_t **env,
+				axis2_endpoint_ref_t *from);
+
+	void (AXIS2_CALL *
+	set_to)(struct axis2_options *options,
+				axis2_env_t **env,
+				axis2_endpoint_ref_t *to);
+
+   	void (AXIS2_CALL *
+	set_transport_receiver)(struct axis2_options *options,
+ 							axis2_env_t **env,
+							axis2_transport_receiver_t *receiver);
+
+	void (AXIS2_CALL *
+	set_transport_in)(struct axis2_options *options,
+						axis2_env_t **env,
+						axis2_transport_in_desc_t *transport_in);
+
+	void (AXIS2_CALL *
+	set_transport_in_protocol)(struct axis2_options *options,
+								axis2_env_t **env,
+								axis2_char_t *transport_in_protocol);
+
+		
+	void (AXIS2_CALL *
+	set_message_id)(struct axis2_options *options,
+					axis2_env_t **env,
+					axis2_char_t *message_id);
+
+	
+    /**
+     * This will set the properties to the context. But in setting that one may
+     * need to "copy" all the properties from the source properties to the
+     * target properties. To enable this we introduced a property
+     * AXIS2_COPY_PROPERTIES so that if set to
+     * Boolean(true), this code will copy the whole thing, without just
+     * referencing to the source.
+     *
+     * @param properties
+     */
+	axis2_status_t (AXIS2_CALL *
+	set_properties)(struct axis2_options *options,
+					axis2_env_t **env,
+					axis2_hash_t *properties);
+
+	/**
+     * Properties you need to pass in to the message context must be set via
+     * this. If there is a method to the set this property, within this class,
+     * its encouraged to use that method, without duplicating stuff or making
+     * room for bugs.
+     *
+     * @param property_key
+     * @param property
+     */		
+	void (AXIS2_CALL *
+	set_property)(struct axis2_options *options,
+					axis2_env_t **env,
+					axis2_char_t *property_key,
+					void *property);		
+				
+
+	void (AXIS2_CALL *
+	set_relates_to)(struct axis2_options *options,
+					axis2_env_t **env,
+					axis2_relates_to_t *relates_to);
+
+	void (AXIS2_CALL *
+	set_reply_to)(struct axis2_options *options,
+					axis2_env_t **env,
+					axis2_endpoint_ref_t *reply_to);
+
+	void (AXIS2_CALL *
+	set_transport_out)(struct axis2_options *options,
+						axis2_env_t **env,
+						axis2_transport_out_desc_t *transport_out);
+
+	axis2_status_t (AXIS2_CALL *
+	set_sender_transport)(struct axis2_options *options,
+							axis2_env_t **env,
+							axis2_char_t *sender_transport,
+							axis2_conf_t *conf);
+	
+	void (AXIS2_CALL *	
+	set_soap_version_uri)(struct axis2_options *options,
+							axis2_env_t **env,
+							axis2_char_t *soap_version_uri);
+
+	void (AXIS2_CALL *
+	set_timeout_in_milli_seconds)(struct axis2_options *options,
+									axis2_env_t **env,
+									long timeout_in_milli_seconds);
+	
+
+	axis2_status_t (AXIS2_CALL *
+	set_transport_info)(struct axis2_options *options,
+						axis2_env_t **env,
+						axis2_char_t *sender_transport,
+						axis2_char_t *receiver_transport,
+						axis2_bool_t use_seperate_listener);
+
+	void (AXIS2_CALL *
+	set_use_seperate_listener)(struct axis2_options *options,
+								axis2_env_t **env,
+								axis2_bool_t use_seperate_listener);
+
+	void (AXIS2_CALL *	
+	add_reference_parameter)(struct axis2_options *options,
+							axis2_env_t **env,
+							axis2_om_node_t *reference_parameter);
+
+	axis2_bool_t (AXIS2_CALL *	
+	is_manage_session)(struct axis2_options *options,
+							axis2_env_t **env);
+
+
+	void (AXIS2_CALL *	
+	set_manage_session)(struct axis2_options *options,
+							axis2_env_t **env,
+							axis2_bool_t manage_session);
+
+	/**
+	  * this method is used to set the msg info headers to msg ctx. not 
+	  * intended to be used from outside
+	  */
+	axis2_msg_info_headers_t* (AXIS2_CALL *	
+	get_msg_info_headers)(struct axis2_options *options,
+							axis2_env_t **env);
+	
+	axis2_status_t (AXIS2_CALL *	
+	free)(struct axis2_options *options,
+							axis2_env_t **env);
+};
+
+/** 
+ * @brief Options struct
+  *	Axis2 Options
+ */
+struct axis2_options
+{
+    axis2_options_ops_t *ops;    
+};
+
+AXIS2_DECLARE(axis2_options_t*) axis2_options_create(axis2_env_t **env);
+
+AXIS2_DECLARE(axis2_options_t*) axis2_options_create_with_parent(axis2_env_t **env,
+																	axis2_options_t *parent);
+    
+/************************** Start of function macros **************************/
+
+#define AXIS2_OPTIONS_GET_ACTION(options, env) \
+		((options)->ops->get_action(options, env))
+		 
+#define AXIS2_OPTIONS_GET_FAULT_TO(options, env) \
+		((options)->ops->get_fault_to(options, env))
+
+#define AXIS2_OPTIONS_GET_FROM(options, env) \
+		((options)->ops->get_from(options, env))
+
+#define AXIS2_OPTIONS_GET_TRANSPORT_RECEIVER(options, env) \
+		((options)->ops->get_transport_receiver(options, env))
+
+#define AXIS2_OPTIONS_GET_TRANSPORT_IN(options, env) \
+		((options)->ops->get_transport_in(options, env))	
+
+#define AXIS2_OPTIONS_GET_TRANSPORT_IN_PROTOCOL(options, env) \
+		((options)->ops->get_transport_in_protocol(options, env))
+
+#define AXIS2_OPTIONS_GET_MESSAGE_ID(options, env) \
+		((options)->ops->get_message_id(options, env))
+
+#define AXIS2_OPTIONS_GET_PROPERTIES(options, env) \
+		((options)->ops->get_properties(options, env))
+
+#define AXIS2_OPTIONS_GET_PROPERTY(options, env, key) \
+		((options)->ops->get_property(options, env, key))
+
+#define AXIS2_OPTIONS_GET_RELATES_TO(options, env) \
+		((options)->ops->get_relates_to(options, env))
+
+#define AXIS2_OPTIONS_GET_REPLY_TO(options, env) \
+		((options)->ops->get_reply_to(options, env))
+
+#define AXIS2_OPTIONS_GET_TRANSPORT_OUT(options, env) \
+		((options)->ops->get_transport_out(options, env))
+
+#define AXIS2_OPTIONS_GET_SENDER_PROTOCOL(options, env) \
+		((options)->ops->get_sender_transport_protocol(options, env))
+
+#define AXIS2_OPTIONS_GET_SOAP_VERSION_URI(options, env) \
+		((options)->ops->get_soap_version_uri(options, env))
+
+#define AXIS2_OPTIONS_GET_TIMEOUT_IN_MILLI_SECONDS(options, env) \
+		((options)->ops->get_timeout_in_milli_seconds(options, env))
+
+#define AXIS2_OPTIONS_GET_TO(options, env) \
+		((options)->ops->get_to(options, env))
+
+#define AXIS2_OPTIONS_IS_SEPERATE_LISTNER(options, env) \
+		((options)->ops->is_use_seperate_listener(options, env))
+
+#define AXIS2_OPTIONS_GET_PARENT(options, env) \
+		((options)->ops->get_parent(options, env))
+
+#define AXIS2_OPTIONS_SET_PARENT(options, env, parent) \
+		((options)->ops->set_parent(options, env, parent))
+
+#define AXIS2_OPTIONS_SET_ACTION(options, env, action) \
+		((options)->ops->set_action(options, env, action))
+
+#define AXIS2_OPTIONS_SET_FAULT_TO(options, env, fault_to) \
+		((options)->ops->set_fault_to(options, env, fault_to))
+
+#define AXIS2_OPTIONS_SET_FROM(options, env, from) \
+		((options)->ops->set_from(options, env, from))
+
+#define AXIS2_OPTIONS_SET_TO(options, env, to) \
+		((options)->ops->set_to(options, env, to))
+
+#define AXIS2_OPTIONS_SET_TRANSPORT_RECEIVER(options, env, receiver) \
+		((options)->ops->set_transport_receiver(options, env, receiver))
+
+#define AXIS2_OPTIONS_SET_TRANSPORT_IN(options, env, transport_in) \
+		((options)->ops->set_transport_in(options, env, transport_in))
+
+#define AXIS2_OPTIONS_SET_TRANSPORT_IN_PROTOCOL(options, env, transport_in_protocol) \
+		((options)->ops->set_transport_in_protocol(options, env, transport_in_protocol))
+
+#define AXIS2_OPTIONS_SET_MESSAGE_ID(options, env, message_id) \
+		((options)->ops->set_message_id(options, env, message_id))
+
+#define AXIS2_OPTIONS_SET_PROPERTIES(options, env, properties) \
+		((options)->ops->set_properties(options, env, properties))
+
+#define AXIS2_OPTIONS_SET_PROPERTY(options, env, key, property) \
+		((options)->ops->set_property(options, env, key, property))
+
+#define AXIS2_OPTIONS_SET_RELATES_TO(options, env, relates_to) \
+		((options)->ops->set_relates_to(options, env, relates_to))
+
+#define AXIS2_OPTIONS_SET_REPLY_TO(options, env, reply_to) \
+		((options)->ops->set_reply_to(options, env, reply_to))
+		
+#define AXIS2_OPTIONS_SET_TRANSPORT_OUT(options, env, transport_out) \
+		((options)->ops->set_transport_out(options, env, transport_out))
+
+#define AXIS2_OPTIONS_SET_SENDER_TRANSPORT(options, env, sender_transport, conf) \
+		((options)->ops->set_sender_transport(options, env, sender_transport, conf))
+
+#define AXIS2_OPTIONS_SET_SOAP_VERSION_URI(options, env, soap_version_uri) \
+		((options)->ops->set_soap_version_uri(options, env, soap_version_uri))
+
+#define AXIS2_OPTIONS_SET_TIMEOUT_IN_MILLI_SECONDS(options, env, timeout_in_milli_seconds)
\
+		((options)->ops->set_timeout_in_milli_seconds(options, env, timeout_in_milli_seconds))
+
+#define AXIS2_OPTIONS_SET_TRANSPORT_INFO(options, env, sender_transport, receiver_transport,
user_seperate_listener) \
+		((options)->ops->set_tranport_info(options, env, sender_transport, receiver_transport,
user_seperate_listener))
+
+#define AXIS2_OPTIONS_SET_USE_SEPERATE_LISTENER(options, env, use_seperate_listener) \
+		((options)->ops->set_use_seperate_listener(options, env, use_seperate_listener))
+
+#define AXIS2_OPTIONS_ADD_REFERENCE_PARAMETER(options, env, reference_parameter) \
+		((options)->ops->add_reference_parameter(options, env, reference_parameter))
+
+#define AXIS2_OPTIONS_IS_MANAGE_SESSION(options, env) \
+		((options)->ops->is_manage_session(options, env))
+
+#define AXIS2_OPTIONS_SET_MANAGE_SESSION(options, env, manage_session) \
+		((options)->ops->set_manage_session(options, env, manage_session))
+
+#define AXIS2_OPTIONS_GET_MSG_INFO_HEADERS(options, env) \
+		((options)->ops->get_msg_info_headers(options, env))
+
+#define AXIS2_OPTIONS_FREE(options, env) \
+		((options)->ops->free(options, env))
+
+/************************** End of function macros ****************************/    
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* AXIS2_OPTIONS_H */

Added: webservices/axis2/trunk/c/include/axis2_svc_client.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_svc_client.h?rev=398701&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_svc_client.h (added)
+++ webservices/axis2/trunk/c/include/axis2_svc_client.h Mon May  1 14:43:29 2006
@@ -0,0 +1,381 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_SVC_CLIENT_H
+#define AXIS2_SVC_CLIENT_H
+
+
+/**
+  * @file axis2_svc_client.h
+  * @brief axis2 Service Client interface
+  */
+
+#include <axis2_defines.h>
+#include <axis2_env.h>
+#include <axis2_svc.h>
+#include <axis2_options.h>
+#include <axis2_qname.h>
+#include <axis2_om_element.h>
+#include <axis2_callback.h>
+#include <axis2_endpoint_ref.h>
+#include <axis2_svc_ctx.h>
+#include <axis2_conf_ctx.h>
+#include <axis2_op_client.h>
+
+#define AXIS2_ANON_SERVICE 				"__ANONYMOUS_SERVICE__"
+#define AXIS2_ANON_OUT_ONLY_OP 			"__OPERATION_OUT_ONLY__"
+#define AXIS2_ANON_ROBUST_OUT_ONLY_OP	"__OPERATION_ROBUST_OUT_ONLY__"
+#define AXIS2_ANON_OUT_IN_OP			"__OPERATION_OUT_IN__"
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @defgroup axis2_svc_client Service Client 
+ * @ingroup axis2_core_clientapi
+ * @{
+ */
+    
+typedef struct axis2_svc_client_ops axis2_svc_client_ops_t;
+typedef struct axis2_svc_client axis2_svc_client_t; 
+
+    
+/** 
+ * @brief Service Client ops struct
+ * Encapsulator struct for ops of axis2_svc_client
+ */  
+struct axis2_svc_client_ops
+{
+	 /**
+     * Return the axis2_svc_t this is a client for. This is primarily useful
+     * when the AxisService is created anonymously or from WSDL as otherwise the
+     * user had the AxisService to start with.
+     *
+     * @return the axisService
+     */
+	axis2_svc_t* (AXIS2_CALL *
+	get_axis_service)(struct axis2_svc_client *svc_client);
+
+	/**
+	  * Set the client configuration related to this service interaction.
+	  */
+	axis2_status_t (AXIS2_CALL *
+	set_options)(struct axis2_svc_client *svc_client,
+				axis2_env_t **env,
+				axis2_options_t *options);	
+
+	/**
+     * Get the client configuration from this service interaction.
+     *
+     * @return set of options set earlier.
+     */
+    axis2_options_t* (AXIS2_CALL *
+	get_options)(struct axis2_svc_client *svc_client);
+
+    /**
+     * Set the client configuration related to this service interaction to
+     * override any options that the underlying operation client may have.
+     */
+	axis2_status_t (AXIS2_CALL *
+	set_override_options)(struct axis2_svc_client *svc_client,
+						axis2_env_t **env,
+						axis2_options_t *override_options);    
+
+    /**
+     * Get the client configuration from this service interaction which have
+     * been used to overide operation client options as well.
+     *
+     * @return set of options set earlier.
+     */
+	axis2_options_t* (AXIS2_CALL *
+	get_override_options)(struct axis2_svc_client *svc_client);    
+
+
+	axis2_status_t (AXIS2_CALL *
+	engage_module)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env,
+					axis2_qname_t *module_name);
+
+	axis2_status_t (AXIS2_CALL *
+	disengage_module)(struct axis2_svc_client *svc_client,
+						axis2_env_t **env,
+						axis2_qname_t *module_name);
+	
+	/**
+     * Add an XML element as a header to be sent with interactions. This allows
+     * users to go a bit beyond the dirt simple XML in/out pattern using this
+     * simplified API. A header
+     *
+     * @param header The header to be added for interactions. Must not be null.
+     */
+	axis2_status_t (AXIS2_CALL *
+	add_header)(struct axis2_svc_client *svc_client,
+				axis2_env_t **env,
+				axis2_om_node_t *header);
+
+	/**
+     * To remove all the headers in svc_client_t
+     */
+	axis2_status_t (AXIS2_CALL *
+	remove_headers)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env);
+
+	/**
+     * Add a simple header consisting of some text (and a header name; duh) to
+     * be sent with interactions.
+     *
+     * @param header_name
+     * @param header_text
+     */
+	axis2_status_t (AXIS2_CALL *
+	add_header_with_text)(struct axis2_svc_client *svc_client,
+						axis2_env_t **env,
+						axis2_qname_t *header_name,
+						axis2_char_t *header_text); 	
+
+    /**
+     * This is a simple client API to invoke a service operation who's MEP is
+     * Robust In-Only. This API can be used to simply send a bit of XML.
+     * If you need more control over this interaction
+     * then you need to create a client (@see create_client()) for the operation
+     * and use that instead.
+     *
+     * @param elem The XML to send
+     */	
+	axis2_status_t (AXIS2_CALL *
+	send_robust)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env,
+					axis2_om_node_t *payload);
+
+	
+	axis2_status_t (AXIS2_CALL *
+	send_robust_with_operation)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env,
+					axis2_qname_t *operation,
+					axis2_om_node_t *payload);
+	
+	/**
+     * Send a bit of XML and forget about it. This API is used to interact with
+     * a service operation who's MEP is In-Only. That is, there is no
+     * opportunity to get an error from the service via this API; one may still
+     * get client-side errors, such as host unknown etc.
+     *
+     * @param elem The XML element to send to the service
+     */
+	void (AXIS2_CALL *
+	fire_and_forget)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env,
+					axis2_om_node_t *payload);
+
+	
+	void (AXIS2_CALL *
+	fire_and_forget_with_operation)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env,
+					axis2_qname_t *operation,
+					axis2_om_node_t *payload);
+
+	axis2_om_node_t* (AXIS2_CALL *
+	send_receive)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env,
+					axis2_om_node_t *payload);
+
+	
+	axis2_om_node_t* (AXIS2_CALL *
+	send_receive_with_operation)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env,
+					axis2_qname_t *operation,	
+					axis2_om_node_t *payload);
+	
+
+	void (AXIS2_CALL *
+	send_receive_non_blocking)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env,
+					axis2_om_node_t *payload,
+					axis2_callback_t *callback);
+
+
+	void (AXIS2_CALL *
+	send_receive_non_blocking_with_operation)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env,
+					axis2_qname_t *operation,
+					axis2_om_node_t *payload,
+					axis2_callback_t *callback);
+	
+	/**
+     * Create a MEP client for a specific operation. This is the way one can
+     * create a full function MEP client which can be used to exchange messages
+     * for this specific operation. If you're using this then you must know what
+     * you're doing and need the full capabilities of Axis2's client
+     * architecture. This is meant for people with deep skin and not the light
+     * user.
+     *
+     * @param operation The axis2_qname_t of the operation to create a client for.
+     * @return a MEP client configured to talk to the given operation or null if
+     *         the operation name is not found.
+     */
+	axis2_op_client_t* (AXIS2_CALL *
+	create_client)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env,
+					axis2_qname_t *operation);
+
+	/**
+     * This will close the out put stream or , and remove entry from waiting
+     * queue of the transport Listener queue
+     *
+     */
+	axis2_status_t (AXIS2_CALL *
+	finalize_invoke)(struct axis2_svc_client *svc_client,
+						axis2_env_t **env);
+
+	/**
+     * To get the EPR that the service is running
+     * transport : can be null , if it is null then epr will be craetd using any available
+     * transports
+     */
+    axis2_endpoint_ref_t* (AXIS2_CALL *
+	get_my_epr)(struct axis2_svc_client *svc_client,
+				axis2_env_t **env,
+				axis2_char_t *transport);				
+		
+    /**
+     * To get the Targert EPR if any in service conetext
+     * and reference paramters in TEPR can send back , in the same time this epr can use
to manage
+     * session across mutiple svc_client
+     *
+     * @return <code>End point Reference</code>
+     */
+	axis2_endpoint_ref_t* (AXIS2_CALL *
+	get_target_epr)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env);
+
+	axis2_status_t (AXIS2_CALL *
+	set_target_epr)(struct axis2_svc_client *svc_client,
+					axis2_env_t **env,
+					axis2_endpoint_ref_t *target_epr);		
+    /**
+     * To get the service context
+     *
+     * @return Service Context
+     */
+	axis2_svc_ctx_t* (AXIS2_CALL *
+	get_svc_ctx)(struct axis2_svc_client *svc_client,
+	   				axis2_env_t **env);		
+	
+};
+
+/** 
+ * @brief Serivce Client struct
+  *	Axis2 Service Client
+ */
+struct axis2_svc_client
+{
+    axis2_svc_client_ops_t *ops;    
+};
+
+AXIS2_DECLARE(axis2_svc_client_t*) axis2_svc_client_create(axis2_env_t **env, axis2_char_t
*client_home);
+
+AXIS2_DECLARE(axis2_svc_client_t*) axis2_svc_client_create_with_conf_ctx_and_svc(axis2_env_t
**env,
+										 axis2_conf_ctx_t *conf_ctx,
+										 axis2_svc_t *svc,
+										 axis2_char_t *client_home);
+   
+/*TODO: add wsdl base create functions */
+
+/************************** Start of function macros **************************/
+
+#define AXIS2_SERVICE_CLIENT_GET_AXIS_SERVICE(svc_client) \
+		((svc_client)->ops->get_axis_service(svc_client))
+
+#define AXIS2_SERVICE_CLIENT_SET_OPTIONS(svc_client, env, options) \
+		((svc_client)->ops->set_options(svc_client, env, options))
+
+#define AXIS2_SERVICE_CLIENT_GET_OPTIONS(svc_client) \
+		((svc_client)->ops->get_options(svc_client))
+
+#define AXIS2_SERVICE_CLIENT_SET_OVERRIDE_OPTIONS(svc_client, env, override_options) \
+		((svc_client)->ops->set_override_options(svc_client, env, override_options))
+
+#define AXIS2_SERVICE_CLIENT_GET_OVERRIDE_OPTIONS(svc_client) \
+	    ((svc_client)->ops->get_override_options(svc_client))
+
+#define AXIS2_SERVICE_CLIENT_ENGAGE_MODULE(svc_client, env, module_name) \
+		((svc_client)->ops->engage_module(svc_client, env, module_name))
+
+#define AXIS2_SERVICE_CLIENT_DISENGAGE_MODULE(svc_client, env, module_name) \
+		((svc_client)->ops->disengage_module(svc_client, env, module_name))
+
+#define AXIS2_SERVICE_CLIENT_ADD_HEADER(svc_client, env, header) \
+		((svc_client)->ops->add_header(svc_client, env, header))
+
+#define AXIS2_SERVICE_CLIENT_REMOVE_HEADERS(svc_client, env) \
+		((svc_client)->ops->remove_headers(svc_client, env))
+
+#define AXIS2_SERVICE_CLIENT_ADD_HEADER_WITH_TEXT(svc_client, env, header_name, header_text)
\
+		((svc_client)->ops->add_header_with_text(svc_client, env, header_name, header_text))
+
+#define AXIS2_SERVICE_CLIENT_SEND_ROBUST(svc_client, env, payload) \
+		((svc_client)->ops->send_robust(svc_client, env, payload))
+
+#define AXIS2_SERVICE_CLIENT_SEND_ROBUST_WITH_OPERATION(svc_client, env, operation, payload)
\
+		((svc_client)->ops->send_robust_with_operation(svc_client, env, operation, payload))
+
+#define AXIS2_SERVICE_CLIENT_FIRE_AND_FORGET(svc_client, env, payload) \
+		((svc_client)->ops->fire_and_forget(svc_client, env, payload))
+
+#define AXIS2_SERVICE_CLIENT_FIRE_AND_FORGET_WITH_OPERATION(svc_client, env, operation, payload)
\
+		((svc_client)->ops->fire_and_forget_with_operation(svc_client, env, operation, payload))
+
+#define AXIS2_SERVICE_CLIENT_SEND_RECEIVE(svc_client, env, payload) \
+		((svc_client)->ops->send_receive(svc_client, env, payload))
+
+#define AXIS2_SERVICE_CLIENT_SEND_RECEIVE_WITH_OPERATION(svc_client, env, operation, payload)
\
+		((svc_client)->ops->send_receive_with_operation(svc_client, env, operation, payload))
+
+#define AXIS2_SERVICE_CLIENT_SEND_RECEIVE_NON_BLOCKING(svc_client, env, payload, callback)
\
+		((svc_client)->ops->send_receive_non_blocking(svc_client, env, payload, callback))
+
+#define AXIS2_SERVICE_CLIENT_SEND_RECEIVE_NON_BLOCKING_WITH_OPERATION(svc_client, env, operation,
payload, callback) \
+		((svc_client)->ops->send_receive_non_blocking_with_operation(svc_client, env, operation,
payload, callback))
+	
+#define AXIS2_SERVICE_CLIENT_CREATE_CLIENT(svc_client, env, operation) \
+		((svc_client)->ops->create_client(svc_client, env, operation))
+
+#define AXIS2_SERVICE_CLIENT_FINALIZE_INVOKE(svc_client, env) \
+		((svc_client)->ops->finalize_invoke(svc_client, env))
+
+#define AXIS2_SERVICE_CLIENT_GET_MY_EPR(svc_client, env, transport) \
+		((svc_client)->ops->get_my_epr(svc_client, env, transport))
+
+#define AXIS2_SERVICE_CLIENT_GET_TARGET_EPR(svc_client, env) \
+		((svc_client)->ops->get_target_epr(svc_client, env))
+
+#define AXIS2_SERVICE_CLIENT_SET_TARGET_EPR(svc_client, env, target_epr) \
+		((svc_client)->ops->set_target_epr(svc_client, env, target_epr))
+
+#define AXIS2_SERVICE_CLIENT_GET_SERVICE_CONTEXT(svc_client, env) \
+		((svc_client)->ops->get_svc_ctx(svc_client, env))
+
+
+/************************** End of function macros ****************************/    
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* AXIS2_SVC_CLIENT_H */



Mime
View raw message