XSD file path in WSDL include is wrong

I'm more or less a beginner with web services but I've tried googling this with no results.

I have a web service written in Java using the Metro stack that runs fine when I run it on a local JBoss 5.1.0 instance but when I move it to our test server I start getting problems.

The service deploys correctly and I can view the WSDL as usual: https://myserver.myorg/path/service?wsdl

However, wsimport failed to generate client stubs from here and when I took a closer look at the WSDL I saw this:

<xsd:schema>
  <xsd:import namespace="http://mynamespace/" schemaLocation="https://testserver.myorg:443/path/Service?null"/>
</xsd:schema>

Instead of what I would see when I ran it locally, which had the schemaLocation set to http://localhost:8080/path/Service?xsd=1

When I try putting in xsd=1 instead of null manually in a web browser, I get a 404 error.

Does anybody know what might cause this and how to fix it?

Thanks, Raj.


I think the problem is that your XSD is behind an SSL connection, so your wsimport needs to know and trust the server SSL certificate.

For achieving this, you'll need to set up a new Java Keystore file ( .jks file), or reuse an existing one if you already have it, add the server SSL certificate (for this, you can use the keytool provided with the JDK), and declare the Keystore a Trustore using the next JVM parameters on your wsimport invocation:

-Djavax.net.ssl.trustStore=${truststore.location} -Djavax.net.ssl.trustStorePassword=${ssl.password}

The test JBoss server is restarted weekly and following the restart, the XSD file is appearing properly. Sorry for the noise - I should learn to turn it off and on again before posting :).

链接地址: http://www.djcxy.com/p/66656.html

上一篇: 泽西岛和灰熊队的Hello World(来自用户指南)

下一篇: WSDL包含的XSD文件路径是错误的