[Axis2] Woden: problems parsing operations with documentation elements

2006-11-17 Thread Jose Miguel Sanchez Martin


Hi,

After the issue AXIS2C-330 was fixed I have made tests with different 
wsdl files and it works now, but I have been able to reproduce exactly 
the same problem by modifying the googlesearch.wsdl file as follows:


[...]
 portType name=GoogleSearchPort

   operation name=doGetCachedPage
 documentationtest/documentation -- I have added this 
documentation element

 input message=typens:doGetCachedPage/
 output message=typens:doGetCachedPageResponse/
   /operation

   operation name=doSpellingSuggestion
 input message=typens:doSpellingSuggestion/
 output message=typens:doSpellingSuggestionResponse/
   /operation

   operation name=doGoogleSearch
 input message=typens:doGoogleSearch/
 output message=typens:doGoogleSearchResponse/
   /operation

 /portType
[...]

Without adding the documentation element to the operation it works.

The problem is the same, WODEN_DOCUMENTABLE_ADD_DOCUMENTATION_ELEMENT 
fails because the method add_documentation_element is null.


I have updated the AXIS2C-330 issue.

Many thanks,

Jose M. Sánchez


 Original Message 
Subject:Problems with woden
Date:   Wed, 11 Oct 2006 10:57:00 +0200
From:   Jose M. Sanchez [EMAIL PROTECTED]
To: axis-c-user@ws.apache.org




Hi,

I would like to invoke a web service operation without using the stub 
generator, to that goal I am using the woden parser to parse the WSDL 
file and generate the request message accordingly. But it crashes (I am 
testing this on Windows). While debugging I have found the following 
situation:


file: /c/woden/src/wsdl/documentable.c

I see that:

   documentable_impl_l = NULL

   woden_documentable_resolve_methods(
   woden_documentable_t *documentable,
   const axis2_env_t *env,
   woden_documentable_t *documentable_impl,
   axis2_hash_t *methods)
   {
   [...]
   documentable-ops-add_documentation_element =
   axis2_hash_get(methods, -- after this, add_documentation_element = NULL
   add_documentation_element, AXIS2_HASH_KEY_STRING);
   if (!documentable-ops-add_documentation_element 
   documentable_impl_l) -- it does not enter here
   documentable-ops-add_documentation_element =
  
   documentable_impl_l-documentable.ops-add_documentation_element;

   [...]
   }


after the execution of this function, the operation 
add_documentation_element = NULL, then in the following function it fails:



file: /c/woden/src/builder/wsdl10_reader.c

   static void *
   parse_interface_op(
   void *reader,
   const axis2_env_t *env,
   axiom_node_t *op_el_node,
   void *desc,
   void *parent)
   {
   [...]
   if (AXIS2_TRUE == axis2_qname_util_matches(env,
   q_elem_documentation, temp_el_node))
   {
   void *documentation = NULL;

   documentation = parse_documentation(reader, env,
   temp_el_node, desc);
   op = woden_interface_op_to_documentable(op, env);
   WODEN_DOCUMENTABLE_ADD_DOCUMENTATION_ELEMENT(op, env,
   documentation); -- Fails here
   }

   [...]
   }



The call to WODEN_DOCUMENTABLE_ADD_DOCUMENTATION_ELEMENT fails, because 
the method add_documentation_element is null.


I have tested this with my own code, as well as with the test_woden 
sample program (which is very similar to my code), using different wsdl 
files, for example the googlesearch.wsdl file, and the result was always 
the same.


Can this be a bug or am I doing something wrong?

Thanks  regards,

jms.





Problems with woden

2006-10-11 Thread Jose Miguel Sanchez Martin





Hi,


I would like to invoke a web service operation without using the
stub
generator, to that goal I am using the woden parser to parse the WSDL
file and generate the request message accordingly. But it crashes (I am
testing this on Windows). While debugging I have found the
following situation:

file: /c/woden/src/wsdl/documentable.c

I see that:

 documentable_impl_l = NULL


woden_documentable_resolve_methods(
   woden_documentable_t *documentable,
   const axis2_env_t *env,
   woden_documentable_t *documentable_impl,
   axis2_hash_t *methods)
  {
  [...]
   documentable-ops-add_documentation_element =
axis2_hash_get(methods, -- after this, add_documentation_element =
NULL
   "add_documentation_element", AXIS2_HASH_KEY_STRING);
   if (!documentable-ops-add_documentation_element
 documentable_impl_l) -- it does not enter here
   documentable-ops-add_documentation_element =
  
documentable_impl_l-documentable.ops-add_documentation_element;
  [...]
  }


after the execution of this function, the operation add_documentation_element
= NULL, then in the following function it fails:


file: /c/woden/src/builder/wsdl10_reader.c

static void *
  parse_interface_op(
   void *reader,
   const axis2_env_t *env,
   axiom_node_t *op_el_node,
   void *desc,
   void *parent)
  {
  [...]
   if (AXIS2_TRUE == axis2_qname_util_matches(env,
   q_elem_documentation, temp_el_node))
   {
   void *documentation = NULL;
  
   documentation = parse_documentation(reader, env,
temp_el_node, desc);
   op = woden_interface_op_to_documentable(op, env);
   WODEN_DOCUMENTABLE_ADD_DOCUMENTATION_ELEMENT(op, env,
documentation); -- Fails here
   }
  
  [...]
  }



