Bugs item #1041622, was opened at 2004-10-06 10:32 Message generated for change (Comment added) made by starksm You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1041622&group_id=22866
Category: None Group: v4.0 >Status: Closed Resolution: Fixed Priority: 5 Submitted By: John Mazz (mazzgolf) Assigned to: Anil Saldhana (osdchicago) Summary: invalid schemaLocation generated for imported schema Initial Comment: Somewhat related to 1041495 - see that issue for the hello.war attachment - the same war used to replicate the problem in that issue is the same war that can be used to replicate the problem for this issue. Same platforms as well were used to replicate. JBoss performs the cool feature of auto-modifying a web service's WSDLs (including its imported/included WSDLs and schemas). However, in one instance that modification produces a URL that does not point to the resource - I get a HTTP 500 instead. Deploy the hello.war (rather than duplicate attachments, see issue 1041495 for the attachment there). This assumes issue 1041495 has been corrected or worked around (I worked around it by fixing issue 1041495 inside a JPDA session and continuing). Once the web service is deployed, look at the hello service's WSDL. You will see an import of another WSDL (this is correct): <wsdl:import location="/hello/hello/? wsdl&resource=../spec/wsrf/WS-ResourceProperties- 1_1.wsdl" ... If you point your browser to that location, you can see that WS-ResourceProperties-1_1.wsdl file. Looking at that WSDL, you will notice that it, itself, imports another file - this time a .xsd schema inside its wsdl:types/wsd:schema element: <wsdl:import namespace="..." schemaLocation="/hello/hello? wsdl&resource=../../wsa/WS-Addressing-2003_03.xsd"> That schemaLocation is incorrect - if you point your browser to that URL, you will get a HTTP 500 and the JBoss logs tells me "cannot obtain wsdl resource from: WEB-INF/wsdl/wsa/WS-Addressing-2003_03.xsd". Notice the ".." appears twice - I _think_ that is incorrect. I think it only needs to go up to the immediate parent directory only - it should not have gone up twice to its grandparent directory. This wsa directory is located as a peer directory to wsmf (under the spec parent - just like the WS-ResouceProperties- 1_1.wsdl is under wsrf which is under spec). I think it should be: schemaLocation="/hello/hello?wsdl&resource=../wsa/WS- Addressing-2003_03.xsd" However, when I put that URL in my browser, I still did not get the .xsd served up - I again got a 500. Funny thing is that the JBoss error log says it was still looking for "WEB-INF/wsdl/wsa/WS-Addressing-2003_03.xsd" - the same relative path it told me when I used the ../.. form. Using just ../ to go up one level instead of two didn't change the relative path JBoss was looking for. I did not have a chance to debug this to find out how to fix this - I just noticed that I was unable to get to that .xsd file from my browser (so, therefore, I assume any client of this web service will not be able to successfully parse its WSDL due to the inability to have the server serve up this schema). ---------------------------------------------------------------------- Comment By: Scott M Stark (starksm) Date: 2004-12-29 12:51 Message: Logged In: YES user_id=175228 All issues have been moved to http://jira.jboss.com. Existing issues have been moved. New issues will be closed with this canned reponse. ---------------------------------------------------------------------- Comment By: Anil Saldhana (osdchicago) Date: 2004-11-16 12:38 Message: Logged In: YES user_id=768753 John, thanks for the directions. I have fixed this issue in the 4.0 branch. The fix is in src/main/org/jboss/webservice/server/InvokerProvider.java From: String newResourcePath = orgLocation; if (resourcePath != null && resourcePath.indexOf("/") > 0 ) newResourcePath = resourcePath.substring(0,resourcePath.indexOf("/") + 1) + orgLocation; String newLocation = requestURI + "?wsdl&resource=" + newResourcePath; To: String newResourcePath = orgLocation; //Bug Fix: [ 1041622 ] invalid schemaLocation generated for imported schema //Added the new check && !orgLocation.startsWith("../") if (resourcePath != null && resourcePath.indexOf("/") > 0 && !orgLocation.startsWith("../") ) newResourcePath = resourcePath.substring(0, resourcePath.indexOf("/") + 1) + orgLocation; String newLocation = requestURI + "?wsdl&resource=" + newResourcePath; ---------------------------------------------------------------------- Comment By: John Mazz (mazzgolf) Date: 2004-11-16 07:39 Message: Logged In: YES user_id=1134120 Go to the web service's WSDL (http://localhost:8080/hello/hello?wsdl). From there, look at the imports - you'll see the import for WS-ResouceProperties- 1_1.wsdl). Bring your browser to that location (the import location will tell you what URL to go to - just add the http://localhost:8080 blah blah - this URL works and you should see that imported WSDL come up) and notice that WS- ResourcePropeties-1_1.wsdl also has an import - the WS- Addressing one. Try to bring your browser to that import location (again, obviously you need to add the http://localhost blah blah prefix stuff) - that's the one where I get the 500. So, in short, the main web service WSDL is fine; the first import is fine - but its that second import (the import from the import) that is not working. ---------------------------------------------------------------------- Comment By: Anil Saldhana (osdchicago) Date: 2004-11-15 16:34 Message: Logged In: YES user_id=768753 I made a small fix for 1041495. That problem goes away. For this case, I cannot recreate whatever John is mentioning. I placed the hello.war in default./deploy directory. The webservice gets deployed in http://localhost:8080/hello/hello Now how do I check the wsdl that John is talking about. Can you give me the exact url from where to start in the browser? ---------------------------------------------------------------------- Comment By: John Mazz (mazzgolf) Date: 2004-10-06 10:42 Message: Logged In: YES user_id=1134120 This URL is one that JBoss likes - if I use this URL in my browser, I get that addressing schema .xsd file served up successfully to the browser: /hello/hello?wsdl&resource=../spec/wsa/WS-Addressing- 2003_03.xsd That's a URL that could have been generated in the imported WS-ResourceProperties-1_1.wsdl as mentioned in my first post. I don't know what "../.." is relative to so I don't know where JBoss went wrong in building that schemaLocation attribute. Hopefully, the info I have provided is enough info to fix this. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1041622&group_id=22866 ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ JBoss-Development mailing list JBoss-Development@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-development