I am working on JBoss-4.2.2 server. I have a WSDL given by external system and I want to create java artifacts using wsconsume. When I try the command "wsconsume -k Prov_OMITStatusUpdates.wsdl", I get the following error :
[ERROR] Failed to read the WSDL document: file:/C:/TEMP/Test/Gateway%20OMITs/SID0003041/SID0003041,264/Prov_OMITStatusUpdates.xsd, beca
use 1) could not find the document; /2) the document could not be read; 3) the root element of the document is not <wsdl:definitions>.
The problem here is that the WSDL has the schemas as :
<types> <schema xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://xmlns.oracle.com/Prov_OMITStatusUpdates" schemaLocation="SID0003041/SID0003041,264/Prov_OMITStatusUpdates.xsd"/> </schema> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:import namespace="http://www.provision.com/ns/OMITUpdate" schemaLocation="SID0003041/SID0003041,265/OMITUpdates.xsd"/> </xsd:schema> </types>
The part "264" in the schema location "SID0003041,264" is a counter which will be updated everytime the WSDL is refreshed. Hence, the schema location changes everytime the WSDL is fetched. It was informed (by the external system developers) that this change in the schema location was required by their system.
When I tried creating a webservice client using NetBeans 6, I found that it was fetching the xsd into the location : ../SID0003041/SID0003041_264/Prov_OMITStatusUpdates.xsd (It converts the comma to an underscore !!) Hence, when it later tries to access the wsdl, it wont find the folder name with SID0003041,264. Hence, the "no document found" error.
In Netbeans, I have edited the imported wsdl and replaced the comma with an underscore. Now this code is deployed and it works for a while. However, JBoss refreshes the WSDL on its own and it starts failing again.
I am not sure as to how to handle this situation. When wsconsume itself fails, its difficult to think how an IDE alone would fix the issue.
Please suggest any alternatives.