开发者

XSD file path in WSDL include is wrong

开发者 https://www.devze.com 2023-03-30 19:03 出处:网络
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

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://test开发者_运维技巧server.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 :).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号