Hi Rodrigo,

That did the trick (can confirm it also works with Axis 1.3 and 1.2.1).
Thanks very much.

Richard.

Rodrigo Ruiz wrote:

Hi Richard,

I was dealing with the same problem just a couple of weeks ago. I have found that, at least in Axis 1.4, the code that obtains the new address for the generated WSDL is this:

protected String getEndpointURL(MessageContext msgContext)
  throws AxisFault {

  // First see if a location URL is explicitly set in the MC.
  String locationUrl = msgContext.getStrProp(
                MessageContext.WSDLGEN_SERV_LOC_URL);
  if (locationUrl == null) {
    // If nothing, try what's explicitly set in the ServiceDesc.
    locationUrl = msgContext.getService()
                   .getInitializedServiceDesc(msgContext)
                   .getEndpointURL();
  }
  if (locationUrl == null) {
    // If nothing, use the actual transport URL.
    locationUrl = msgContext.getStrProp(MessageContext.TRANS_URL);
  }
  return locationUrl;
}

From this code, I found that it is possible to specify a different URL for the endpoint, just by putting:

<parameter name="axis.wsdlgen.serv.loc.url"
           value="[Desired URL for any service]"/>

either in the global configuration, or within a service description.

Axis will use the retrieved value by stripping the last path token (that is, until the last slash character), and concatenating it with the service name. This means that, if your proxy is at

proxy.mydomain.com:8080

You can use any of the following URLs (note there is always a "/" character after the servlet name):

http://proxy.mydomain.com:8080/axis/services/
http://proxy.mydomain.com:8080/axis/services/MyService
http://proxy.mydomain.com:8080/axis/services/dummy

And Axis will peek this value and use it to build the Endpoint URLs of the returned WSDLs.


Hope this helps you,
Rodrigo

Richard Gregory wrote:

Hi Collin/Dims,

One thing to be aware of with #1 is that if Axis inserts a server name rather than IP into the wsdl, clients may not be able to resolve the address. We have this problem as we have our services deployed on a cluster of 3 machines and want clients to be able to a send a request to a single address like http://mips.gsf.de/ws/MyWebApp/MyService and have the request answered by one of the 3 based on current server load/availability. The problem we found is that Axis inserts an address into the wsdl like http://MachineName:8080/MyWebApp/MyService which is fine for clients within our organisation which can resolve the MachineName to an IP address, but not for anyone outside who can't resolve our internal machine names. It also rather nagates having the services deployed on a cluster. We got around it by having the wsdl files hosted outside Axis on Apache web server, but I'm still interested in finding a better solution, if one exists. There was a discussion on the list last year and it was suggested I raise a JIRA requesting the ability to be able to tell Axis not to change the address in the wsdl, which I did, but as far as I can tell nothing happened. At least now I understand why axis is doing this.

Cheers,

Richard.

Davanum Srinivas wrote:

#1) Axis will plugin that for custom wsdl, please try it out...give a
dummy url in there and when u look at "?wsdl" in the browser that
should reflect the server ip/name.

#2) Nope :)

-- dims

On 5/7/06, Collin VanDyck <[EMAIL PROTECTED]> wrote:

Hello,

I'm using Axis 1.3 and am running into a bit of a problem with a
deployment issue.

The situation is that I'm developing a set of web services that will use Axis, for a product that is deployed remotely by each of our customers.
  The consequence of this is that I need to be able to support an
arbitrary configuration of [host] and [port], as it is up to each
customer to determine the hostname and port on which our application
will run.

I will be using message-style services, and as such I need to supply a
rather rich XML Schema into the WSDL.  I have decided to write my own
WSDL for each service that incorporates my schema.  I thought about
object [de]serialization, but I think that I'll likely want to manually
parse the messages received.

I have two questions (forgive me, as I am very new to Axis):

1. In server-config.wsdd, I create my service as such:

<service name="SomeService" type="message">
   ...
   <wsdlFile>package/specific/path/to/service.wsdl</wsdlFile>
   ...
</service>

When accessing the deployed WSDL file, it correctly picks up the WSDL
content that I have supplied.  However, the

wsdl:service/wsdl:port/wsdlsoap:address @location

in the WSDL file mandates that I supply a fully qualified location of
the web service.  The issue here is that I don't know where exactly it
will be deployed, as a customer could deploy our software at
http://some.company.com:8274.  It's completely arbitrary.  Is there a
way that I can supply my own XML Schema for a particular service without
going through the process of supplying a complete WSDL file along with
the endpoint address?

2. This is a very newbie-ish question, but will Axis enforce that any
messages received on that endpoint conform to the XML schema I
specified?  That is, will the handler even get invoked if the client
message payload does not validate against the supplied XML schema?


thanks for your time & help :)

Collin









--
Davanum Srinivas : http://wso2.com/blogs/







Reply via email to