Do you have an import in your xsd with a path and not referenced to the root? I have had a simmilar problem with imports in my xsd that had ../somedir/bla.xsd in stead of ../bla.xsd. If this is the case you could try to put all your xsd into the root of your .esb file and change de references to the root aswell.
Thanks for the reply. The schema does not have any imports, but I see how your idea applies to import paths in general.
The WSDL that is being read by the application is on a remote machine deployed by another application. I can't alter the imports. Also the schema files are not in the ESB file since they are part of the remote web service I'm trying to invoke.
I expect the proper behavior for executing the import would be to use the same protocol that imported WSDL (http) and it should be relative to the path used to import the WSDL. Instead the import is using a different protocol (file) and is relative to the default server deploy directory. This appears to be the way the SOAPClient works.
Just a little more information....
I browsed the source code to see if there was a configuration option I was missing or misusing, and found what I think the problem is.
The loadDefinitions method of SOAPProxyWsdlLoader calls the newLoader method, which in turn creates a HttpSOAPProxyWsdlLoader (a private inner class) class. The HttpSOAPProxyWsdlLoader copies the WSDL to a local temporary file, and creates the URL to the temporary file. The URL created for the WSDL now references a local file.
So..... I believe the relative imports then try to resolve their URLs relative to the temporary file instead of the real URL of the WSDL. Since the imported schemas used by the WSDL are not copied locally, when the imports are executed they cannot be resolved relative to local temporary file.
Can you please give me a self-contained example that I can use to create a JIRA and debug this with? If you can do it relatively quickly, that would be great. There is the *chance* we might want to get this fixed in our Cummulative Patch branch, if you hurry.
PS: I wrote the SOAPProxy action.
Thanks for the response! I'm putting together a simple example right now.
I'm still working on it. JBoss WS is rewriting the import statement in my WSDL file when deploying the web service. The rewrite changes the import from from relative to absolute and I need a relative path for my import problem.
Looks like I need to use something other than JBoss WS, like Axis, otherwise I can't make a WSDL with relative imports.
A snipet from my web service class...
public class BarService
The import from my BarService.wsdl
<import location="../catalog/wsdl/checkAge.wsdl" namespace="http://checkAge"/>
The rewritten import statement when I hit the deployed service (http://localhost:8080/BarService/BarService?wsdl)
<import location='http://localhost:8080/BarService/BarService?wsdl&resource=../catalog/wsdl/checkAge.wsdl' namespace='http://checkAge'></import>
I'll keep working on it and post when I found a way to put relative imports into a WSDL without the rewrites happening.