On Fri, 15 Feb 2002 04:16:36 -0600, "David Ralf" <[EMAIL PROTECTED]> wrote:
> > In the SOAPHelper the URL instance for calling the SOAP service > is created as such: > > this.url = new URL(context, url); > > where context is the requesting url. > > I'm having a problem with this running in the CLI environment, the > value of context here turns out to be: > > "http://@name@ @version@:-1soap/joke" > > which is badly formed and thus fails. > > I'm not sure if this is a bug in the SOAPHelper, or the > CommandLineRequest which is responsible for putting part of this > badly formed URL together when it's getServerName() is called. > > (getServerName() returns "Constants.COMPLETE_NAME" ) > > Anyways, FYI, I've changed: > > this.url = new URL(context, url); > > to: > > this.url = new URL(url); > > > and I have no problem in CLI or Servlet environments. > > I don't know why we need to form the SOAP url relative to > requesting context. The reason is that you can refer to a SOAP server which is mapped on the same server as the client. E.g. the client is at /client/soap and the server is at /server/soap. I believe the correct approach would be to detect the fact Cocoon is not running in the servlet environment, thus 'context' makes no sense. In this case the URL is created as you suggest: if (running in servlet context) this.url = new URL(context, url); else this.url = new URL(url); Does this make any sense? Greetings, Ovidiu --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]