Re: How to set a value of type anyType in generated stub

2007-12-20 Thread Dimuthu Gamage
Hi Antonio,

I think what you want is to put some note in the soap message what
type of element you are sending for the any type.

Normally putting the type in the element happens in Encoded
(RPC/Encoded and DOC/Encoded) style WSDLs. But for DOC/Lit or DOC/Lit
wrapped WSDLs  the element doesnt have the type attribute. Check the
reference[1]. Since WSDL2C only support Literal style WSDLs, this is
not a bug.

So my suggestion is to change your wsdl to (if you can do it)








or to be more correct

  

  

  

  







[1] http://www-128.ibm.com/developerworks/webservices/library/ws-whichwsdl/

Thanks
Dimuthu


On Dec 20, 2007 2:59 PM, Antonio Chiurla <[EMAIL PROTECTED]> wrote:
> Hi Dimuthu,
>
> is correct the use of axiom_text_node, but the WebService I need to invoke
> expect for this node the attribute "type" to define the type of 
> metadata/value node.
> I.E. the piece of SOAP request shold be same as:
> 
>   Name of string metadata
>   value of metadata
> 
>
> or
>
> 
>   Name of int metadata
>   75
> 
>
>
> in the soap:Envelope tag we need to add following attributes to define
> the needed namespaces:
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>
>
> Trying to resolve this issue I have changed the generated stub in order to
> send the attribute "type" after added the namespaces, I think that a possibile
> generalized solution is to set an axiom_element:
>
>   adb_metadataValue_t* ifs_mdv;
>   axiom_element_t* my_axiom_element_value;
>   axiom_attribute_t* my_axiom_attribute_value_type;
>   axiom_node_t* my_axiom_node_value;
>
>
>   adb_metadataValue_set_metadataName(my_mdv,env,"Name of string metadata");
>   my_axiom_element_value = 
> axiom_element_create(env,NULL,"value",NULL,&my_axiom_node_value);
>
>   my_axiom_attribute_value_type = axiom_attribute_create(env, "type", 
> "xs:string", NULL);
>   axiom_element_add_attribute(my_axiom_element_value, env, 
> my_axiom_attribute_value_type, my_axiom_node_value);
>
>   axiom_element_set_text(my_axiom_element_value,env,"value of 
> metadata",my_axiom_node_value);
>   adb_metadataValue_set_value(my_mdv,env,my_axiom_node_value);
>
> Using this solution the stub generate the SOAP request as follow:
>
> 
>   Name of int metadata
>   
> 75
>   
> 
>
> The WebService can't parse correctly the previous SOAP request.
>
> Then I propose to change the stub adding code to read, if present, the "type" 
> attribute of
> axiom_element and add this attribute in the "value" tag in 
> adb_metadataValue_serialize
> function.
> Is this correct?
>
> Thanks Antonio
>
>
>
>
> On Wednesday 19 December 2007 19:07, Dimuthu Gamage wrote:
> > BTW you will face the same problem as the one in
> > https://issues.apache.org/jira/browse/AXIS2C-843. I will look in to
> > that ASAP.
> >
> > On Dec 19, 2007 11:17 PM, Dimuthu Gamage <[EMAIL PROTECTED]> wrote:
> > > Hi Antonio,
> > >
> > > If I m correct you are asking how to create string or int node so you
> > > can assign it the variable with anytype.
> > >
> > > You can use 'axiom_text_create' to create text element and corresponding 
> > > node.
> > >
> > > axiom_text_t* text_element;
> > > axiom_node_t *text_node;
> > >
> > > text_element = axiom_text_create(env,
> > >  NULL /* no parent at start */,
> > >  "SomeString" /* your string */,
> > >  &text_node);
> > >
> > > here you can set the text_node to the setter method of the above struct.
> > >
> > > you may set int, float values after converting them to string (May be
> > > using sprintf)
> > >
> > > Check http://ws.apache.org/axis2/c/docs/om_tutorial.html Code Listing
> > > 6 for an example.
> > >
> > > Thanks
> > > Dimuthu
> > >
> > >
> > >
> > >
> > > On Dec 19, 2007 10:56 PM, Antonio Chiurla <[EMAIL PROTECTED]> wrote:
> > > > Hi,
> > > > I have to set a value defined as anyType in wsdl and relative xsd:
> > > >
> > > > 
> > > > 
> > > > 
> > > > 
> > > >
> > > > I have generated the stub for this wsdl and the struct defined
> > > > to pass to the op contains a field of type axiom_node_t*
> > > >
> > > > struct adb_metadataValue
> > > > {
> > > > axis2_char_t* property_metadataName;
> > > >
> > > >
> > > > axis2_bool_t is_valid_metadataName;
> > > >
> > > > axiom_node_t* property_value;
> > > >
> > > >
> > > > axis2_bool_t is_valid_value;
> > > >
> > > >
> > > > };
> > > >
> > > >
> > > > I need to insert a string or int or other types depending of
> > > > some conditions verified at runtime.
> > > >
> > > >
> > > > Thanks
> > > >
> > > > Antonio Chiurla
> > > >
> > > >
> > > > ---
> > > >
> > > > -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> >
> > -

Re: How to set a value of type anyType in generated stub

2007-12-20 Thread Antonio Chiurla
Hi Dimuthu,

is correct the use of axiom_text_node, but the WebService I need to invoke
expect for this node the attribute "type" to define the type of metadata/value 
node.
I.E. the piece of SOAP request shold be same as:

  Name of string metadata
  value of metadata


or


  Name of int metadata
  75



in the soap:Envelope tag we need to add following attributes to define
the needed namespaces:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";


Trying to resolve this issue I have changed the generated stub in order to
send the attribute "type" after added the namespaces, I think that a possibile
generalized solution is to set an axiom_element:

  adb_metadataValue_t* ifs_mdv;
  axiom_element_t* my_axiom_element_value;
  axiom_attribute_t* my_axiom_attribute_value_type;
  axiom_node_t* my_axiom_node_value;


  adb_metadataValue_set_metadataName(my_mdv,env,"Name of string metadata");
  my_axiom_element_value = 
axiom_element_create(env,NULL,"value",NULL,&my_axiom_node_value);

  my_axiom_attribute_value_type = axiom_attribute_create(env, "type", 
"xs:string", NULL);
  axiom_element_add_attribute(my_axiom_element_value, env, 
my_axiom_attribute_value_type, my_axiom_node_value);

  axiom_element_set_text(my_axiom_element_value,env,"value of 
metadata",my_axiom_node_value);
  adb_metadataValue_set_value(my_mdv,env,my_axiom_node_value);

Using this solution the stub generate the SOAP request as follow:


  Name of int metadata
  
75
  


The WebService can't parse correctly the previous SOAP request.

Then I propose to change the stub adding code to read, if present, the "type" 
attribute of
axiom_element and add this attribute in the "value" tag in 
adb_metadataValue_serialize
function.
Is this correct?

Thanks Antonio



On Wednesday 19 December 2007 19:07, Dimuthu Gamage wrote:
> BTW you will face the same problem as the one in
> https://issues.apache.org/jira/browse/AXIS2C-843. I will look in to
> that ASAP.
> 
> On Dec 19, 2007 11:17 PM, Dimuthu Gamage <[EMAIL PROTECTED]> wrote:
> > Hi Antonio,
> >
> > If I m correct you are asking how to create string or int node so you
> > can assign it the variable with anytype.
> >
> > You can use 'axiom_text_create' to create text element and corresponding 
> > node.
> >
> > axiom_text_t* text_element;
> > axiom_node_t *text_node;
> >
> > text_element = axiom_text_create(env,
> >  NULL /* no parent at start */,
> >  "SomeString" /* your string */,
> >  &text_node);
> >
> > here you can set the text_node to the setter method of the above struct.
> >
> > you may set int, float values after converting them to string (May be
> > using sprintf)
> >
> > Check http://ws.apache.org/axis2/c/docs/om_tutorial.html Code Listing
> > 6 for an example.
> >
> > Thanks
> > Dimuthu
> >
> >
> >
> >
> > On Dec 19, 2007 10:56 PM, Antonio Chiurla <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > > I have to set a value defined as anyType in wsdl and relative xsd:
> > >
> > > 
> > > 
> > > 
> > > 
> > >
> > > I have generated the stub for this wsdl and the struct defined
> > > to pass to the op contains a field of type axiom_node_t*
> > >
> > > struct adb_metadataValue
> > > {
> > > axis2_char_t* property_metadataName;
> > >
> > >
> > > axis2_bool_t is_valid_metadataName;
> > >
> > > axiom_node_t* property_value;
> > >
> > >
> > > axis2_bool_t is_valid_value;
> > >
> > >
> > > };
> > >
> > >
> > > I need to insert a string or int or other types depending of
> > > some conditions verified at runtime.
> > >
> > >
> > > Thanks
> > >
> > > Antonio Chiurla
> > >
> > >
> > > ---
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



Re: How to set a value of type anyType in generated stub

2007-12-19 Thread Dimuthu Gamage
BTW you will face the same problem as the one in
https://issues.apache.org/jira/browse/AXIS2C-843. I will look in to
that ASAP.

On Dec 19, 2007 11:17 PM, Dimuthu Gamage <[EMAIL PROTECTED]> wrote:
> Hi Antonio,
>
> If I m correct you are asking how to create string or int node so you
> can assign it the variable with anytype.
>
> You can use 'axiom_text_create' to create text element and corresponding node.
>
> axiom_text_t* text_element;
> axiom_node_t *text_node;
>
> text_element = axiom_text_create(env,
>  NULL /* no parent at start */,
>  "SomeString" /* your string */,
>  &text_node);
>
> here you can set the text_node to the setter method of the above struct.
>
> you may set int, float values after converting them to string (May be
> using sprintf)
>
> Check http://ws.apache.org/axis2/c/docs/om_tutorial.html Code Listing
> 6 for an example.
>
> Thanks
> Dimuthu
>
>
>
>
> On Dec 19, 2007 10:56 PM, Antonio Chiurla <[EMAIL PROTECTED]> wrote:
> > Hi,
> > I have to set a value defined as anyType in wsdl and relative xsd:
> >
> > 
> > 
> > 
> > 
> >
> > I have generated the stub for this wsdl and the struct defined
> > to pass to the op contains a field of type axiom_node_t*
> >
> > struct adb_metadataValue
> > {
> > axis2_char_t* property_metadataName;
> >
> >
> > axis2_bool_t is_valid_metadataName;
> >
> > axiom_node_t* property_value;
> >
> >
> > axis2_bool_t is_valid_value;
> >
> >
> > };
> >
> >
> > I need to insert a string or int or other types depending of
> > some conditions verified at runtime.
> >
> >
> > Thanks
> >
> > Antonio Chiurla
> >
> >
> > ---
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

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



Re: How to set a value of type anyType in generated stub

2007-12-19 Thread Dimuthu Gamage
Hi Antonio,

If I m correct you are asking how to create string or int node so you
can assign it the variable with anytype.

You can use 'axiom_text_create' to create text element and corresponding node.

axiom_text_t* text_element;
axiom_node_t *text_node;

text_element = axiom_text_create(env,
 NULL /* no parent at start */,
 "SomeString" /* your string */,
 &text_node);

here you can set the text_node to the setter method of the above struct.

you may set int, float values after converting them to string (May be
using sprintf)

Check http://ws.apache.org/axis2/c/docs/om_tutorial.html Code Listing
6 for an example.

Thanks
Dimuthu



On Dec 19, 2007 10:56 PM, Antonio Chiurla <[EMAIL PROTECTED]> wrote:
> Hi,
> I have to set a value defined as anyType in wsdl and relative xsd:
>
> 
> 
> 
> 
>
> I have generated the stub for this wsdl and the struct defined
> to pass to the op contains a field of type axiom_node_t*
>
> struct adb_metadataValue
> {
> axis2_char_t* property_metadataName;
>
>
> axis2_bool_t is_valid_metadataName;
>
> axiom_node_t* property_value;
>
>
> axis2_bool_t is_valid_value;
>
>
> };
>
>
> I need to insert a string or int or other types depending of
> some conditions verified at runtime.
>
>
> Thanks
>
> Antonio Chiurla
>
>
> ---
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



How to set a value of type anyType in generated stub

2007-12-19 Thread Antonio Chiurla
Hi,
I have to set a value defined as anyType in wsdl and relative xsd:






I have generated the stub for this wsdl and the struct defined
to pass to the op contains a field of type axiom_node_t*

struct adb_metadataValue
{
axis2_char_t* property_metadataName;


axis2_bool_t is_valid_metadataName;

axiom_node_t* property_value;


axis2_bool_t is_valid_value;


};


I need to insert a string or int or other types depending of
some conditions verified at runtime.


Thanks

Antonio Chiurla


---

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