views:

224

answers:

0

Hi all,

I'm a newbie in web services with jax-ws and I'm a little mixed up with the different files. I'm doing a simple hello test and I'm trying to explain something.

I successfully installed my web service on Glassfish. I also tested it with a standalone javaoutside the server) My example comes from the helloservice in the javaee5 tutorial examples. (http://java.sun.com/javaee/5/docs/tutorial/doc/docinfo.html)

In the web.xml, I have this section:

...
    <servlet-mapping>
        <servlet-name>HelloService</servlet-name>
        <url-pattern>/hello</url-pattern>
    </servlet-mapping>
...

in sun-jaxws.xml

...
    <endpoint
        name='HelloService'
        implementation='helloservice.endpoint.Hello'
        url-pattern='/hello'/>
...

and in the sun-web.xml:

...
  <context-root>/helloservice</context-root>
...

I see that the context root specified in the web.xml is the same as the one in sun-jaxws.xml.

  1. The context root in sun-web.xml, does it matter or is it only used in a EAR file ?

  2. I can access my wsdl file from 2 different addresses: http://localhost:8080/helloservice/hello?wsdl http://localhost:8080/helloservice/HelloService?wsdl I can't explain the second one. Where does it come from ? Is it a configuration of the endpoint address ? How come we can access the web service both ways (by context-root and by Service name)? Please explain to me

Thanks