| Summary: | [hotbug][model] extensibility element resolution fails | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP Webservices | Reporter: | Marco Hala genannt Kahle <marco.hala.genannt.kahle> | ||||||||||
| Component: | wst.wsdl | Assignee: | Valentin Baciu <valentinbaciu> | ||||||||||
| Status: | CLOSED FIXED | QA Contact: | Valentin Baciu <valentinbaciu> | ||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | for.work.things, hjzhang, hristo.sabev, joerg.dehmel | ||||||||||
| Version: | 2.0 | Flags: | joerg.dehmel:
review?
joerg.dehmel: review? |
||||||||||
| Target Milestone: | 2.0.2 M202 | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows XP | ||||||||||||
| Whiteboard: | |||||||||||||
| Bug Depends on: | |||||||||||||
| Bug Blocks: | 215227 | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Marco Hala genannt Kahle
Please attach a small working JUnit or code snippet showing how you are loading the model. Created attachment 75547 [details]
Test Project
The code snipped from the attached test:
final WSDLFactory factory = WSDLPlugin.INSTANCE.createWSDL4JFactory();
final Definition definition = factory.newWSDLReader().readWSDL(uri);
for (Binding binding : (Collection<Binding>)definition.getBindings().values()) {
for (ExtensibilityElement element : (List<ExtensibilityElement>)binding.getExtensibilityElements()) {
final QName elementType = element.getElementType();
final String localPart = elementType.getLocalPart();
Assert.assertNotNull("local part is null" , localPart);
Assert.assertTrue("local part is empty", localPart.length() > 0);
final String namespaceURI = elementType.getNamespaceURI();
Assert.assertNotNull("namespace URI is null" , namespaceURI);
Assert.assertTrue("namespace URI is empty", namespaceURI.length() > 0);
}
}
The result is an empty namepsace URI.
It seems you've run into a limitation of the WSDL model code: when it tries to find the namespace URI for the prefix "soap" it fails to locate it because the namespace prefix is defined locally and not globally. This leads to the extensibility element being created as an unknown extensibility element instead of the expected type. As a workaround until this is fixed, you can move the soap namespace declaration to the root definition element. Created attachment 75557 [details]
Tentative model patch
For SAP it would be very important to get this bug fixed in the near future. Do you already know what target milestone a fix is planned for? (In reply to comment #6) >...Do you already know what target milestone a fix is planned for? I don't know the exact milestone yet but I'll try to get this fix in for WTP 3.0. Do you have time to give the patch a try? (In reply to comment #7) > (In reply to comment #6) > >...Do you already know what target milestone a fix is planned for? > I don't know the exact milestone yet but I'll try to get this fix in for WTP > 3.0. Do you have time to give the patch a try? Yes, I have. At least I can check if it solves our concrete problem. Because the problem is quite critical for us wouldn't it be possible to provide the fix in maintenance release of WTP 2.0? Hi Joerg, you can mark this bug as a hot bug request. See http://www.eclipse.org/webtools/adopters/hot_bug_process.html for instructions. Were you able to verify that the patch I posted fixes the issue and has no adverse side effects? I will rely on you to help with testing this change. Hi Valentin, I will verify your fix with our use cases. What kind of help do you expect apart from this? Please tell me the easiest way to install the fix in my IDE. Verifying the fix with your test cases is what I'm looking for. I will write a new JUnit test and run the existing suite as well. To use the fix, you can get the org.eclipse.wst.wsdl plug-in source from CVS, apply the patch then run your tests. I am assuming that you know how to develop WTP plug-ins. If that's not the case you can have a look at this tutorial http://www.eclipse.org/webtools/community/tutorials/DevelopingWTP/DevelopingWTP.html to get started. If you'd rather not deal with this at source level I could build a new version of the WSDL model plug-in and attach it here. Hi Valentin, we were able to verify that your fix solves our problem. Furthermore we performed the tests for our functionality that deals with WSDL and didn't face any problem. So from our point of view the fix could be applied. Hi hjzhang, could you please mark this issue as hotbug_request? It would be great if the bugfix could be provided with WTP 2.0.2. We are currently developing some functionality that uses the WTP WSDL api and waiting for WTP 3.0 would cause some trouble with our plannings. Best regards, Jörg Marking as a hotbug request on behalf of SAP. Accepting as a hotbug and targetting for 2.0.2. Created attachment 86796 [details]
Updated model patch
Updated model patch. Handles both prefixed local namespace declaration as well as a local default namespace declaration.
Created attachment 86797 [details]
New JUnit test
Adds a new test document as well as the JUnit code testing for prefixed local namespaces and for a default local namespace.
Joerg, could you please verify the updated model patch? I'd like to make sure it still works for you. I realized that the previous patch was not handling the case where the SOAP namespace was locally declared as the default namespace (see the attached test case). I'll keep testing too and if all is well I hope to have the fix in for this week's 2.0.2 build. Hi Valentin, I have repeated our tests with the new patch and they were successfull as before. The patches are committed and released for WTP 2.0.2 builds > v200801152132 *** Bug 175842 has been marked as a duplicate of this bug. *** Joerg, the fix should be in the latest 2.0.2 build. Could you please install it, make sure the fix is in and if all is OK please mark the bug as verified. I installed the latest 2.0.2 build and our usecases were working as expected. Hi Valentin, can you guide me how to mark the bug as verified? Typically the bug reporter does that: there is a group of radio buttons right under the additional comments text area. Select Mark bug as verified and click commit. closing the bug since it's been verified. |