JaxwsHandler serving content on non-registered URLs under same path

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

JaxwsHandler serving content on non-registered URLs under same path

Gonfi den Tschal
QUESTION: How do I stop Grizzly from serving content on URLs for which there is no handler, but are under the same path?


USERLAND CODE:

full class at http://nopaste.info/05ffefc3fb.html

    public static void main(String[] args) throws IOException {
        HttpServer httpServer = new HttpServer();
        httpServer.addListener(new NetworkListener("jaxws-listener", "localhost", 8090));
        httpServer.getServerConfiguration().addHttpHandler(new JaxwsHandler(new BarService()), "/jaxws/hello");
        httpServer.start();
        System.in.read();
    }

    @WebService
    private static class BarService {
        @WebMethod
        public String hello() {
            return "hello world";
        }
    }


Loading the URL http://localhost:8090/jaxws/hello?wsdl in the browser brings the correct document, see http://nopaste.info/f8ec12f601.html

However, loading any other url under the /jaxws/ path brings a similar document, for example http://localhost:8090/jaxws/helllloooooo?wsdl see http://nopaste.info/d7e6013a1a.html

A difference is at the end:
  1. <soap:address location="http://localhost:8090/jaxws/hello"/>
  1. <soap:address location="http://localhost:8090/jaxws"/>

What are the arguments for this behavior?
And what can I do to get a 404 on all URLs that are not registered?

Software used:
 - grizzly-http-server
 - grizzly-http-server-jaxws
tried versions 2.3.17 (latest) and 2.3.7

Greetings,
Gonfi

Reply | Threaded
Open this post in threaded view
|

Re: JaxwsHandler serving content on non-registered URLs under same path

oleksiys
Administrator
Hi,

can I ask you to create a working project (for ex. on github) so it would be easier to reproduce.

Thank you.

WBR,
Alexey.

On 05.11.14 07:46, Gonfi den Tschal wrote:
QUESTION: How do I stop Grizzly from serving content on URLs for which there is no handler, but are under the same path?


USERLAND CODE:

full class at http://nopaste.info/05ffefc3fb.html

    public static void main(String[] args) throws IOException {
        HttpServer httpServer = new HttpServer();
        httpServer.addListener(new NetworkListener("jaxws-listener", "localhost", 8090));
        httpServer.getServerConfiguration().addHttpHandler(new JaxwsHandler(new BarService()), "/jaxws/hello");
        httpServer.start();
        System.in.read();
    }

    @WebService
    private static class BarService {
        @WebMethod
        public String hello() {
            return "hello world";
        }
    }


Loading the URL http://localhost:8090/jaxws/hello?wsdl in the browser brings the correct document, see http://nopaste.info/f8ec12f601.html

However, loading any other url under the /jaxws/ path brings a similar document, for example http://localhost:8090/jaxws/helllloooooo?wsdl see http://nopaste.info/d7e6013a1a.html

A difference is at the end:
  1. <soap:address location="http://localhost:8090/jaxws/hello"/>
  1. <soap:address location="http://localhost:8090/jaxws"/>

What are the arguments for this behavior?
And what can I do to get a 404 on all URLs that are not registered?

Software used:
 - grizzly-http-server
 - grizzly-http-server-jaxws
tried versions 2.3.17 (latest) and 2.3.7

Greetings,
Gonfi


Reply | Threaded
Open this post in threaded view
|

Re: JaxwsHandler serving content on non-registered URLs under same path

Gonfi den Tschal

3) In the console you will see:
    Publishing soap web service: http://localhost:80/soap/v1/system/ping?wsdl

4) load that url in the browser to see the wsdl

5) change the url, anything under /soap/ will give you a wsdl. This is not desired from my point of view; changing to v2 also brings something.

6) change /soap/ to /soap2/ and you'll get
    Not Found
    Resource identified by path '/soap2/v2/system/ping', does not exist.
    Grizzly 2.3.17

If you need another host name or port number then change it in GrizzlySoapWebServer on top new Host("localhost", 80)

Greetings,
Gonfi


On Thu, Nov 6, 2014 at 6:21 AM, Oleksiy Stashok <[hidden email]> wrote:
Hi,

can I ask you to create a working project (for ex. on github) so it would be easier to reproduce.

Thank you.

WBR,
Alexey.


On 05.11.14 07:46, Gonfi den Tschal wrote:
QUESTION: How do I stop Grizzly from serving content on URLs for which there is no handler, but are under the same path?


USERLAND CODE:

full class at http://nopaste.info/05ffefc3fb.html

    public static void main(String[] args) throws IOException {
        HttpServer httpServer = new HttpServer();
        httpServer.addListener(new NetworkListener("jaxws-listener", "localhost", 8090));
        httpServer.getServerConfiguration().addHttpHandler(new JaxwsHandler(new BarService()), "/jaxws/hello");
        httpServer.start();
        System.in.read();
    }

    @WebService
    private static class BarService {
        @WebMethod
        public String hello() {
            return "hello world";
        }
    }


Loading the URL http://localhost:8090/jaxws/hello?wsdl in the browser brings the correct document, see http://nopaste.info/f8ec12f601.html

