Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 41396 invoked from network); 9 Sep 2006 00:23:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Sep 2006 00:23:04 -0000 Received: (qmail 79673 invoked by uid 500); 9 Sep 2006 00:23:01 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 79514 invoked by uid 500); 9 Sep 2006 00:23:00 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 79503 invoked by uid 99); 9 Sep 2006 00:23:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2006 17:23:00 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2006 17:22:59 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3F82F7142F4 for ; Sat, 9 Sep 2006 00:19:24 +0000 (GMT) Message-ID: <30922371.1157761164257.JavaMail.jira@brutus> Date: Fri, 8 Sep 2006 17:19:24 -0700 (PDT) From: "Derek Foster (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Created: (AXIS2-1129) Doubled wrapper elements around XMLBeans-generated XML MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Doubled wrapper elements around XMLBeans-generated XML ------------------------------------------------------ Key: AXIS2-1129 URL: http://issues.apache.org/jira/browse/AXIS2-1129 Project: Apache Axis 2.0 (Axis2) Issue Type: Bug Components: client-api, core, databinding, om, wsdl Affects Versions: 1.0 Reporter: Derek Foster Priority: Critical I recently noticed a big problem in how Axis2 generates XML for XMLBeans objects. It appears to be creating the wrapper element around an XMLBean twice, thus generating erroneous XML for a SOAP message. This appears to be a big problem that would affect a lot of web services, and is making it impossible for my company to use Axis2 to talk to our server. This error was found in the latest nightly build (September 8), but has apparently been around for some time. I have a particular WSDL, as follows: F Port Type F Soap Binding F Web Service My WSDL references the following XML schema: After running WSDL2Java to generate the appropriate classes, I am using the following code to generate and transmit a client message to my SOAP server: protected ReturnDocument executeTest ( final String targetEndpoint, final CLoginDocument login, final CPasswordDocument password ) throws Exception { final FServiceStub service = new FServiceStub( null, targetEndpoint ); final Options options = service._getServiceClient().getOptions(); options.setProperty( org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE ); service._getServiceClient().setOptions( options ); final FullDocument full = Full.Factory.newInstance(); full.setFull( getSituation() ); return service.acceptFEvent( full, login, password ); } private Full getSituation () throws XmlException { return Full.Factory.parse( " \n" + " \n" + ... and so forth: see output for the rest of this string ... " \n" + " \n" ); } When I execute the above code, I get the following message sent to my server: POST /axis2/services/FService HTTP/1.1 SOAPAction: acceptFEventAction User-Agent: Axis2 Host: 127.0.0.1 Content-Length: 8785 Content-Type: text/xml; charset=UTF-8 admin QSenderOrganizationID QSenderCenterID 1 435 20040625 -0400 20040625 -0400 1234 1 4 accident
Note that there is a doubled 'full' element in the output (one inside the other). There should be only one level of 'full', but there are two, one inside the other. This is very wrong, and is unsurprisingly rejected by my server. Calling toString() on the results of getSituation() returns the string that was passed into the Factory.parse() method as I would expect. Calling toString() on the FullDocument instance results in two levels of 'full', not one as it should. It occurred to me that maybe I should not be including a declaration for 'full' in the string passed to Factory.parse() (note that there is no documentation as to what should be passed into Factory.parse(),making it difficult to interpret), so I tried omitting the outer 'full' tag and its close tag, and just included the elements that it contains. However, when doing this, I got errors from the parse method complaining that there was more than one element present in the string being parsed. So although it seems to be possible to generate correct XML via this method as long as there is only a single child element of the 'full' element, this is not an acceptable solution in my case. I tried changing the declaration of the 'full' element so that it had minOccurs=0 maxOccurs="unbounded". This caused WSDL2Java to declare the type of it as an array rather than a single instance. However, this merely meant that each element in the array was surrounded by two 'full' tags, rather than one. This seems to me to be a fairly blatant error which would affect almost all use of XMLBeans binding. I would like to have this considered a blocker for Axis 1.1. Derek -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org