axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Susantha Kumara" <>
Subject <any> type support
Date Fri, 27 Feb 2004 06:00:25 GMT
Hi all,

I am doing the design on how to support <any> type. I have got some problems
and need your ideas to solve following problem.

schema section

 	<xsd:complexType name="ExtensibilityType">
          <xsd:any namespace="##any"/>

      <xsd:element name="query">
            <xsd:element name="queryExpression"

      <xsd:element name="queryResponse">
            <xsd:element name="queryResult" type="tns:ExtensibilityType"/>

messages section

  <message name="queryIn">
    <part element="tns:query" name="parameters" />

  <message name="queryOut">
    <part element="tns:queryResponse" name="parameters" />

port types section

  <portType name="ExtensibilityQueryPortType">
    <operation name="query">
      <input message="tns:queryIn" />
      <output message="tns:queryOut" />

WSDL2Ws tool already generates functions to manipulate the complexType

Provided a type registry and DLLs that contain the types, its possible for
AxisEngine to find the type in the SOAP message and deserialize/serialize

But one problem that I have is how do we (code generator) create the stubs
and skeletons ?
According to the above WSDL, the C method in the skeleton can be,

void* query(void* object);

But if we do like this how does the method recognizes (inside the method)
what the type is in the "object" ?

I ran WSDL2Java and found what Axis Java does, the method it generates is,

    public ExtensibilityQuery_pkg.ExtensibilityType
query(ExtensibilityQuery_pkg.ExtensibilityType queryExpression);

where the types are like,

public class ExtensibilityType  implements {
    private org.apache.axis.message.MessageElement [] _any;

    public ExtensibilityType() {

    public org.apache.axis.message.MessageElement [] get_any() {
        return _any;

    public void set_any(org.apache.axis.message.MessageElement [] _any) {
        this._any = _any;

Instead of void* I suggest passing some struct like following,

struct AnyType{
  void* _object;
  char* _typename;
  char* _namespace;
  void* _functions; /* this will contain deserializer/serializer function
etc that are used basically by the Axis engine to manipulate this kind of
type (functions that are already generated by WSDL2Ws tool). May be this is
not needed to provide to the skeletons and stubs*/

This way the skeleton implementator can check the _typename and _namespace
and then cast _object into its known type and use it. Ex:

AnyType* query(AnyType* object)
	if (strcmp(object->_typename, "myType")==0)
		MyType* mytype = (MyType*)object->_object;



View raw message