You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-commits@axis.apache.org by da...@apache.org on 2010/06/29 10:57:06 UTC
svn commit: r958884 [1/9] - in /axis/axis2/c/core/trunk: axiom/src/om/
axiom/src/soap/ samples/client/amqp/echo/ samples/client/amqp/mtom/
samples/client/amqp/notify/ src/core/deployment/
src/core/transport/amqp/receiver/ src/core/transport/amqp/receiv...
Author: damitha
Date: Tue Jun 29 08:57:05 2010
New Revision: 958884
URL: http://svn.apache.org/viewvc?rev=958884&view=rev
Log:
Partial fix of AXIS2C-1440
Modified:
axis/axis2/c/core/trunk/axiom/src/om/axiom_document_internal.h
axis/axis2/c/core/trunk/axiom/src/om/axiom_element_internal.h
axis/axis2/c/core/trunk/axiom/src/soap/axiom_soap_builder_internal.h
axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking.c
axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_addr.c
axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_dual.c
axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_soap11.c
axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_non_blocking.c
axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_non_blocking_dual.c
axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_util.c
axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_util.h
axis/axis2/c/core/trunk/samples/client/amqp/mtom/mtom_client.c
axis/axis2/c/core/trunk/samples/client/amqp/notify/notify_client.c
axis/axis2/c/core/trunk/src/core/deployment/conf_init.c
axis/axis2/c/core/trunk/src/core/transport/amqp/receiver/axis2_amqp_receiver.c
axis/axis2/c/core/trunk/src/core/transport/amqp/receiver/axis2_amqp_receiver.h
axis/axis2/c/core/trunk/src/core/transport/amqp/receiver/qpid_receiver/axis2_qpid_receiver.h
axis/axis2/c/core/trunk/src/core/transport/amqp/receiver/qpid_receiver/axis2_qpid_receiver_interface.h
axis/axis2/c/core/trunk/src/core/transport/amqp/receiver/qpid_receiver/axis2_qpid_receiver_listener.h
axis/axis2/c/core/trunk/src/core/transport/amqp/receiver/qpid_receiver/request_processor/axis2_amqp_request_processor.c
axis/axis2/c/core/trunk/src/core/transport/amqp/receiver/qpid_receiver/request_processor/axis2_amqp_request_processor.h
axis/axis2/c/core/trunk/src/core/transport/amqp/sender/axis2_amqp_sender.c
axis/axis2/c/core/trunk/src/core/transport/amqp/sender/axis2_amqp_sender.h
axis/axis2/c/core/trunk/src/core/transport/amqp/sender/qpid_sender/axis2_qpid_sender.h
axis/axis2/c/core/trunk/src/core/transport/amqp/sender/qpid_sender/axis2_qpid_sender_interface.h
axis/axis2/c/core/trunk/src/core/transport/amqp/server/axis2_amqp_server/axis2_amqp_server.c
axis/axis2/c/core/trunk/src/core/transport/amqp/server/axis2_amqp_server/axis2_amqp_server.h
axis/axis2/c/core/trunk/src/core/transport/amqp/util/axis2_amqp_defines.h
axis/axis2/c/core/trunk/src/core/transport/amqp/util/axis2_amqp_util.c
axis/axis2/c/core/trunk/src/core/transport/amqp/util/axis2_amqp_util.h
axis/axis2/c/core/trunk/src/core/transport/http/receiver/http_receiver.c
axis/axis2/c/core/trunk/src/core/transport/http/server/IIS/axis2_iis_worker.h
axis/axis2/c/core/trunk/src/core/transport/http/server/IIS/axis2_isapi_plugin.c
axis/axis2/c/core/trunk/src/core/transport/http/server/IIS/iis_iaspi_plugin_51/axis2_isapi_51.c
axis/axis2/c/core/trunk/src/core/transport/http/server/apache2/apache2_worker.c
axis/axis2/c/core/trunk/src/modules/mod_addr/addr_out_handler.c
axis/axis2/c/core/trunk/test/find_policy.c
axis/axis2/c/core/trunk/util/include/axutil_network_handler.h
axis/axis2/c/core/trunk/util/include/axutil_utils_defines.h
axis/axis2/c/core/trunk/util/include/platforms/os400/axutil_os400.h
axis/axis2/c/core/trunk/util/include/platforms/windows/axutil_uuid_gen_windows.h
axis/axis2/c/core/trunk/util/src/network_handler.c
axis/axis2/c/core/trunk/util/src/platforms/os400/platformSpecificOS400.c
axis/axis2/c/core/trunk/util/src/platforms/windows/axutil_windows.c
Modified: axis/axis2/c/core/trunk/axiom/src/om/axiom_document_internal.h
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/src/om/axiom_document_internal.h?rev=958884&r1=958883&r2=958884&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/axiom/src/om/axiom_document_internal.h (original)
+++ axis/axis2/c/core/trunk/axiom/src/om/axiom_document_internal.h Tue Jun 29 08:57:05 2010
@@ -1,120 +1,120 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 AXIOM_DOCUMENT_INTERNAL_H_
-#define AXIOM_DOCUMENT_INTERNAL_H_
-
-#include <axiom_document.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
- /**
- * creates an axiom_document_t struct
- * @param env Environment. MUST NOT be NULL.
- * @param root pointer to document's root node. Optional, can be NULL
- * @param builder pointer to axiom_stax_builder
- * @return pointer to the newly created document.
- */
- axiom_document_t *AXIS2_CALL
- axiom_document_create(
- const axutil_env_t * env,
- axiom_node_t * root,
- struct axiom_stax_builder *builder);
-
- /**
- * Free document struct
- * @param document pointer to axiom_document_t struct to be freed
- * @param env Environment. MUST NOT be NULL
- * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE.
- */
- void AXIS2_CALL
- axiom_document_free(
- struct axiom_document *document,
- const axutil_env_t * env);
-
- /**
- * Free document struct only, Does not free the associated axiom structure.
- * @param document pointer to axiom_document_t struct to be freed
- * @param env Environment. MUST NOT be NULL
- * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE.
- */
- void AXIS2_CALL
- axiom_document_free_self(
- struct axiom_document *document,
- const axutil_env_t * env);
-
- /**
- * set the root element of the document. IF a root node is already exist,it is freed
- * before setting to root element
- * @param document document struct to return the root of
- * @param env Environment. MUST NOT be NULL.
- * @return returns status code AXIS2_SUCCESS on success ,AXIS2_FAILURE on error.
- */
- axis2_status_t AXIS2_CALL
- axiom_document_set_root_element(
- struct axiom_document *document,
- const axutil_env_t * env,
- axiom_node_t * om_node);
-
-#if 0
- /* these methods are commented, because it is not used anymore (1.6.0)*/
-
- /**
- * get builder
- * @param document pointer to axiom_document_t struct to be built.
- * @param env environment MUST NOT be NULL.
- * @return builder, returns NULL if a builder is not associated with
- * document
- */
- AXIS2_EXTERN struct axiom_stax_builder *AXIS2_CALL
- axiom_document_get_builder(
- struct axiom_document *document,
- const axutil_env_t * env);
-
- /**
- * sets builder for document.
- * @param document pointer to axiom_document_t struct to be built.
- * @param env environment MUST NOT be NULL.
- * @param builder pointer to builder to associate with document
- */
- AXIS2_EXTERN void AXIS2_CALL
- axiom_document_set_builder(
- axiom_document_t * document,
- const axutil_env_t * env,
- struct axiom_stax_builder * builder);
-
- /**
- * @param om_document
- * @return status code AXIS2_SUCCESS on success , otherwise AXIS2_FAILURE
- */
- AXIS2_EXTERN axis2_status_t AXIS2_CALL
- axiom_document_serialize(
- struct axiom_document *document,
- const axutil_env_t * env,
- axiom_output_t * om_output);
-
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* AXIOM_DOCUMENT_INTERNAL_H_ */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 AXIOM_DOCUMENT_INTERNAL_H_
+#define AXIOM_DOCUMENT_INTERNAL_H_
+
+#include <axiom_document.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ /**
+ * creates an axiom_document_t struct
+ * @param env Environment. MUST NOT be NULL.
+ * @param root pointer to document's root node. Optional, can be NULL
+ * @param builder pointer to axiom_stax_builder
+ * @return pointer to the newly created document.
+ */
+ axiom_document_t *AXIS2_CALL
+ axiom_document_create(
+ const axutil_env_t * env,
+ axiom_node_t * root,
+ struct axiom_stax_builder *builder);
+
+ /**
+ * Free document struct
+ * @param document pointer to axiom_document_t struct to be freed
+ * @param env Environment. MUST NOT be NULL
+ * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE.
+ */
+ void AXIS2_CALL
+ axiom_document_free(
+ struct axiom_document *document,
+ const axutil_env_t * env);
+
+ /**
+ * Free document struct only, Does not free the associated axiom structure.
+ * @param document pointer to axiom_document_t struct to be freed
+ * @param env Environment. MUST NOT be NULL
+ * @return status of the op. AXIS2_SUCCESS on success else AXIS2_FAILURE.
+ */
+ void AXIS2_CALL
+ axiom_document_free_self(
+ struct axiom_document *document,
+ const axutil_env_t * env);
+
+ /**
+ * set the root element of the document. IF a root node is already exist,it is freed
+ * before setting to root element
+ * @param document document struct to return the root of
+ * @param env Environment. MUST NOT be NULL.
+ * @return returns status code AXIS2_SUCCESS on success ,AXIS2_FAILURE on error.
+ */
+ axis2_status_t AXIS2_CALL
+ axiom_document_set_root_element(
+ struct axiom_document *document,
+ const axutil_env_t * env,
+ axiom_node_t * om_node);
+
+#if 0
+ /* these methods are commented, because it is not used anymore (1.6.0)*/
+
+ /**
+ * get builder
+ * @param document pointer to axiom_document_t struct to be built.
+ * @param env environment MUST NOT be NULL.
+ * @return builder, returns NULL if a builder is not associated with
+ * document
+ */
+ AXIS2_EXTERN struct axiom_stax_builder *AXIS2_CALL
+ axiom_document_get_builder(
+ struct axiom_document *document,
+ const axutil_env_t * env);
+
+ /**
+ * sets builder for document.
+ * @param document pointer to axiom_document_t struct to be built.
+ * @param env environment MUST NOT be NULL.
+ * @param builder pointer to builder to associate with document
+ */
+ AXIS2_EXTERN void AXIS2_CALL
+ axiom_document_set_builder(
+ axiom_document_t * document,
+ const axutil_env_t * env,
+ struct axiom_stax_builder * builder);
+
+ /**
+ * @param om_document
+ * @return status code AXIS2_SUCCESS on success , otherwise AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axiom_document_serialize(
+ struct axiom_document *document,
+ const axutil_env_t * env,
+ axiom_output_t * om_output);
+
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* AXIOM_DOCUMENT_INTERNAL_H_ */
Modified: axis/axis2/c/core/trunk/axiom/src/om/axiom_element_internal.h
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/src/om/axiom_element_internal.h?rev=958884&r1=958883&r2=958884&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/axiom/src/om/axiom_element_internal.h (original)
+++ axis/axis2/c/core/trunk/axiom/src/om/axiom_element_internal.h Tue Jun 29 08:57:05 2010
@@ -1,147 +1,147 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 AXIOM_ELEMENT_INTERNAL_H_
-#define AXIOM_ELEMENT_INTERNAL_H_
-
-/** @defgroup axiom AXIOM (Axis Object Model)
- * @ingroup axis2
- * @{
- */
-
-/** @} */
-
-#include <axiom_element.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
- /**
- * @defgroup axiom_element element
- * @ingroup axiom
- * @{
- */
-
- /**
- * Collect all the namespaces with distinct prefixes in the parents of the given element.
- * Effectively this is the set of namespaces declared above this element that are inscope at
- * this element and might be used by it or its children.
- * @param om_element pointer to om_element
- * @param env environment MUST not be NULL
- * @param om_node pointer to this element node
- * @returns pointer to hash of relevant namespaces
- */
- axutil_hash_t * AXIS2_CALL
- axiom_element_gather_parent_namespaces(
- axiom_element_t * om_element,
- const axutil_env_t * env,
- axiom_node_t * om_node);
-
- /**
- * Examines the subtree beginning at the provided element for each element or attribute,
- * if it refers to a namespace declared in a parent of the subtree root element, if not already
- * declared, redeclares that namespace at the level of the subtree root and removes
- * it from the set of parent inscope_namespaces. inscope_namespaces contains all the parent
- * namespaces which should be redeclared at some point.
- * @param om_element pointer to om_element
- * @param env environment MUST not be NULL
- * @param om_node pointer to this element node
- * @param inscope_namespaces pointer to hash of parent namespaces
- */
- void AXIS2_CALL
- axiom_element_redeclare_parent_namespaces(
- axiom_element_t * om_element,
- const axutil_env_t * env,
- axiom_node_t * om_node,
- axutil_hash_t *inscope_namespaces);
-
- /**
- * If the provided namespace used by the provided element is one of the namespaces from the
- * parent of the root element, redeclares that namespace at the root element and removes it
- * from the hash of parent namespaces
- * @param om_element pointer to om_element
- * @param env environment MUST not be NULL
- * @param om_node pointer to this element node
- * @param ns pointer to namespace to redeclare
- * @param inscope_namespaces pointer to hash of parent namespaces
- */
- void AXIS2_CALL
- axiom_element_use_parent_namespace(
- axiom_element_t * om_element,
- const axutil_env_t * env,
- axiom_node_t * om_node,
- axiom_namespace_t *ns,
- axutil_hash_t *inscope_namespaces);
-
- /**
- * retrieves the default namespace of this element
- * @param om_element pointer to om element
- * @param env axutil_environment MUST Not be NULL
- * @param element_node corresponding om element node of this om element
- * @returns pointer to default namespace if available , NULL otherwise
- */
- axiom_namespace_t *AXIS2_CALL
- axiom_element_get_default_namespace(
- axiom_element_t * om_element,
- const axutil_env_t * env,
- axiom_node_t * element_node);
-
- /**
- * Serializes the start part of the given element
- * @param element element to be serialized.
- * @param env Environment. MUST NOT be NULL.
- * @param om_output AXIOM output handler to be used in serializing
- * @return status of the operation. AXIS2_SUCCESS on success else AXIS2_FAILURE
- */
- axis2_status_t AXIS2_CALL
- axiom_element_serialize_start_part(
- axiom_element_t * om_element,
- const axutil_env_t * env,
- axiom_output_t * om_output,
- axiom_node_t * ele_node);
-
- /**
- * Serializes the end part of the given element. serialize_start_part must
- * have been called before calling this method.
- * @param om_element pointer to om_element
- * @param env environment MUST not be NULL
- * @param om_node pointer to this element node
- * @param om_output AXIOM output handler to be used in serializing
- * @return status of the operation. AXIS2_SUCCESS on success else AXIS2_FAILURE
- */
- axis2_status_t AXIS2_CALL
- axiom_element_serialize_end_part(
- axiom_element_t * om_element,
- const axutil_env_t * env,
- axiom_output_t * om_output);
-
- /**
- * Set whether the element is empty or not
- * @param om_element pointer to om_element
- * @param env environment MUST not be NULL
- * @param is_empty AXIS2_TRUE if empty AXIS2_FALSE if not empty
- * @return VOID
- */
- void AXIS2_CALL
- axiom_element_set_is_empty(
- axiom_element_t * om_element,
- const axutil_env_t * env,
- axis2_bool_t is_empty);
-
-#endif /* AXIOM_ELEMENT_INTERNAL_H_ */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 AXIOM_ELEMENT_INTERNAL_H_
+#define AXIOM_ELEMENT_INTERNAL_H_
+
+/** @defgroup axiom AXIOM (Axis Object Model)
+ * @ingroup axis2
+ * @{
+ */
+
+/** @} */
+
+#include <axiom_element.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ /**
+ * @defgroup axiom_element element
+ * @ingroup axiom
+ * @{
+ */
+
+ /**
+ * Collect all the namespaces with distinct prefixes in the parents of the given element.
+ * Effectively this is the set of namespaces declared above this element that are inscope at
+ * this element and might be used by it or its children.
+ * @param om_element pointer to om_element
+ * @param env environment MUST not be NULL
+ * @param om_node pointer to this element node
+ * @returns pointer to hash of relevant namespaces
+ */
+ axutil_hash_t * AXIS2_CALL
+ axiom_element_gather_parent_namespaces(
+ axiom_element_t * om_element,
+ const axutil_env_t * env,
+ axiom_node_t * om_node);
+
+ /**
+ * Examines the subtree beginning at the provided element for each element or attribute,
+ * if it refers to a namespace declared in a parent of the subtree root element, if not already
+ * declared, redeclares that namespace at the level of the subtree root and removes
+ * it from the set of parent inscope_namespaces. inscope_namespaces contains all the parent
+ * namespaces which should be redeclared at some point.
+ * @param om_element pointer to om_element
+ * @param env environment MUST not be NULL
+ * @param om_node pointer to this element node
+ * @param inscope_namespaces pointer to hash of parent namespaces
+ */
+ void AXIS2_CALL
+ axiom_element_redeclare_parent_namespaces(
+ axiom_element_t * om_element,
+ const axutil_env_t * env,
+ axiom_node_t * om_node,
+ axutil_hash_t *inscope_namespaces);
+
+ /**
+ * If the provided namespace used by the provided element is one of the namespaces from the
+ * parent of the root element, redeclares that namespace at the root element and removes it
+ * from the hash of parent namespaces
+ * @param om_element pointer to om_element
+ * @param env environment MUST not be NULL
+ * @param om_node pointer to this element node
+ * @param ns pointer to namespace to redeclare
+ * @param inscope_namespaces pointer to hash of parent namespaces
+ */
+ void AXIS2_CALL
+ axiom_element_use_parent_namespace(
+ axiom_element_t * om_element,
+ const axutil_env_t * env,
+ axiom_node_t * om_node,
+ axiom_namespace_t *ns,
+ axutil_hash_t *inscope_namespaces);
+
+ /**
+ * retrieves the default namespace of this element
+ * @param om_element pointer to om element
+ * @param env axutil_environment MUST Not be NULL
+ * @param element_node corresponding om element node of this om element
+ * @returns pointer to default namespace if available , NULL otherwise
+ */
+ axiom_namespace_t *AXIS2_CALL
+ axiom_element_get_default_namespace(
+ axiom_element_t * om_element,
+ const axutil_env_t * env,
+ axiom_node_t * element_node);
+
+ /**
+ * Serializes the start part of the given element
+ * @param element element to be serialized.
+ * @param env Environment. MUST NOT be NULL.
+ * @param om_output AXIOM output handler to be used in serializing
+ * @return status of the operation. AXIS2_SUCCESS on success else AXIS2_FAILURE
+ */
+ axis2_status_t AXIS2_CALL
+ axiom_element_serialize_start_part(
+ axiom_element_t * om_element,
+ const axutil_env_t * env,
+ axiom_output_t * om_output,
+ axiom_node_t * ele_node);
+
+ /**
+ * Serializes the end part of the given element. serialize_start_part must
+ * have been called before calling this method.
+ * @param om_element pointer to om_element
+ * @param env environment MUST not be NULL
+ * @param om_node pointer to this element node
+ * @param om_output AXIOM output handler to be used in serializing
+ * @return status of the operation. AXIS2_SUCCESS on success else AXIS2_FAILURE
+ */
+ axis2_status_t AXIS2_CALL
+ axiom_element_serialize_end_part(
+ axiom_element_t * om_element,
+ const axutil_env_t * env,
+ axiom_output_t * om_output);
+
+ /**
+ * Set whether the element is empty or not
+ * @param om_element pointer to om_element
+ * @param env environment MUST not be NULL
+ * @param is_empty AXIS2_TRUE if empty AXIS2_FALSE if not empty
+ * @return VOID
+ */
+ void AXIS2_CALL
+ axiom_element_set_is_empty(
+ axiom_element_t * om_element,
+ const axutil_env_t * env,
+ axis2_bool_t is_empty);
+
+#endif /* AXIOM_ELEMENT_INTERNAL_H_ */
Modified: axis/axis2/c/core/trunk/axiom/src/soap/axiom_soap_builder_internal.h
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/src/soap/axiom_soap_builder_internal.h?rev=958884&r1=958883&r2=958884&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/axiom/src/soap/axiom_soap_builder_internal.h (original)
+++ axis/axis2/c/core/trunk/axiom/src/soap/axiom_soap_builder_internal.h Tue Jun 29 08:57:05 2010
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 AXIOM_SOAP_BUILDER_INTERNAL_H_
-#define AXIOM_SOAP_BUILDER_INTERNAL_H_
-
-/** @defgroup axiom_soap AXIOM (Axis Object Model)
- * @ingroup axis2
- * @{
- */
-
-#include <axiom_soap_builder.h>
-
- axis2_status_t AXIS2_CALL
- axiom_soap_builder_construct_node(
- axiom_soap_builder_t * soap_builder,
- const axutil_env_t * env,
- axiom_node_t * om_element_node);
-
-/** @} */
-
-#endif /* AXIOM_SOAP_BUILDER_INTERNAL_H_ */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 AXIOM_SOAP_BUILDER_INTERNAL_H_
+#define AXIOM_SOAP_BUILDER_INTERNAL_H_
+
+/** @defgroup axiom_soap AXIOM (Axis Object Model)
+ * @ingroup axis2
+ * @{
+ */
+
+#include <axiom_soap_builder.h>
+
+ axis2_status_t AXIS2_CALL
+ axiom_soap_builder_construct_node(
+ axiom_soap_builder_t * soap_builder,
+ const axutil_env_t * env,
+ axiom_node_t * om_element_node);
+
+/** @} */
+
+#endif /* AXIOM_SOAP_BUILDER_INTERNAL_H_ */
Modified: axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking.c?rev=958884&r1=958883&r2=958884&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking.c (original)
+++ axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking.c Tue Jun 29 08:57:05 2010
@@ -1,124 +1,124 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "echo_util.h"
-#include <axis2_util.h>
-#include <axiom_soap.h>
-#include <axis2_client.h>
-
-int
-main (int argc, char **argv)
-{
- const axutil_env_t* env = NULL;
- const axis2_char_t* address = NULL;
- axis2_endpoint_ref_t* endpoint_ref = NULL;
- axis2_options_t* options = NULL;
- const axis2_char_t* client_home = NULL;
- axis2_svc_client_t* svc_client = NULL;
- axiom_node_t* payload = NULL;
- axiom_node_t* ret_node = NULL;
-
- /* Set up the environment */
- env = axutil_env_create_all ("echo_blocking_amqp.log", AXIS2_LOG_LEVEL_TRACE);
-
- /* Set end point reference of echo service */
- address = "amqp://localhost:5672/axis2/services/echo";
- if (argc > 1)
- address = argv[1];
-
- if (axutil_strcmp (address, "-h") == 0)
- {
- printf ("Usage : %s [endpoint_url]\n", argv[0]);
- printf ("use -h for help\n");
-
- return 0;
- }
-
- printf ("Using endpoint : %s\n", address);
-
- /* Create EPR with given address */
- endpoint_ref = axis2_endpoint_ref_create (env, address);
-
- /* Setup options */
- options = axis2_options_create (env);
- axis2_options_set_to (options, env, endpoint_ref);
-
- /* Set up deploy folder */
- client_home = AXIS2_GETENV ("AXIS2C_HOME");
- if (!client_home || !strcmp (client_home, ""))
- client_home = "../..";
-
- /* Create 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);
-
- /* Build the SOAP request message payload using OM API. */
- payload = build_om_payload_for_echo_svc (env);
-
- /* Send request and get response */
- ret_node = axis2_svc_client_send_receive (svc_client, env, payload);
-
- if (ret_node)
- {
- axis2_char_t *om_str = NULL;
- om_str = axiom_node_to_string (ret_node, env);
- if (om_str)
- {
- printf ("\nReceived OM : %s\n", om_str);
- AXIS2_FREE (env->allocator, om_str);
- }
-
- printf ("\necho client invoke SUCCESSFUL!\n");
- }
- else
- {
- AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
- "Stub invoke FAILED: Error code:" " %d :: %s",
- env->error->error_number,
- AXIS2_ERROR_GET_MESSAGE (env->error));
-
- printf ("echo client invoke FAILED!\n");
- }
-
- if (svc_client)
- {
- axis2_svc_client_free (svc_client, env);
- svc_client = NULL;
- }
-
- if (env)
- {
- axutil_env_free ((axutil_env_t*)env);
- env = NULL;
- }
-
- return 0;
-}
-
-
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+#include "echo_util.h"
+#include <axis2_util.h>
+#include <axiom_soap.h>
+#include <axis2_client.h>
+
+int
+main (int argc, char **argv)
+{
+ const axutil_env_t* env = NULL;
+ const axis2_char_t* address = NULL;
+ axis2_endpoint_ref_t* endpoint_ref = NULL;
+ axis2_options_t* options = NULL;
+ const axis2_char_t* client_home = NULL;
+ axis2_svc_client_t* svc_client = NULL;
+ axiom_node_t* payload = NULL;
+ axiom_node_t* ret_node = NULL;
+
+ /* Set up the environment */
+ env = axutil_env_create_all ("echo_blocking_amqp.log", AXIS2_LOG_LEVEL_TRACE);
+
+ /* Set end point reference of echo service */
+ address = "amqp://localhost:5672/axis2/services/echo";
+ if (argc > 1)
+ address = argv[1];
+
+ if (axutil_strcmp (address, "-h") == 0)
+ {
+ printf ("Usage : %s [endpoint_url]\n", argv[0]);
+ printf ("use -h for help\n");
+
+ return 0;
+ }
+
+ printf ("Using endpoint : %s\n", address);
+
+ /* Create EPR with given address */
+ endpoint_ref = axis2_endpoint_ref_create (env, address);
+
+ /* Setup options */
+ options = axis2_options_create (env);
+ axis2_options_set_to (options, env, endpoint_ref);
+
+ /* Set up deploy folder */
+ client_home = AXIS2_GETENV ("AXIS2C_HOME");
+ if (!client_home || !strcmp (client_home, ""))
+ client_home = "../..";
+
+ /* Create 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);
+
+ /* Build the SOAP request message payload using OM API. */
+ payload = build_om_payload_for_echo_svc (env);
+
+ /* Send request and get response */
+ ret_node = axis2_svc_client_send_receive (svc_client, env, payload);
+
+ if (ret_node)
+ {
+ axis2_char_t *om_str = NULL;
+ om_str = axiom_node_to_string (ret_node, env);
+ if (om_str)
+ {
+ printf ("\nReceived OM : %s\n", om_str);
+ AXIS2_FREE (env->allocator, om_str);
+ }
+
+ printf ("\necho client invoke SUCCESSFUL!\n");
+ }
+ else
+ {
+ AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
+ "Stub invoke FAILED: Error code:" " %d :: %s",
+ env->error->error_number,
+ AXIS2_ERROR_GET_MESSAGE (env->error));
+
+ printf ("echo client invoke FAILED!\n");
+ }
+
+ if (svc_client)
+ {
+ axis2_svc_client_free (svc_client, env);
+ svc_client = NULL;
+ }
+
+ if (env)
+ {
+ axutil_env_free ((axutil_env_t*)env);
+ env = NULL;
+ }
+
+ return 0;
+}
+
+
Modified: axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_addr.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_addr.c?rev=958884&r1=958883&r2=958884&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_addr.c (original)
+++ axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_addr.c Tue Jun 29 08:57:05 2010
@@ -1,132 +1,132 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "echo_util.h"
-#include <axis2_util.h>
-#include <axiom_soap.h>
-#include <axis2_client.h>
-
-int
-main(
- int argc,
- char **argv)
-{
- const axutil_env_t *env = NULL;
- const axis2_char_t *address = NULL;
- axis2_endpoint_ref_t *endpoint_ref = NULL;
- axis2_options_t *options = NULL;
- const axis2_char_t *client_home = NULL;
- axis2_svc_client_t *svc_client = NULL;
- axiom_node_t *payload = NULL;
- axiom_node_t *ret_node = NULL;
-
- /* Set up the environment */
- env =
- axutil_env_create_all("echo_blocking_addr_amqp.log", AXIS2_LOG_LEVEL_TRACE);
-
- /* Set end point reference of echo service */
- address = "amqp://localhost:5672/axis2/services/echo";
- if (argc > 1)
- address = argv[1];
- if (axutil_strcmp(address, "-h") == 0)
- {
- printf("Usage : %s [endpoint_url]\n", argv[0]);
- printf("use -h for help\n");
- return 0;
- }
- printf("Using endpoint : %s\n", address);
-
- /* Create EPR with given address */
- endpoint_ref = axis2_endpoint_ref_create(env, address);
-
- /* Setup options */
- options = axis2_options_create(env);
- axis2_options_set_to(options, env, endpoint_ref);
- axis2_options_set_action(options, env,
- "http://ws.apache.org/axis2/c/samples/echoString");
-
- /* Set up deploy folder. It is from the deploy folder, the configuration is picked up
- * using the axis2.xml file.
- * In this sample client_home points to the Axis2/C default deploy folder. The client_home can
- * be different from this folder on your system. For example, you may have a different folder
- * (say, my_client_folder) with its own axis2.xml file. my_client_folder/modules will have the
- * modules that the client uses
- */
- client_home = AXIS2_GETENV("AXIS2C_HOME");
- if (!client_home || !strcmp(client_home, ""))
- client_home = "../..";
-
- /* Create 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);
-
- /* Engage addressing module */
- axis2_svc_client_engage_module(svc_client, env, AXIS2_MODULE_ADDRESSING);
-
- /* Build the SOAP request message payload using OM API. */
- payload = build_om_payload_for_echo_svc(env);
-
- /* Send request */
- ret_node = axis2_svc_client_send_receive(svc_client, env, payload);
-
- if (ret_node)
- {
- axis2_char_t *om_str = NULL;
- om_str = axiom_node_to_string(ret_node, env);
- if (om_str)
- {
- printf("\nReceived OM : %s\n", om_str);
- AXIS2_FREE(env->allocator, om_str);
- }
- printf("\necho client invoke SUCCESSFUL!\n");
- }
- else
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Stub invoke FAILED: Error code:" " %d :: %s",
- env->error->error_number,
- AXIS2_ERROR_GET_MESSAGE(env->error));
- printf("echo client invoke FAILED!\n");
- }
-
- if (svc_client)
- {
- axis2_svc_client_free(svc_client, env);
- svc_client = NULL;
- }
-
- if (env)
- {
- axutil_env_free((axutil_env_t *) env);
- env = NULL;
- }
-
- return 0;
-}
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+#include "echo_util.h"
+#include <axis2_util.h>
+#include <axiom_soap.h>
+#include <axis2_client.h>
+
+int
+main(
+ int argc,
+ char **argv)
+{
+ const axutil_env_t *env = NULL;
+ const axis2_char_t *address = NULL;
+ axis2_endpoint_ref_t *endpoint_ref = NULL;
+ axis2_options_t *options = NULL;
+ const axis2_char_t *client_home = NULL;
+ axis2_svc_client_t *svc_client = NULL;
+ axiom_node_t *payload = NULL;
+ axiom_node_t *ret_node = NULL;
+
+ /* Set up the environment */
+ env =
+ axutil_env_create_all("echo_blocking_addr_amqp.log", AXIS2_LOG_LEVEL_TRACE);
+
+ /* Set end point reference of echo service */
+ address = "amqp://localhost:5672/axis2/services/echo";
+ if (argc > 1)
+ address = argv[1];
+ if (axutil_strcmp(address, "-h") == 0)
+ {
+ printf("Usage : %s [endpoint_url]\n", argv[0]);
+ printf("use -h for help\n");
+ return 0;
+ }
+ printf("Using endpoint : %s\n", address);
+
+ /* Create EPR with given address */
+ endpoint_ref = axis2_endpoint_ref_create(env, address);
+
+ /* Setup options */
+ options = axis2_options_create(env);
+ axis2_options_set_to(options, env, endpoint_ref);
+ axis2_options_set_action(options, env,
+ "http://ws.apache.org/axis2/c/samples/echoString");
+
+ /* Set up deploy folder. It is from the deploy folder, the configuration is picked up
+ * using the axis2.xml file.
+ * In this sample client_home points to the Axis2/C default deploy folder. The client_home can
+ * be different from this folder on your system. For example, you may have a different folder
+ * (say, my_client_folder) with its own axis2.xml file. my_client_folder/modules will have the
+ * modules that the client uses
+ */
+ client_home = AXIS2_GETENV("AXIS2C_HOME");
+ if (!client_home || !strcmp(client_home, ""))
+ client_home = "../..";
+
+ /* Create 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);
+
+ /* Engage addressing module */
+ axis2_svc_client_engage_module(svc_client, env, AXIS2_MODULE_ADDRESSING);
+
+ /* Build the SOAP request message payload using OM API. */
+ payload = build_om_payload_for_echo_svc(env);
+
+ /* Send request */
+ ret_node = axis2_svc_client_send_receive(svc_client, env, payload);
+
+ if (ret_node)
+ {
+ axis2_char_t *om_str = NULL;
+ om_str = axiom_node_to_string(ret_node, env);
+ if (om_str)
+ {
+ printf("\nReceived OM : %s\n", om_str);
+ AXIS2_FREE(env->allocator, om_str);
+ }
+ printf("\necho client invoke SUCCESSFUL!\n");
+ }
+ else
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+ "Stub invoke FAILED: Error code:" " %d :: %s",
+ env->error->error_number,
+ AXIS2_ERROR_GET_MESSAGE(env->error));
+ printf("echo client invoke FAILED!\n");
+ }
+
+ if (svc_client)
+ {
+ axis2_svc_client_free(svc_client, env);
+ svc_client = NULL;
+ }
+
+ if (env)
+ {
+ axutil_env_free((axutil_env_t *) env);
+ env = NULL;
+ }
+
+ return 0;
+}
Modified: axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_dual.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_dual.c?rev=958884&r1=958883&r2=958884&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_dual.c (original)
+++ axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_dual.c Tue Jun 29 08:57:05 2010
@@ -1,142 +1,142 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "echo_util.h"
-#include <axis2_util.h>
-#include <axiom_soap.h>
-#include <axis2_client.h>
-
-int
-main(
- int argc,
- char **argv)
-{
- const axutil_env_t *env = NULL;
- const axis2_char_t *address = NULL;
- axis2_endpoint_ref_t *endpoint_ref = NULL;
- axis2_endpoint_ref_t *reply_to = NULL;
- axis2_options_t *options = NULL;
- const axis2_char_t *client_home = NULL;
- axis2_svc_client_t *svc_client = NULL;
- axiom_node_t *payload = NULL;
- axiom_node_t *ret_node = NULL;
-
- /* Set up the environment */
- env =
- axutil_env_create_all("echo_blocking_dual_amqp.log", AXIS2_LOG_LEVEL_TRACE);
-
- /* Set end point reference of echo service */
- address = "amqp://localhost:5672/axis2/services/echo";
- if (argc > 1)
- address = argv[1];
- if (axutil_strcmp(address, "-h") == 0)
- {
- printf("Usage : %s [endpoint_url]\n", argv[0]);
- printf("use -h for help\n");
- return 0;
- }
- printf("Using endpoint : %s\n", address);
-
- /* Create EPR with given address */
- endpoint_ref = axis2_endpoint_ref_create(env, address);
-
- /* Setup options */
- options = axis2_options_create(env);
- axis2_options_set_to(options, env, endpoint_ref);
- axis2_options_set_use_separate_listener(options, env, AXIS2_TRUE);
-
- /* Seperate listner needs addressing, hence addressing stuff in options */
- axis2_options_set_action(options, env,
- "http://ws.apache.org/axis2/c/samples/echoString");
- reply_to =
- axis2_endpoint_ref_create(env,
- "amqp://localhost:5672/axis2/services/__ANONYMOUS_SERVICE__");
- axis2_options_set_reply_to(options, env, reply_to);
-
- axis2_options_set_transport_in_protocol(options, env, AXIS2_TRANSPORT_ENUM_AMQP);
-
- /* Set up deploy folder. It is from the deploy folder, the configuration is picked up
- * using the axis2.xml file.
- * In this sample client_home points to the Axis2/C default deploy folder. The client_home can
- * be different from this folder on your system. For example, you may have a different folder
- * (say, my_client_folder) with its own axis2.xml file. my_client_folder/modules will have the
- * modules that the client uses
- */
- client_home = AXIS2_GETENV("AXIS2C_HOME");
- if (!client_home || !strcmp(client_home, ""))
- client_home = "../..";
-
- /* Create 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);
-
- axis2_svc_client_engage_module(svc_client, env, AXIS2_MODULE_ADDRESSING);
-
- /* Build the SOAP request message payload using OM API. */
- payload = build_om_payload_for_echo_svc(env);
-
- /* Send request */
- ret_node = axis2_svc_client_send_receive(svc_client, env, payload);
-
- if (ret_node)
- {
- axis2_char_t *om_str = NULL;
- om_str = axiom_node_to_string(ret_node, env);
- if (om_str)
- {
- printf("\nReceived OM : %s\n", om_str);
- AXIS2_FREE(env->allocator, om_str);
- }
- printf("\necho client invoke SUCCESSFUL!\n");
- }
- else
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Stub invoke FAILED: Error code:" " %d :: %s",
- env->error->error_number,
- AXIS2_ERROR_GET_MESSAGE(env->error));
- printf("echo client invoke FAILED!\n");
- }
-
- if (svc_client)
- {
- AXIS2_SLEEP(1);
- axis2_svc_client_free(svc_client, env);
- svc_client = NULL;
- }
-
- if (env)
- {
- axutil_env_free((axutil_env_t *) env);
- env = NULL;
- }
-
- return 0;
-}
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+#include "echo_util.h"
+#include <axis2_util.h>
+#include <axiom_soap.h>
+#include <axis2_client.h>
+
+int
+main(
+ int argc,
+ char **argv)
+{
+ const axutil_env_t *env = NULL;
+ const axis2_char_t *address = NULL;
+ axis2_endpoint_ref_t *endpoint_ref = NULL;
+ axis2_endpoint_ref_t *reply_to = NULL;
+ axis2_options_t *options = NULL;
+ const axis2_char_t *client_home = NULL;
+ axis2_svc_client_t *svc_client = NULL;
+ axiom_node_t *payload = NULL;
+ axiom_node_t *ret_node = NULL;
+
+ /* Set up the environment */
+ env =
+ axutil_env_create_all("echo_blocking_dual_amqp.log", AXIS2_LOG_LEVEL_TRACE);
+
+ /* Set end point reference of echo service */
+ address = "amqp://localhost:5672/axis2/services/echo";
+ if (argc > 1)
+ address = argv[1];
+ if (axutil_strcmp(address, "-h") == 0)
+ {
+ printf("Usage : %s [endpoint_url]\n", argv[0]);
+ printf("use -h for help\n");
+ return 0;
+ }
+ printf("Using endpoint : %s\n", address);
+
+ /* Create EPR with given address */
+ endpoint_ref = axis2_endpoint_ref_create(env, address);
+
+ /* Setup options */
+ options = axis2_options_create(env);
+ axis2_options_set_to(options, env, endpoint_ref);
+ axis2_options_set_use_separate_listener(options, env, AXIS2_TRUE);
+
+ /* Seperate listner needs addressing, hence addressing stuff in options */
+ axis2_options_set_action(options, env,
+ "http://ws.apache.org/axis2/c/samples/echoString");
+ reply_to =
+ axis2_endpoint_ref_create(env,
+ "amqp://localhost:5672/axis2/services/__ANONYMOUS_SERVICE__");
+ axis2_options_set_reply_to(options, env, reply_to);
+
+ axis2_options_set_transport_in_protocol(options, env, AXIS2_TRANSPORT_ENUM_AMQP);
+
+ /* Set up deploy folder. It is from the deploy folder, the configuration is picked up
+ * using the axis2.xml file.
+ * In this sample client_home points to the Axis2/C default deploy folder. The client_home can
+ * be different from this folder on your system. For example, you may have a different folder
+ * (say, my_client_folder) with its own axis2.xml file. my_client_folder/modules will have the
+ * modules that the client uses
+ */
+ client_home = AXIS2_GETENV("AXIS2C_HOME");
+ if (!client_home || !strcmp(client_home, ""))
+ client_home = "../..";
+
+ /* Create 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);
+
+ axis2_svc_client_engage_module(svc_client, env, AXIS2_MODULE_ADDRESSING);
+
+ /* Build the SOAP request message payload using OM API. */
+ payload = build_om_payload_for_echo_svc(env);
+
+ /* Send request */
+ ret_node = axis2_svc_client_send_receive(svc_client, env, payload);
+
+ if (ret_node)
+ {
+ axis2_char_t *om_str = NULL;
+ om_str = axiom_node_to_string(ret_node, env);
+ if (om_str)
+ {
+ printf("\nReceived OM : %s\n", om_str);
+ AXIS2_FREE(env->allocator, om_str);
+ }
+ printf("\necho client invoke SUCCESSFUL!\n");
+ }
+ else
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+ "Stub invoke FAILED: Error code:" " %d :: %s",
+ env->error->error_number,
+ AXIS2_ERROR_GET_MESSAGE(env->error));
+ printf("echo client invoke FAILED!\n");
+ }
+
+ if (svc_client)
+ {
+ AXIS2_SLEEP(1);
+ axis2_svc_client_free(svc_client, env);
+ svc_client = NULL;
+ }
+
+ if (env)
+ {
+ axutil_env_free((axutil_env_t *) env);
+ env = NULL;
+ }
+
+ return 0;
+}
Modified: axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_soap11.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_soap11.c?rev=958884&r1=958883&r2=958884&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_soap11.c (original)
+++ axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_blocking_soap11.c Tue Jun 29 08:57:05 2010
@@ -1,135 +1,135 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "echo_util.h"
-#include <axis2_util.h>
-#include <axiom_soap.h>
-#include <axis2_client.h>
-
-int
-main(
- int argc,
- char **argv)
-{
- const axutil_env_t *env = NULL;
- const axis2_char_t *address = NULL;
- axis2_endpoint_ref_t *endpoint_ref = NULL;
- axis2_options_t *options = NULL;
- const axis2_char_t *client_home = NULL;
- axis2_svc_client_t *svc_client = NULL;
- axiom_node_t *payload = NULL;
- axiom_node_t *ret_node = NULL;
- axutil_string_t *soap_action = NULL;
-
- /* Set up the environment */
- env =
- axutil_env_create_all("echo_blocking_soap11_amqp.log",
- AXIS2_LOG_LEVEL_TRACE);
-
- /* Set end point reference of echo service */
- address = "amqp://localhost:5672/axis2/services/echo";
- if (argc > 1)
- address = argv[1];
- if (axutil_strcmp(address, "-h") == 0)
- {
- printf("Usage : %s [endpoint_url]\n", argv[0]);
- printf("use -h for help\n");
- return 0;
- }
- printf("Using endpoint : %s\n", address);
-
- /* Create EPR with given address */
- endpoint_ref = axis2_endpoint_ref_create(env, address);
-
- /* Setup options */
- options = axis2_options_create(env);
- axis2_options_set_to(options, env, endpoint_ref);
- axis2_options_set_soap_version(options, env, AXIOM_SOAP11);
- soap_action =
- axutil_string_create(env,
- "http://ws.apache.org/axis2/c/samples/echo/soap_action");
- axis2_options_set_soap_action(options, env, soap_action);
- axutil_string_free(soap_action, env);
-
- /* Set up deploy folder. It is from the deploy folder, the configuration is picked up
- * using the axis2.xml file.
- * In this sample client_home points to the Axis2/C default deploy folder. The client_home can
- * be different from this folder on your system. For example, you may have a different folder
- * (say, my_client_folder) with its own axis2.xml file. my_client_folder/modules will have the
- * modules that the client uses
- */
- client_home = AXIS2_GETENV("AXIS2C_HOME");
- if (!client_home || !strcmp(client_home, ""))
- client_home = "../..";
-
- /* Create 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);
-
- /* Build the SOAP request message payload using OM API. */
- payload = build_om_payload_for_echo_svc(env);
-
- /* Send request */
- ret_node = axis2_svc_client_send_receive(svc_client, env, payload);
-
- if (ret_node)
- {
- axis2_char_t *om_str = NULL;
- om_str = axiom_node_to_string(ret_node, env);
- if (om_str)
- {
- printf("\nReceived OM : %s\n", om_str);
- AXIS2_FREE(env->allocator, om_str);
- }
- printf("\necho client invoke SUCCESSFUL!\n");
- }
- else
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Stub invoke FAILED: Error code:" " %d :: %s",
- env->error->error_number,
- AXIS2_ERROR_GET_MESSAGE(env->error));
- printf("echo client invoke FAILED!\n");
- }
-
- if (svc_client)
- {
- axis2_svc_client_free(svc_client, env);
- svc_client = NULL;
- }
-
- if (env)
- {
- axutil_env_free((axutil_env_t *) env);
- env = NULL;
- }
-
- return 0;
-}
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+#include "echo_util.h"
+#include <axis2_util.h>
+#include <axiom_soap.h>
+#include <axis2_client.h>
+
+int
+main(
+ int argc,
+ char **argv)
+{
+ const axutil_env_t *env = NULL;
+ const axis2_char_t *address = NULL;
+ axis2_endpoint_ref_t *endpoint_ref = NULL;
+ axis2_options_t *options = NULL;
+ const axis2_char_t *client_home = NULL;
+ axis2_svc_client_t *svc_client = NULL;
+ axiom_node_t *payload = NULL;
+ axiom_node_t *ret_node = NULL;
+ axutil_string_t *soap_action = NULL;
+
+ /* Set up the environment */
+ env =
+ axutil_env_create_all("echo_blocking_soap11_amqp.log",
+ AXIS2_LOG_LEVEL_TRACE);
+
+ /* Set end point reference of echo service */
+ address = "amqp://localhost:5672/axis2/services/echo";
+ if (argc > 1)
+ address = argv[1];
+ if (axutil_strcmp(address, "-h") == 0)
+ {
+ printf("Usage : %s [endpoint_url]\n", argv[0]);
+ printf("use -h for help\n");
+ return 0;
+ }
+ printf("Using endpoint : %s\n", address);
+
+ /* Create EPR with given address */
+ endpoint_ref = axis2_endpoint_ref_create(env, address);
+
+ /* Setup options */
+ options = axis2_options_create(env);
+ axis2_options_set_to(options, env, endpoint_ref);
+ axis2_options_set_soap_version(options, env, AXIOM_SOAP11);
+ soap_action =
+ axutil_string_create(env,
+ "http://ws.apache.org/axis2/c/samples/echo/soap_action");
+ axis2_options_set_soap_action(options, env, soap_action);
+ axutil_string_free(soap_action, env);
+
+ /* Set up deploy folder. It is from the deploy folder, the configuration is picked up
+ * using the axis2.xml file.
+ * In this sample client_home points to the Axis2/C default deploy folder. The client_home can
+ * be different from this folder on your system. For example, you may have a different folder
+ * (say, my_client_folder) with its own axis2.xml file. my_client_folder/modules will have the
+ * modules that the client uses
+ */
+ client_home = AXIS2_GETENV("AXIS2C_HOME");
+ if (!client_home || !strcmp(client_home, ""))
+ client_home = "../..";
+
+ /* Create 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);
+
+ /* Build the SOAP request message payload using OM API. */
+ payload = build_om_payload_for_echo_svc(env);
+
+ /* Send request */
+ ret_node = axis2_svc_client_send_receive(svc_client, env, payload);
+
+ if (ret_node)
+ {
+ axis2_char_t *om_str = NULL;
+ om_str = axiom_node_to_string(ret_node, env);
+ if (om_str)
+ {
+ printf("\nReceived OM : %s\n", om_str);
+ AXIS2_FREE(env->allocator, om_str);
+ }
+ printf("\necho client invoke SUCCESSFUL!\n");
+ }
+ else
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+ "Stub invoke FAILED: Error code:" " %d :: %s",
+ env->error->error_number,
+ AXIS2_ERROR_GET_MESSAGE(env->error));
+ printf("echo client invoke FAILED!\n");
+ }
+
+ if (svc_client)
+ {
+ axis2_svc_client_free(svc_client, env);
+ svc_client = NULL;
+ }
+
+ if (env)
+ {
+ axutil_env_free((axutil_env_t *) env);
+ env = NULL;
+ }
+
+ return 0;
+}
Modified: axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_non_blocking.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_non_blocking.c?rev=958884&r1=958883&r2=958884&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_non_blocking.c (original)
+++ axis/axis2/c/core/trunk/samples/client/amqp/echo/echo_non_blocking.c Tue Jun 29 08:57:05 2010
@@ -1,217 +1,217 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "echo_util.h"
-#include <axis2_util.h>
-#include <axiom_soap.h>
-#include <axis2_client.h>
-
-/* my on_complete callback function */
-axis2_status_t AXIS2_CALL
-echo_callback_on_complete (struct axis2_callback* callback,
- const axutil_env_t* env);
-
-/* my on_error callback function */
-axis2_status_t AXIS2_CALL
-echo_callback_on_error (struct axis2_callback* callback,
- const axutil_env_t* env,
- int exception);
-
-/* to check whether the callback is completed */
-int isComplete = 0;
-
-int
-main(int argc, char **argv)
-{
- const axutil_env_t *env = NULL;
- const axis2_char_t *address = NULL;
- axis2_endpoint_ref_t *endpoint_ref = NULL;
- axis2_options_t *options = NULL;
- const axis2_char_t *client_home = NULL;
- axis2_svc_client_t *svc_client = NULL;
- axiom_node_t *payload = NULL;
- axis2_callback_t *callback = NULL;
- int count = 0;
-
- /* Set up the environment */
- env = axutil_env_create_all ("echo_non_blocking_amqp.log", AXIS2_LOG_LEVEL_TRACE);
-
- /* Set end point reference of echo service */
- address = "amqp://localhost:5672/axis2/services/echo";
- if (argc > 1)
- address = argv[1];
-
- if (axutil_strcmp (address, "-h") == 0)
- {
- printf ("Usage : %s [endpoint_url]\n", argv[0]);
- printf ("use -h for help\n");
-
- return 0;
- }
-
- printf ("Using endpoint : %s\n", address);
-
- /* Create EPR with given address */
- endpoint_ref = axis2_endpoint_ref_create (env, address);
-
- /* Setup options */
- options = axis2_options_create (env);
- axis2_options_set_to (options, env, endpoint_ref);
-
- /* Set up deploy folder */
- client_home = AXIS2_GETENV ("AXIS2C_HOME");
- if (!client_home || !strcmp (client_home, ""))
- client_home = "../..";
-
- /* Create 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);
-
- /* Build the SOAP request message payload using OM API. */
- payload = build_om_payload_for_echo_svc (env);
-
- /* Create the callback object with default on_complete and on_error
- callback functions */
- callback = axis2_callback_create (env);
-
- /* Set our on_complete fucntion pointer to the callback object */
- axis2_callback_set_on_complete (callback, echo_callback_on_complete);
-
- /* Set our on_error function pointer to the callback object */
- axis2_callback_set_on_error (callback, echo_callback_on_error);
-
- /* Send request */
- axis2_svc_client_send_receive_non_blocking (svc_client, env,
- payload, callback);
-
- /*Wait till callback is complete. Simply keep the parent thread running
- until our on_complete or on_error is invoked */
- while (count < 30)
- {
- if (isComplete)
- {
- /* We are done with the callback */
- break;
- }
-
- AXIS2_SLEEP (1);
- count++;
- }
-
- if (!(count < 30))
- {
- printf ("\necho client invoke FAILED. Counter timed out.\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;
-}
-
-axis2_status_t AXIS2_CALL
-echo_callback_on_complete(struct axis2_callback* callback,
- const axutil_env_t* env)
-{
-
- /** SOAP response has arrived here; get the soap envelope
- from the callback object and do whatever you want to do with it */
-
- axiom_soap_envelope_t *soap_envelope = NULL;
- axiom_node_t *ret_node = NULL;
- axis2_status_t status = AXIS2_SUCCESS;
-
- soap_envelope = axis2_callback_get_envelope (callback, env);
-
- if (!soap_envelope)
- {
- 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 stub invoke FAILED!\n");
- status = AXIS2_FAILURE;
- }
- else
- {
- ret_node = axiom_soap_envelope_get_base_node (soap_envelope, env);
-
- if (!ret_node)
- {
- 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 stub invoke FAILED!\n");
- status = AXIS2_FAILURE;
- }
- else
- {
- axis2_char_t *om_str = NULL;
- om_str = axiom_node_to_string (ret_node, env);
- if (om_str)
- {
- printf ("\nReceived OM : %s\n", om_str);
- AXIS2_FREE (env->allocator, om_str);
- }
-
- printf ("\necho client invoke SUCCESSFUL!\n");
- }
- }
-
- isComplete = 1;
- return status;
-}
-
-axis2_status_t AXIS2_CALL
-echo_callback_on_error (struct axis2_callback* callback,
- const axutil_env_t* env,
- int exception)
-{
-
- /** take necessary action on error */
- printf ("\necho client invike FAILED. Error code:%d ::%s", exception,
- AXIS2_ERROR_GET_MESSAGE (env->error));
-
- isComplete = 1;
-
- return AXIS2_SUCCESS;
-}
-
-
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+#include "echo_util.h"
+#include <axis2_util.h>
+#include <axiom_soap.h>
+#include <axis2_client.h>
+
+/* my on_complete callback function */
+axis2_status_t AXIS2_CALL
+echo_callback_on_complete (struct axis2_callback* callback,
+ const axutil_env_t* env);
+
+/* my on_error callback function */
+axis2_status_t AXIS2_CALL
+echo_callback_on_error (struct axis2_callback* callback,
+ const axutil_env_t* env,
+ int exception);
+
+/* to check whether the callback is completed */
+int isComplete = 0;
+
+int
+main(int argc, char **argv)
+{
+ const axutil_env_t *env = NULL;
+ const axis2_char_t *address = NULL;
+ axis2_endpoint_ref_t *endpoint_ref = NULL;
+ axis2_options_t *options = NULL;
+ const axis2_char_t *client_home = NULL;
+ axis2_svc_client_t *svc_client = NULL;
+ axiom_node_t *payload = NULL;
+ axis2_callback_t *callback = NULL;
+ int count = 0;
+
+ /* Set up the environment */
+ env = axutil_env_create_all ("echo_non_blocking_amqp.log", AXIS2_LOG_LEVEL_TRACE);
+
+ /* Set end point reference of echo service */
+ address = "amqp://localhost:5672/axis2/services/echo";
+ if (argc > 1)
+ address = argv[1];
+
+ if (axutil_strcmp (address, "-h") == 0)
+ {
+ printf ("Usage : %s [endpoint_url]\n", argv[0]);
+ printf ("use -h for help\n");
+
+ return 0;
+ }
+
+ printf ("Using endpoint : %s\n", address);
+
+ /* Create EPR with given address */
+ endpoint_ref = axis2_endpoint_ref_create (env, address);
+
+ /* Setup options */
+ options = axis2_options_create (env);
+ axis2_options_set_to (options, env, endpoint_ref);
+
+ /* Set up deploy folder */
+ client_home = AXIS2_GETENV ("AXIS2C_HOME");
+ if (!client_home || !strcmp (client_home, ""))
+ client_home = "../..";
+
+ /* Create 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);
+
+ /* Build the SOAP request message payload using OM API. */
+ payload = build_om_payload_for_echo_svc (env);
+
+ /* Create the callback object with default on_complete and on_error
+ callback functions */
+ callback = axis2_callback_create (env);
+
+ /* Set our on_complete fucntion pointer to the callback object */
+ axis2_callback_set_on_complete (callback, echo_callback_on_complete);
+
+ /* Set our on_error function pointer to the callback object */
+ axis2_callback_set_on_error (callback, echo_callback_on_error);
+
+ /* Send request */
+ axis2_svc_client_send_receive_non_blocking (svc_client, env,
+ payload, callback);
+
+ /*Wait till callback is complete. Simply keep the parent thread running
+ until our on_complete or on_error is invoked */
+ while (count < 30)
+ {
+ if (isComplete)
+ {
+ /* We are done with the callback */
+ break;
+ }
+
+ AXIS2_SLEEP (1);
+ count++;
+ }
+
+ if (!(count < 30))
+ {
+ printf ("\necho client invoke FAILED. Counter timed out.\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;
+}
+
+axis2_status_t AXIS2_CALL
+echo_callback_on_complete(struct axis2_callback* callback,
+ const axutil_env_t* env)
+{
+
+ /** SOAP response has arrived here; get the soap envelope
+ from the callback object and do whatever you want to do with it */
+
+ axiom_soap_envelope_t *soap_envelope = NULL;
+ axiom_node_t *ret_node = NULL;
+ axis2_status_t status = AXIS2_SUCCESS;
+
+ soap_envelope = axis2_callback_get_envelope (callback, env);
+
+ if (!soap_envelope)
+ {
+ 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 stub invoke FAILED!\n");
+ status = AXIS2_FAILURE;
+ }
+ else
+ {
+ ret_node = axiom_soap_envelope_get_base_node (soap_envelope, env);
+
+ if (!ret_node)
+ {
+ 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 stub invoke FAILED!\n");
+ status = AXIS2_FAILURE;
+ }
+ else
+ {
+ axis2_char_t *om_str = NULL;
+ om_str = axiom_node_to_string (ret_node, env);
+ if (om_str)
+ {
+ printf ("\nReceived OM : %s\n", om_str);
+ AXIS2_FREE (env->allocator, om_str);
+ }
+
+ printf ("\necho client invoke SUCCESSFUL!\n");
+ }
+ }
+
+ isComplete = 1;
+ return status;
+}
+
+axis2_status_t AXIS2_CALL
+echo_callback_on_error (struct axis2_callback* callback,
+ const axutil_env_t* env,
+ int exception)
+{
+
+ /** take necessary action on error */
+ printf ("\necho client invike FAILED. Error code:%d ::%s", exception,
+ AXIS2_ERROR_GET_MESSAGE (env->error));
+
+ isComplete = 1;
+
+ return AXIS2_SUCCESS;
+}
+
+