Skip to main content

Change endpoint address of published WSDL (server side)

4 replies [Last post]
magir
Offline
Joined: 2007-03-14
Points: 0

Due to the network infrastructure, my endpoint has externally a different address as the internal address which is returned by the modified WSDL available from "?wsdl". Most importantly the external URL is SSL secured whereas the Tomcat server only uses plain HTTP.

I know, that I can change the URL on the client side using the MessageContext property, however publishing the correct WSDL and endpoint from the server side is surely the better solution.

I wasn't able to find any code examples on how to prevent metro from changing the endpoint when publishing the WSDL. Any hints?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
easterk
Offline
Joined: 2008-11-11
Points: 0

If you're using Tomcat have you tried configuring the Connector with proxyName, proxyPort, SSLEnabled, scheme, and secure? I'm not sure which combination you'd need but it's possible if set correctly Metro will automatically create the correct endpoint.

Sub-optimal perhaps but you could also deploy a WSDL file vs letting metro generate one that had the proper endpoint.

HTH.

magir
Offline
Joined: 2007-03-14
Points: 0

Thanks for your reply!

We're using an Apache server to rewrite any requests to the Tomcat so I won't be able to create a proper HTTPS service on the Tomcat.

I'm already using a WSDL file which I link as primary WSDL to the service. Metro uses this WSDL file but replaces the endpoint address with the one, he "thinks" is correct. This is exactly what I don't want to happen.

Anyone else any ideas?

easterk
Offline
Joined: 2008-11-11
Points: 0

You don't actually need to create a proper https service on Tomcat. You're just telling it that the URL that's proxying tomcat is secure. Having SSL terminate on a load balancer or other appliance is a pretty common pattern.

I just tested this out. If I define my http (non-secure) connector as:

<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000" proxyName="bogus.foo.com" proxyPort="9091" scheme="https" secure="true"

My endpoint in the WSDL becomes:

<soap:address location="https://bogus.foo.com:9091/IClicker/ClickerService"/>

magir
Offline
Joined: 2007-03-14
Points: 0

This seems to be a valid solution - thanks!

I wonder, whether changing the Tomcat to use a proxy definition has any other effects. And as it seems, the directory cannot be changed and the server has to use the same paths as the external URL.