axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juergen Haeussler <juergen.haeuss...@wieland.de>
Subject problems with ws and corba call in one client
Date Tue, 19 Jun 2007 09:13:31 GMT

Hi there,

we recently started to use axis2/c for accessing a Java-Webservice
(SOAP-Version 1.1) running in a JBoss 4.2 application server from within
our QT-/C++-Client.
We are additionally using Corba services as well.
Our Webservice call works correctly but it seems that something is left
(some port binding or something like that), because no corba call could be
established after that WS call.
If we leave out the WS call, the corba call works.

Here is our code:

      std::string logFileName = webServiceName + "_" + eventName + ".log";
      const axutil_env_t* env = axutil_env_create_all(logFileName.c_str(),
AXIS2_LOG_LEVEL_TRACE);
      axis2_options_t* options = axis2_options_create(env);
      axis2_options_set_soap_version_uri(options, env,
AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI);

      std::string wsAddress = getServerAdresse(webServiceName) + "/" +
webServiceName + "ImplService/" + webServiceName + "Impl";
      const axis2_char_t* address = wsAddress.c_str();
      axis2_endpoint_ref_t* endpoint_ref = axis2_endpoint_ref_create(env,
address);
      axis2_options_set_to(options, env, endpoint_ref);

      const axis2_char_t* client_home = AXIS2_GETENV("AXIS2C_HOME");
      if (!client_home && !strcmp(client_home, ""))
            client_home = "../..";
      axis2_svc_client_t* svc_client = axis2_svc_client_create(env,
client_home);
      if (!svc_client)
      {
            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));
      }
      axis2_svc_client_set_options(svc_client, env, options);

      std::string nameSpace = "http://" + webServiceName + "/";
      axiom_namespace_t *ns1 = axiom_namespace_create(env,
nameSpace.c_str(), "ns1");

      axiom_node_t *payload = NULL;
      axiom_element_t* payload_om_ele = axiom_element_create(env, NULL,
eventName.c_str(), ns1, &payload);

      axiom_node_t* param_om_node = 0;
      axiom_element_t* param_om_ele = axiom_element_create(env, payload,
"input", NULL, &param_om_node);
      axiom_element_set_text(param_om_ele, env, in.c_str(), param_om_node);

      axis2_char_t* buffer = axiom_node_to_string(payload, env);
      printf("%s\n", buffer);
      AXIS2_FREE(env->allocator, buffer);

      axiom_node_t* ret_node = axis2_svc_client_send_receive(svc_client,
env, payload);

      if (axis2_svc_client_get_last_response_has_fault(svc_client, env))
      {
            //TODO: handle soap faults
      }

      if (ret_node)
      {
                  if (axiom_node_get_node_type(ret_node, env) ==
AXIOM_ELEMENT)
                  {
                  //... parsing ws response
            }
      }
      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));
      }

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

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

Do we have to free anything else or to close any connections to the server
or something like that?
(If we have a look at our network connections via netstat, we se that the
connection to the jboss remains opened.)

Is there anybody who can imagine what could conflict with corba calls out
of the same client application?

Thanks,

Jürgen Häußler (IT/Hae)

----------------------------------------------------------------------------------------------

IF - Fertigungsleitsysteme, Anwendungsintegration, Web-Anwendungen

Tel.: +49 (0)731 944-6118
----------------------------------------------------------------------------------------------

------------------------------------------------------------------------
Wieland-Werke Aktiengesellschaft
Vorstand:
Harald Kroener, Sprecher
Dr. Jörg Hanisch
Werner T. Traa
Dr. Ulrich Hartmann

Vorsitzender des Aufsichtsrats:
Dr.-Ing. Wolfgang Eychmüller
Sitz der Gesellschaft: Ulm

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


Mime
View raw message