users@glassfish.java.net

WSDL with basic auth

From: <glassfish_at_javadesktop.org>
Date: Mon, 28 Jul 2008 02:28:57 PDT

Hello List,

i let metro generate the wsdl accessable with Service?wsdl

But I also add basic auth to the service. So the wsdl needs also basic auth. With netbeans I can import / generate the client classes because I get a username/passwort window before generation. But when I consume the ws I get the error that the server return with 401 (auth) when I create an object from the class named like the service. The object try to connect to the wsdl. I see some notes in the forum how to access a ws with basic auth with the port object and the BindingProvider but nothing with a auth wsdl file.

I also try to add username and pw to the url without any sucess.

Question:
Can I write a ws (server app) where the app is secured with basic auth, but the ?wsdl and ?xsd=1 file don't need auth.

I know only (part from web.xml)

 <security-constraint>
        <display-name>Test</display-name>
        <web-resource-collection>
            <web-resource-name>test</web-resource-name>
            <description/>
            <url-pattern>/SkipackService</url-pattern>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
            <http-method>HEAD</http-method>
            <http-method>PUT</http-method>
            <http-method>OPTIONS</http-method>
            <http-method>TRACE</http-method>
            <http-method>DELETE</http-method>
        </web-resource-collection>
        <auth-constraint>
            <role-name>Users</role-name>
        </auth-constraint>
    </security-constraint>

and don't know where I should declare the parameter part.

or

how do I set the username and password for the generated class / object for the wsdl file of the ws-client.

Any hint or commet is welcome

regards Dietmar
[Message sent by forum member 'oaspublic' (oaspublic)]

http://forums.java.net/jive/thread.jspa?messageID=289743