axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Williams <>
Subject Re: [Axis2-0.94] WSDL2Java generates bad code for <choice> complex types
Date Tue, 24 Jan 2006 10:32:48 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
Thanks Ajith.&nbsp; I should have read the documentation more thoroughly,
including the caveats at the bottom!<br>
Performance is one of my objectives.&nbsp; I want to use the direct access
to the pull parser that axis2/adb provides to efficiently process
potentially very large incoming documents passed as parameters to the
SOAP messages.&nbsp; Specifically, I want to grab the characters events and
stream them into a reusable nio CharBuffer, rather than having them
built into a DOM with freshly consed strings.<br>
Does axis2 with XMLBeans also provide the capability to directly access
StAX to custom-parse incoming message parameters?<br>
The main reason for the &lt;choice&gt; options is that I need the
service to be accessible from a .Net client, and have read various
places (including on this mailing list) that SOAP faults are best
avoided for interop, in favor of passing exceptions back within the
response messages.&nbsp; One approach is to design the response messages as
&lt;choice&gt;'s that are the real response or an exception.&nbsp; This is
convenient, but obviously not the only approach.&nbsp; I could use a
different representation that doesn't require the &lt;choice&gt; if
that is the only way to get direct access to StAX.<br>
I'd appreciate you advice.<br>
 style="font-size: smaller; font-style: italic; margin-bottom: -2.4em;"><br>
<span>Ajith Ranabahu <a class="moz-txt-link-rfc2396E" href="">&lt;;</a></span>
wrote on <span>01/23/2006
11:29:12 PM</span>:<br>
 type="cite">Hi Chuck,<br>
The choice element is not handled in the ADB schema compiler yet (at
least we are not sure what is the best way to deal with it). Right now
we do not throw any exceptions but silently skip that (that is why the
empty class)<br>
Please use XMLBeans if you need the support for choice for&nbsp; now.<br>
  <div><span class="gmail_quote">On 1/24/06, <b
 class="gmail_sendername">Chuck Williams</b> &lt;<a
 href=""></a>&gt; wrote:</span>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
have a complexType that contains a &lt;choice&gt; of two alternative<br>
elements, like this:<br>
&lt;xsd:complexType name="AorB"&gt;<br>
name="A" type="xsd:string"/&gt;
name="B" type="xsd:string"/&gt;<br>
and a reponse message that contains a value of this type:<br>
&lt;message name="respmessage"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;part name="resp" type="asxsd:AorB"/&gt;<br>
and a portType with an operation that returns the response message:<br>
&lt;portType name="FooPortType"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;operation name="Bar"&gt;<br>
WSDL2Java generates a class&nbsp;&nbsp;AorB and requires it as content of the
respmessage to be returned from the Bar() method in the generated<br>
FooPortTypeSkeleton.&nbsp;&nbsp;However, AorB has no setters or getters, so there<br>
is no way to give it the A or B element to return.&nbsp;&nbsp;Also, A and B do not<br>
extend AorB so there is no way to pass either of them directly.<br>
How is this supposed to work?<br>
Thanks for any help,<br>
  <br clear="all">
-- <br>
Ajith Ranabahu

View raw message