axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Williams <ch...@manawiz.com>
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">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks Ajith.&nbsp; I should have read the documentation more thoroughly,
including the caveats at the bottom!<br>
<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>
<br>
Does axis2 with XMLBeans also provide the capability to directly access
StAX to custom-parse incoming message parameters?<br>
<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>
<br>
I'd appreciate you advice.<br>
<br>
Thanks,<br>
<br>
Chuck<br>
<br>
<span>
<div
 style="font-size: smaller; font-style: italic; margin-bottom: -2.4em;"><br>
<span>Ajith Ranabahu <a class="moz-txt-link-rfc2396E" href="mailto:ajith.ranabahu@gmail.com">&lt;ajith.ranabahu@gmail.com&gt;</a></span>
wrote on <span>01/23/2006
11:29:12 PM</span>:<br>
</div>
</span><br>
<blockquote
 cite="midf43ea5790601240129jd23a6f1wf4cb13ebd5285dcb@mail.gmail.com"
 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>
  <br>
  <div><span class="gmail_quote">On 1/24/06, <b
 class="gmail_sendername">Chuck Williams</b> &lt;<a
 href="mailto:chuck@manawiz.com">chuck@manawiz.com</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:
1ex;">I
have a complexType that contains a &lt;choice&gt; of two alternative<br>
elements, like this:<br>
    <br>
&lt;xsd:complexType name="AorB"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsd:choice&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsd:element
name="A" type="xsd:string"/&gt;
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsd:element
name="B" type="xsd:string"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsd:choice&gt;<br>
&lt;/xsd:complexType&gt;<br>
    <br>
and a reponse message that contains a value of this type:<br>
    <br>
&lt;message name="respmessage"&gt;
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;part name="resp" type="asxsd:AorB"/&gt;<br>
&lt;/message&gt;<br>
    <br>
and a portType with an operation that returns the response message:<br>
    <br>
&lt;portType name="FooPortType"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;operation name="Bar"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input
.../&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;output
message="as:respmessage"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/operation&gt;<br>
&lt;/portType&gt;<br>
    <br>
WSDL2Java generates a class&nbsp;&nbsp;AorB and requires it as content of the
    <br>
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>
    <br>
How is this supposed to work?<br>
    <br>
Thanks for any help,<br>
    <br>
Chuck<br>
    <br>
  </blockquote>
  </div>
  <br>
  <br clear="all">
  <br>
-- <br>
Ajith Ranabahu
</blockquote>
</body>
</html>

Mime
View raw message