However, loading any other url under the /jaxws/ path brings a similar document, for example http://localhost:8090/jaxws/helllloooooo?wsdl see http://nopaste.info/d7e6013a1a.html

A difference is at the end:
  1. <soap:address location="http://localhost:8090/jaxws/hello"/>
  1. <soap:address location="http://localhost:8090/jaxws"/>

What are the arguments for this behavior?
And what can I do to get a 404 on all URLs that are not registered?

Software used:
 - grizzly-http-server
 - grizzly-http-server-jaxws
tried versions 2.3.17 (latest) and 2.3.7

Greetings,
Gonfi



Reply | Threaded
Open this post in threaded view
|

Re: JaxwsHandler serving content on non-registered URLs under same path

oleksiys
Administrator
Hi,

I've made some changes on 2.3.x branch.
Can you pls. change the way you register the JaxwsHandler:

        httpServer.getServerConfiguration().addHttpHandler(jaxwsHandler,
                HttpHandlerRegistration.bulder()
                    .contextPath(path)
                    .urlPattern("")
                    .build());



and try the latest Grizzly 2.3.18-SNAPSHOT.

Thank you.

WBR,
Alexey.

On 06.11.14 05:42, Gonfi den Tschal wrote:

3) In the console you will see:
    Publishing soap web service: http://localhost:80/soap/v1/system/ping?wsdl

4) load that url in the browser to see the wsdl

5) change the url, anything under /soap/ will give you a wsdl. This is not desired from my point of view; changing to v2 also brings something.

6) change /soap/ to /soap2/ and you'll get
    Not Found
    Resource identified by path '/soap2/v2/system/ping', does not exist.
    Grizzly 2.3.17

If you need another host name or port number then change it in GrizzlySoapWebServer on top new Host("localhost", 80)

Greetings,
Gonfi


On Thu, Nov 6, 2014 at 6:21 AM, Oleksiy Stashok <[hidden email]> wrote:
Hi,

can I ask you to create a working project (for ex. on github) so it would be easier to reproduce.

Thank you.

WBR,
Alexey.


On 05.11.14 07:46, Gonfi den Tschal wrote:
QUESTION: How do I stop Grizzly from serving content on URLs for which there is no handler, but are under the same path?


USERLAND CODE:

full class at http://nopaste.info/05ffefc3fb.html

    public static void main(String[] args) throws IOException {
        HttpServer httpServer = new HttpServer();
        httpServer.addListener(new NetworkListener("jaxws-listener", "localhost", 8090));
        httpServer.getServerConfiguration().addHttpHandler(new JaxwsHandler(new BarService()), "/jaxws/hello");
        httpServer.start();
        System.in.read();
    }

    @WebService
    private static class BarService {
        @WebMethod
        public String hello() {
            return "hello world";
        }
    }


Loading the URL http://localhost:8090/jaxws/hello?wsdl in the browser brings the correct document, see http://nopaste.info/f8ec12f601.html

However, loading any other url under the /jaxws/ path brings a similar document, for example http://localhost:8090/jaxws/helllloooooo?wsdl see http://nopaste.info/d7e6013a1a.html

A difference is at the end:
  1. <soap:address location="http://localhost:8090/jaxws/hello"/>
  1. <soap:address location="http://localhost:8090/jaxws"/>

What are the arguments for this behavior?
And what can I do to get a 404 on all URLs that are not registered?

Software used:
 - grizzly-http-server
 - grizzly-http-server-jaxws
tried versions 2.3.17 (latest) and 2.3.7

Greetings,
Gonfi




Reply | Threaded
Open this post in threaded view
|

Re: JaxwsHandler serving content on non-registered URLs under same path

Gonfi den Tschal
Thanks Alexey! Works.
I've tried 2.3.17 and 2.3.18, both work the same, saying "Not Found" when registering in the way you demonstrated.
(I have not tried 2.3.18-SNAPSHOT at all.)

Gonfi


On Tue, Nov 11, 2014 at 2:55 AM, Oleksiy Stashok <[hidden email]> wrote:
Hi,

I've made some changes on 2.3.x branch.
Can you pls. change the way you register the JaxwsHandler:

        httpServer.getServerConfiguration().addHttpHandler(jaxwsHandler,
                HttpHandlerRegistration.bulder()
                    .contextPath(path)
                    .urlPattern("")
                    .build());



and try the latest Grizzly 2.3.18-SNAPSHOT.

Thank you.

WBR,
Alexey.


On 06.11.14 05:42, Gonfi den Tschal wrote:

3) In the console you will see:
    Publishing soap web service: http://localhost:80/soap/v1/system/ping?wsdl

4) load that url in the browser to see the wsdl

5) change the url, anything under /soap/ will give you a wsdl. This is not desired from my point of view; changing to v2 also brings something.

6) change /soap/ to /soap2/ and you'll get
    Not Found
    Resource identified by path '/soap2/v2/system/ping', does not exist.
    Grizzly 2.3.17

If you need another host name or port number then change it in GrizzlySoapWebServer on top new Host("localhost", 80)

Greetings,
Gonfi


