Return-Path: Delivered-To: apmail-xml-xmlbeans-dev-archive@www.apache.org Received: (qmail 29240 invoked from network); 20 Mar 2004 01:42:35 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 20 Mar 2004 01:42:35 -0000 Received: (qmail 9881 invoked by uid 500); 20 Mar 2004 01:42:19 -0000 Delivered-To: apmail-xml-xmlbeans-dev-archive@xml.apache.org Received: (qmail 9751 invoked by uid 500); 20 Mar 2004 01:42:18 -0000 Mailing-List: contact xmlbeans-dev-help@xml.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: xmlbeans-dev@xml.apache.org Delivered-To: mailing list xmlbeans-dev@xml.apache.org Received: (qmail 9738 invoked from network); 20 Mar 2004 01:42:18 -0000 Message-ID: <405BA146.1050508@cs.indiana.edu> Date: Fri, 19 Mar 2004 20:41:26 -0500 From: Aleksander Slominski User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: xmlbeans-dev@xml.apache.org Subject: Re: XmlBeans, WSDL, SOAP arrays, ... References: <4B2B4C417991364996F035E1EE39E2E124FB06@uskiex01.amer.bea.com> In-Reply-To: <4B2B4C417991364996F035E1EE39E2E124FB06@uskiex01.amer.bea.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Radu Preotiuc-Pietro wrote: >I see, one thing that would really help here is the accessors, of which there has been some discussion about a month ago. >But what you really want I think could be achieved using a custom SchemaCodePrinter, which is a V2 feature that just got added. Basically, all information about the array and the type of the elements in the array is there, it's just that you'd like the generated type to be different (include the nice array accessors), which is the purpose of the SchemaCodePrinter. No hack required. Can be enabled/disabled from the command line. >This would be something interesting to pursue; if you are interested... (the SchemaCodePrinter is fairly isolated, so there's no opportunity to break sthing) > > hi Radu, this sounds wonderful but right now i have enough headaches trying to figure out how to write WSDL2Java that would use XmlBeans generated Java types if available (i want generate Java interface based on WSDL PortType with message parts mapped to Java classes) and be flexible to allow code generation even if some of types are not from XmlBeans compiled XML Schemas ... then use dynamic proxy and do typical magic to dynamically create stub and invoke in runtime web service using information from WSDL :-) thanks, alek > > >-----Original Message----- >From: Aleksander Slominski [mailto:aslom@cs.indiana.edu] >Sent: Friday, March 19, 2004 3:02 PM >To: xmlbeans-dev@xml.apache.org >Subject: Re: XmlBeans, WSDL, SOAP arrays, ... > > >Radu Preotiuc-Pietro wrote: > > > >>hi alek, >>have you tried compiling GoogleSearch.wsdl _and_ the soap encoding schema file at the same time? >> >> >> >> >great idea however without special understanding of SOAPENC:Array i do >not think that it is possible to get what needed ... > > > >>XMLBeans does not include the soap-encoding Schema "natively" but does include support for the "wsdl:arrayType" attribute. >> >> >> >> >so here is what i got when scomp soap11.schemas.xmlsoap.org.xsd >GoogleSearch.wsdl: > >public interface GoogleSearchResult extends org.apache.xmlbeans.XmlObject >{ >... > /** > * Gets the "resultElements" element > */ > googleSearch.ResultElementArray getResultElements(); >... >} > >unfortunately ResultElementArray is not what i wanted - it extends >SOAPENC:Array but has no accessors to work with arrays elements (as i >think SOAPENC:Array extends xsd:any so XmlBeans has no idea that should >it treat as special kind of typed sequence ...) > >public interface ResultElementArray extends >org.xmlsoap.schemas.soap.encoding.Array >{ > public static final org.apache.xmlbeans.SchemaType type = >(org.apache.xmlbeans.SchemaType)schema.system.sB766CB25D77C35DF7025FF42008F4903.TypeSystemHolder.typeSystem.resolveHandle("resultelementarray8fa7type"); > > public static final class Factory > { > ... > } >} > >if i do modification to GoogleSearch schema (see below for details) to >make array into sequence then the generated code for ResultElementArray >is exactly what i need : > >public interface ResultElementArray extends org.apache.xmlbeans.XmlObject >{ >.... > /** > * Gets array of all "item" elements > */ > java.lang.String[] getItemArray(); > > /** > * Gets ith "item" element > */ > java.lang.String getItemArray(int i); > > /** > * Gets (as xml) array of all "item" elements > */ > org.apache.xmlbeans.XmlString[] xgetItemArray(); > > /** > * Gets (as xml) ith "item" element > */ > org.apache.xmlbeans.XmlString xgetItemArray(int i); > > /** > * Returns number of "item" element > */ > int sizeOfItemArray(); >// ... other nice accessors ... >} > > > >>There is no way in Schema to type an element without giving it a name, AFAIK. >> >> >> >> >:( > >so i wonder if this could be hacked to add support for those still >existing clients that uses old SOAP 1.1 array encoding? or how much work >would it take? > >thanks, > >alek > >ps. below is modified GoogleSearch schema to use sequences instead of >arrays that compiles fine: > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:typens="urn:GoogleSearch" > targetNamespace="urn:GoogleSearch"> > > > > type="xsd:boolean"/> > type="xsd:string"/> > > type="xsd:boolean"/> > type="typens:ResultElementArray"/> > type="xsd:string"/> > > > type="xsd:string"/> > type="typens:DirectoryCategoryArray"/> > type="xsd:double"/> > > > > > > > > > > > > > type="typens:DirectoryCategory"/> > > > > > > > > > maxOccurs='unbounded' /> > > > > > > minOccurs='0' maxOccurs='unbounded' /> > > > > > > > > > > > > > > -- The best way to predict the future is to invent it - Alan Kay - --------------------------------------------------------------------- To unsubscribe, e-mail: xmlbeans-dev-unsubscribe@xml.apache.org For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/