[ 
https://issues.apache.org/jira/browse/WODEN-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524916
 ] 

John Kaputin commented on WODEN-65:
-----------------------------------

> (1) Ignore the above WSDL file and leave the code as it is. ( in other words, 
> force to use QName )
We can't mandate the use of a namespace (either via a prefix or via a default 
namespace defined in the WSDL). This  would impose a new rule not defined in 
the WSDL 2.0 spec.

> (2) When no element prefix is available use the TargetNsmespace's prefix as 
> the element prefix for such elements. (e.g. SIN into 
> TargetNsmespace'sPrefix:SIN)
Again, this would impose a new rule not defined in the spec.  If  the element 
xs:QName value has no prefix, and if there is no default namespace defined, 
then the element simply has no namespace. We can't force it to use the TNS.

> (3) Write these attribute without considering QName prefix.( e.g. SIN )
We do need to consider the prefix, but if there isn't one then we just print 
the localpart (i.e. not qualified by a prefix)

Note, adding a default namespace declaration to the WSDL 
(xmlns="http://example.org/name";)  will avoid the NPE, but it should not be 
necessary to do this. It should be possible to print out the WSDL as is.

The NPE that occurs with your example WSDL is because in 
writer.printInterfaceMessageReferenceElement, the call to desc.getNamespace is 
returning a null and toString() is being called on the null value.  The code 
fragment below shows a fix:

            QName attrQName=msgRef.getElementName();
            URI ns = des.getNamespace(attrQName.getPrefix());
            String attrName = null;
            if(ns != null) {
                attrName = 
DOMUtils.getQualifiedValue(des.getNamespace(attrQName.getPrefix()).toString(),
                    attrQName.getLocalPart(), des);
            } else {
                attrName = attrQName.getLocalPart();   //just print the 
localpart, without a prefix
            }
            DOMUtils.printAttribute(Constants.ATTR_ELEMENT, attrName, pw);

I'll comment separately on serializing extensions.

> Woden elements must have serialize methods
> ------------------------------------------
>
>                 Key: WODEN-65
>                 URL: https://issues.apache.org/jira/browse/WODEN-65
>             Project: Woden
>          Issue Type: Improvement
>          Components: Parser
>            Reporter: Eran Chinthaka
>            Assignee: Sagara Gunathunga 
>         Attachments: BaseWSDLWriter.java.txt, DOMUtils.java.txt, 
> DOMWSDLFactory.java.txt, DOMWSDLWriter.java.txt, OMWSDLFactory.java.txt, 
> OMWSDLWriter.java.txt, sample1.java, test-prefix.wsdl, test.wsdl, 
> WriterFeatures.java.txt, WSDLFactory.java.txt, WSDLWriter.java.txt
>
>
> When we load a WSDL in to Woden object model, there is no way to serialize 
> the object model in to an output stream. This is very much useful when some 
> one wants to make sure Woden can properly spit out what it has read. 
> And there is a requirement from Axis2 also to make Woden element serializable 
> to cater for ?wsdl2 requests. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to