Open main menu

CDOT Wiki β

Changes

User:Jatinder.singh

1,883 bytes added, 14:17, 29 January 2009
Description
:If there were any references to the prefix in the WSDL, they will not have been changed. In the [https://bugs.eclipse.org/bugs/attachment.cgi?id=78305 '''attached WSDL'''], the prefix was changed from "pos" to "posCHANGED" only in the namespace definitions section.
 
----
 
==== Comment from [mailto:wuamy@ca.ibm.com Amy Wu] ====
 
: '''The gorey details''':
 
:In W11EditNamespacesCommand#execute, the prefix is updated by removing the old namespace attribute and then adding the new one.
 
:Removing the old attribute will eventually trigger a reconcile on the definition.
 
:For Port, Binding, Message, WSDLElement#reconcileReferences() looks something like this:
 
:''QName messageQName = createQName(definition,element.getAttribute(WSDLConstants.MESSAGE_ATTRIBUTE), element);''
:''Message newMessage = messageQName != null ? (Message)definition.getMessage(messageQName) : null;''
:''if (newMessage != getEMessage())''
:''{''
:'' setEMessage(newMessage);''
:''}''
 
:The problem here is that ''messageQName'' will be null. This is because when trying to create the ''QName'' for the current referenced message, it will return null. It is null because the prefix/namespace attribute has already been deleted, so when it tries to create a new ''QName'' by looking up the prefix, it will find that there is none. So ''QName=null'' which means ''newMessage'' is ''null''. Which means ''newMessage != message'' currently referenced. Which means it will delete the message currently referenced.
 
:So that's how the references are lost.
 
:So it looks like a fix needs to be made somewhere around here to not lose the existing references.
 
: Once this is fixed, the next step to update the references is actually not that bad according to what is being done XSD's ''UpdateNamespaceInformationCommand''. What XSD does is it calls ''schema.updateElement()'' and that will update all the references magically. I'm assuming it does some magic with resolving the prefix/namespaces. The same type of call would need to be made in ''W11EditNamespacesCommand'' for the definition object. (See ''UpdateNamespaceInformationCommand#updateElement()'' for more details).
== Labs ==