Hmmm. The serialization code that I pasted in below was emitted for a web 
service that specifies elementFormDefault="qualified", yet as you can see, the 
generated JS code makes no provision for prefixing the element name:

>>     xml = xml + '<';
>>
>>     xml = xml + elementName;
>>
>>     xml = xml + ' ';


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Benson Margulies
Sent: Monday, August 25, 2008 12:40 PM
To: Merritt, Norris; CXF Users
Subject: Re: wsdl2js source, serialization strategy, etc.

Here's the package-info for the 'fortest' package in the Javascript tests ...

@javax.xml.bind.annotation.XmlSchema(xmlns = {
                                     @javax.xml.bind.annotation.XmlNs(
                                       namespaceURI =
"uri:org.apache.cxf.javascript.testns3",
                                       prefix = "Plan3")
                                     }
                                    ,
                                     elementFormDefault =
javax.xml.bind.annotation.XmlNsForm.QUALIFIED
                                     )
package org.apache.cxf.javascript.fortest;

So, one would think that we're doing some qualified elephants. I'll
continue to dig.

On Mon, Aug 25, 2008 at 12:48 PM, Benson Margulies
<[EMAIL PROTECTED]> wrote:
> There are unit tests for a lot of cases here, and I'm sure I've seen
> XML prefixes. I don't pretend to have the code generator memorized, so
> my approach in a case like this is to see if we've got the right test
> case, if not add it, and then watch for the fireworks when I run it.
> You are welcome to beat me to a check through the test cases. I don't
> have a strong prediction as to whether the code is right and you just
> haven't see why, or whether the code is wrong. I'll try to get into
> this tonight.
>
> On Mon, Aug 25, 2008 at 12:43 PM, Merritt, Norris <[EMAIL PROTECTED]> wrote:
>> Thanks Benson, I located the source, I was momentarily confused because the 
>> source trees in the source distribution do not follow the package names as 
>> closely as I expected. I finally found the source under "frontend".
>>
>> I wanted to look at the source to see about making some enhancements because 
>> I noticed that the serialization strategy seems to ignore attributes defined 
>> in the XML schema, and also seems to ignore elementFormDefault, i.e. there 
>> seems to be no provision for qualifying element names with prefixes during 
>> serialization.
>>
>> All of the serialization routines seem to take the following general form:
>>
>>    if (elementName != null) {
>>
>>     xml = xml + '<';
>>
>>     xml = xml + elementName;
>>
>>     xml = xml + ' ';
>>
>>     xml = xml + 'xmlns:jns0=\'http://xyz.com\';
>>
>>     if (extraNamespaces) {
>>
>>      xml = xml + ' ' + extraNamespaces;
>>
>>     }
>>
>>     xml = xml + '>';
>>
>>    }
>>
>> I don't see how attributes defined on the complex type for which 
>> "elementName" is being emitted are ever emitted, or how the serialized XML 
>> would survive validation if elementFormDefault="qualified" was specified in 
>> the XML schema.  Am I missing something?
>>
>> Thanks,
>> Norris
>>
>> -----Original Message-----
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Benson 
>> Margulies
>> Sent: Saturday, August 23, 2008 2:23 PM
>> To: Merritt, Norris; CXF Users
>> Subject: wsdl2js
>>
>> Norris,
>>
>> wsdl2js was subsumed into CXF. Most of the code is inside
>> rt/javascript, but the command-line interfaces are in the tools area.
>> There is documentation at
>> http://cwiki.apache.org/CXF20DOC/javascript-clients.html.
>>
>> --benson
>>
>

Reply via email to