users@glassfish.java.net

Message Level security from non appclient client

From: <glassfish_at_javadesktop.org>
Date: Sun, 28 Oct 2007 11:46:32 PST

I've searched and searched on the net and I can't find any examples at all of writing a standalone java Web Service client which doesn't either run in a glassfish container or use the appclient binary to execute.

I'm trying to write a Web Service and add message level security, but I don't want my client application to need to launch using appclient.

Non secured I can simply do as I show below. But if I want to add message level security, I can't find any mention of this at all, I'm presuming the @WebServiceRef I see so often takes care of configuring this at the client end. But as I'm not executing through clientapp... Presumably there is something I can code to configure the security for the call but I can't find any documentation and frequently run into the brick wall of "click this button in netbeans" which I don't have.

Any help would be much appreciated.

                try {
                        service = new CalculatorService(new URL("http://localhost:8080/Calculator/Calculator?wsdl"), new QName("http://calculator.wherever.com/wsdl", "CalculatorService"));
                } catch (MalformedURLException e) {
                        e.printStackTrace();
                }

                CalculatorClient client = new CalculatorClient();
                Calculator calculatorPort = service.getPort(Calculator.class);
                
                double x = 3.3;
                double y = 5.7;

                System.out.println("Calculator Service and Port, Add operation:");
                System.out.println("\t" + x + " + " + y + " = " + calculatorPort.add(x, y));
[Message sent by forum member 'dpwr' (dpwr)]

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