The call to WODEN_DOCUMENTABLE_ADD_DOCUMENTATION_ELEMENT
fails, because the method add_documentation_element is
null.

I have tested this with my own code, as well as with the test_woden
sample program (which is very similar to my code), using different wsdl
files, for example the
googlesearch.wsdl file, and the result was always the same.

Can this be a bug or am I doing something wrong?

Thanks  regards,

jms.








How to specify the http transport content type

2006-10-05 Thread Jose Miguel Sanchez Martin


Hi,

I am trying to write a very simple client (my first axis2c test) for a 
calculator web service which is available out there. The code I have 
written is very similar to the simplest tutorial I have found in the 
AXIS2C documentation.


When I invoke a operation of this service, I get the following response:

Received OM : soap:Fault 
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;
CodeValuesoap:Client/Value/CodeReasonTextServer found 
request conte
nt type to be 'multipart/related; 
boundary=MIMEBoundary6d70feb7-0ba6-4aba-b4c2-4
0d46b0f8e08; type=amp;quot;application/xop+xmlamp;quot;; 
start=amp;quot;amp;
lt;[EMAIL PROTECTED]amp;gt;amp;quot;; 
start-in
fo=amp;quot;text/xmlamp;quot;; charset=amp;quot;UTF-8amp;quot;', but 
expecte

d 'text/xml'./Text/Reasondetail/detail/soap:Fault

I have read the documentation but I have not found a way to change the 
content type of the http request to be text/xml.


Could you please tell me how can I specify http_transport options?

Many thanks in advance,

jms.



P.S.: Bellow you can see the sample code I've written:


void axis_direct_test()
{

   const axis2_char_t *address = NULL;
   axis2_endpoint_ref_t* endpoint_ref = NULL;
   axis2_options_t *options = NULL;
   const axis2_env_t *env = 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;

   env = axis2_env_create_all(wsclient.log, AXIS2_LOG_LEVEL_TRACE);

   address = http://www.dneonline.com/calculator.asmx;;

   /* 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);

  


   AXIS2_OPTIONS_SET_ACTION(options, env,
   http://tempuri.org/Add;);


   client_home = AXIS2_GETENV(AXIS2C_HOME);
   if (!client_home)
   client_home = c:/axis;

   /* Create service client */
   svc_client = axis2_svc_client_create(env, client_home);
   if (!svc_client)
   {
   printf(Error creating service client\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));
   }

   /* 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_calculator_svc(env);

   /* Send request */
   ret_node = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);

   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);

}


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to specify the http transport content type

2006-10-05 Thread Jose Miguel Sanchez Martin



It works!

Thanks so much,

jms.



Nandika Jayawardana wrote:

Hi Jose,

I think the problem is due to axis2c sending a mime boundary with the 
soap message.

So comment out the following line in your axis2.xml file.

parameter name=enableMTOM locked=falsetrue/parameter

Regards.
Nandika

On 10/5/06, *Jose Miguel Sanchez Martin* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:



Hi,

I am trying to write a very simple client (my first axis2c test)
for a
calculator web service which is available out there. The code I have
written is very similar to the simplest tutorial I have found in the
AXIS2C documentation.

When I invoke a operation of this service, I get the following
response:

Received OM : soap:Fault
xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;
CodeValuesoap:Client/Value/CodeReasonTextServer found
request conte
nt type to be 'multipart/related;
boundary=MIMEBoundary6d70feb7-0ba6-4aba-b4c2-4
0d46b0f8e08; type=amp;quot;application/xop+xmlamp;quot;;
start=amp;quot;amp;
lt;0.99c18566-
[EMAIL PROTECTED]amp;gt;amp;quot;;
start-in
fo=amp;quot;text/xmlamp;quot;;
charset=amp;quot;UTF-8amp;quot;', but
expecte
d 'text/xml'./Text/Reasondetail/detail/soap:Fault

I have read the documentation but I have not found a way to change the
content type of the http request to be text/xml.

Could you please tell me how can I specify http_transport options?

Many thanks in advance,

jms.



P.S.: Bellow you can see the sample code I've written:


void axis_direct_test()
{

const axis2_char_t *address = NULL;
axis2_endpoint_ref_t* endpoint_ref = NULL;
axis2_options_t *options = NULL;
const axis2_env_t *env = 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;

env = axis2_env_create_all(wsclient.log, AXIS2_LOG_LEVEL_TRACE);

address = http://www.dneonline.com/calculator.asmx;;

/* 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);



AXIS2_OPTIONS_SET_ACTION(options, env,
http://tempuri.org/Add;);


client_home = AXIS2_GETENV(AXIS2C_HOME);
if (!client_home)
client_home = c:/axis;

/* Create service client */
svc_client = axis2_svc_client_create(env, client_home);
if (!svc_client)
{
printf(Error creating service client\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));
}

/* 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_calculator_svc(env);

/* Send request */
ret_node = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env,
payload);

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);

}


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]