On Thu, Nov 6, 2014 at 6:21 AM, Oleksiy Stashok <[hidden email]> wrote:
Hi,

can I ask you to create a working project (for ex. on github) so it would be easier to reproduce.

Thank you.

WBR,
Alexey.


On 05.11.14 07:46, Gonfi den Tschal wrote:
QUESTION: How do I stop Grizzly from serving content on URLs for which there is no handler, but are under the same path?


USERLAND CODE:

full class at http://nopaste.info/05ffefc3fb.html

    public static void main(String[] args) throws IOException {
        HttpServer httpServer = new HttpServer();
        httpServer.addListener(new NetworkListener("jaxws-listener", "localhost", 8090));
        httpServer.getServerConfiguration().addHttpHandler(new JaxwsHandler(new BarService()), "/jaxws/hello");
        httpServer.start();
        System.in.read();
    }

    @WebService
    private static class BarService {
        @WebMethod
        public String hello() {
            return "hello world";
        }
    }


Loading the URL http://localhost:8090/jaxws/hello?wsdl in the browser brings the correct document, see http://nopaste.info/f8ec12f601.html

However, loading any other url under the /jaxws/ path brings a similar document, for example http://localhost:8090/jaxws/helllloooooo?wsdl see http://nopaste.info/d7e6013a1a.html

A difference is at the end:
  1. <soap:address location="http://localhost:8090/jaxws/hello"/>
  1. <soap:address location="http://localhost:8090/jaxws"/>

What are the arguments for this behavior?
And what can I do to get a 404 on all URLs that are not registered?

Software used:
 - grizzly-http-server
 - grizzly-http-server-jaxws
tried versions 2.3.17 (latest) and 2.3.7

Greetings,
Gonfi





Reply | Threaded
Open this post in threaded view
|

Re: JaxwsHandler serving content on non-registered URLs under same path

oleksiys
Administrator
Hi,

great, pls. use 2.3.18, because 2.3.17 may have some problems resolving the WS path.

Thanks.

WBR,
Alexey.

On 29.01.15 12:29, Gonfi den Tschal wrote:
Thanks Alexey! Works.
I've tried 2.3.17 and 2.3.18, both work the same, saying "Not Found" when registering in the way you demonstrated.
(I have not tried 2.3.18-SNAPSHOT at all.)

Gonfi


On Tue, Nov 11, 2014 at 2:55 AM, Oleksiy Stashok <[hidden email]> wrote:
Hi,

I've made some changes on 2.3.x branch.
Can you pls. change the way you register the JaxwsHandler:

        httpServer.getServerConfiguration().addHttpHandler(jaxwsHandler,
                HttpHandlerRegistration.bulder()
                    .contextPath(path)
                    .urlPattern("")
                    .build());



and try the latest Grizzly 2.3.18-SNAPSHOT.

Thank you.

WBR,
Alexey.


On 06.11.14 05:42, Gonfi den Tschal wrote:

3) In the console you will see:
    Publishing soap web service: http://localhost:80/soap/v1/system/ping?wsdl

4) load that url in the browser to see the wsdl

5) change the url, anything under /soap/ will give you a wsdl. This is not desired from my point of view; changing to v2 also brings something.

6) change /soap/ to /soap2/ and you'll get
    Not Found
    Resource identified by path '/soap2/v2/system/ping', does not exist.
    Grizzly 2.3.17

If you need another host name or port number then change it in GrizzlySoapWebServer on top new Host("localhost", 80)

Greetings,
Gonfi


On Thu, Nov 6, 2014 at 6:21 AM, Oleksiy Stashok <[hidden email]> wrote:
Hi,

can I ask you to create a working project (for ex. on github) so it would be easier to reproduce.

Thank you.

WBR,
Alexey.


On 05.11.14 07:46, Gonfi den Tschal wrote:
QUESTION: How do I stop Grizzly from serving content on URLs for which there is no handler, but are under the same path?


USERLAND CODE:

full class at http://nopaste.info/05ffefc3fb.html

    public static void main(String[] args) throws IOException {
        HttpServer httpServer = new HttpServer();
        httpServer.addListener(new NetworkListener("jaxws-listener", "localhost", 8090));
        httpServer.getServerConfiguration().addHttpHandler(new JaxwsHandler(new BarService()), "/jaxws/hello");
        httpServer.start();
        System.in.read();
    }

    @WebService
    private static class BarService {
        @WebMethod
        public String hello() {
            return "hello world";
        }
    }


Loading the URL http://localhost:8090/jaxws/hello?wsdl in the browser brings the correct document, see http://nopaste.info/f8ec12f601.html

However, loading any other url under the /jaxws/ path brings a similar document, for example http://localhost:8090/jaxws/helllloooooo?wsdl see http://nopaste.info/d7e6013a1a.html

A difference is at the end:
  1. <soap:address location="http://localhost:8090/jaxws/hello"/>
  1. <soap:address location="http://localhost:8090/jaxws"/>

What are the arguments for this behavior?
And what can I do to get a 404 on all URLs that are not registered?

Software used:
 - grizzly-http-server
 - grizzly-http-server-jaxws
tried versions 2.3.17 (latest) and 2.3.7

Greetings,
Gonfi