axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dimuthu Gamage <dimut...@gmail.com>
Subject Re: Using Complex Types with Mixed Content
Date Wed, 09 Feb 2011 05:20:06 GMT
Hi,
AFAIK mixed contents are not supported by the WSDL2C tool. A solution
I can suggest, is generate the code without adb support (with option
-d none)  and construct the xml using axiom.

To create text in the same level as xml elements, use axiom_text[1]
(for texts) and axiom_element (for elements) APIs.

Thanks
Dimuthu

[1] http://www.google.com/codesearch/p?hl=en#Wq2ZA96Sokk/axiom/include/axiom_text.h&q=axiom_text.h&sa=N&cd=1&ct=rc
[2] http://axis.apache.org/axis2/c/core/docs/om_tutorial.html

On Tue, Feb 8, 2011 at 9:38 PM, Alex Marin <iskander9999@hotmail.com> wrote:
> Hello all,
>
> I am working on implementing a web service specified by a WSDL and
> associated XSD file. One of the types in the XSD is mixed:
>
>       <xs:complexType name="PostContent" mixed="true">
>               <xs:annotation>
>                       <xs:documentation>Type the defines the content
of a
> post.</xs:documentation>
>               </xs:annotation>
>               <xs:choice minOccurs="0" maxOccurs="unbounded">
>                       <xs:annotation>
>                               <xs:documentation>This is a mixed
type. It can
> contain one or more of each of quoted content, links to other material, and
> a signature block.</xs:documentation>
>                       </xs:annotation>
>                       <xs:element name="Link" type="xs:anyURI">
>                               <xs:annotation>
>                                       <xs:documentation>A link
to material
> external to the post.</xs:documentation>
>                               </xs:annotation>
>                       </xs:element>
>               </xs:choice>
>       </xs:complexType>
>
> (for simplicity, I included only one of the options supported by the
> xs:choice). An example of this data is as follows:
>
>                       <scild:Content>
>                               Emmanuelm, aren't you the person who
> <scild:Link>http://en.wikipedia.org/w/index.php?title=Lymphoma&amp;diff=18272307&amp;oldid=15964246</scild:Link>
> added those other categories on 6 July 2005? --
>                       </scild:Content>
>
> I used WSDL2C to generate stubs for all the types in the XSD. However, the
> stubs generated for PostContent don't seem to include any way of accessing
> the text in the mixed type, just the elements of the choice:
>
>       struct adb_PostContent
>       {
>           axutil_array_list_t* property_PostContentChoice;
>
>
>               axis2_bool_t is_valid_PostContentChoice;
>
>
>
>       };
>
> Any idea whether this is an error in the code generator, or whether there is
> an underlying problem with supporting mixed content? How is mixed content
> represented in the Axiom types? Looking at the definition of the
> axiom_element struct (in om_element.c) I see only one member storing text,
>
> axis2_char_t *text_value;
>
> In the case of mixed nodes, is the mixed content stored in a bunch of
> children, which can be either text elements or nodes? Or some other method I
> am not seeing?
>
> Any help you may provide will be greatly appreciated.
>
> Thank you,
>
>
> Alex Marin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: c-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: c-user-help@axis.apache.org
>
>

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


Mime
View raw message