users@glassfish.java.net

Re: Message Level security from non appclient client

From: <glassfish_at_javadesktop.org>
Date: Mon, 29 Oct 2007 02:51:33 PST

Ok, I got NetBeans to try and help me figure this out.

I've installed the SecureCalculatorApp that comes with Netbeans 6. The demonstration client code is a servlet.

I've attempted to create my own standalone client. I create a new class and use the Call Web Service Operation to insert some Java code to call my Web Service. I nd up with this.

package org.me.calculator.client;

/**
 *
 * @author douglas
 */
public class NewClass {
    public static void main(String [] args) {
        try { // Call Web Service Operation
            org.me.calculator.client.CalculatorWSService service = new org.me.calculator.client.CalculatorWSService();
            org.me.calculator.client.CalculatorWS port = service.getCalculatorWSPort();
            
            // TODO initialize WS operation arguments here
            int i = 0;
            int j = 0;
            // TODO process result here
            int result = port.add(i, j);
            System.out.println("Result = "+result);
        } catch (Exception ex) {
            // TODO handle custom exceptions here
        }
    }
}


If I call run on the main method in that file I get:

init:
deps-module-jar:
deps-ear-jar:
deps-jar:
wsimport-init:
wsimport-client-check-CalculatorWSService:
wsimport-client-CalculatorWSService:
wsimport-client-generate:
wsimport-client-compile:
compile-single:
compile-single-over
run-main:
Oct 29, 2007 10:32:38 AM [com.sun.xml.ws.policy.jaxws.PolicyConfigParser] parseModel
INFO: WSP1049: Loaded WSIT configuration from file: file:/Users/douglas/NetBeansProjects/SecureCalculator/SecureCalculatorClientApp/build/web/WEB-INF/classes/META-INF/wsit-client.xml
Oct 29, 2007 10:32:39 AM com.sun.xml.wss.jaxws.impl.SecurityPipeBase populateTruststoreProps
SEVERE: WSSPIPE0016: TrustStore URL was obtained as NULL from ConfigAssertion.
Oct 29, 2007 10:32:39 AM com.sun.xml.wss.jaxws.impl.SecurityClientPipe <init>
SEVERE: WSSPIPE0023: Error in creating new instance of SecurityClientPipe
java.lang.RuntimeException: WSSPIPE0016: TrustStore URL was obtained as NULL from ConfigAssertion.
        at com.sun.xml.wss.jaxws.impl.SecurityPipeBase.populateTruststoreProps(SecurityPipeBase.java:1266)
        at com.sun.xml.wss.jaxws.impl.SecurityPipeBase.populateConfigProperties(SecurityPipeBase.java:1204)
        at com.sun.xml.wss.jaxws.impl.SecurityClientPipe.configureClientHandler(SecurityClientPipe.java:427)
        at com.sun.xml.wss.jaxws.impl.SecurityClientPipe.<init>(SecurityClientPipe.java:119)
        at com.sun.xml.ws.assembler.PipelineAssemblerFactoryImpl$WsitPipelineAssembler.createClient(PipelineAssemblerFactoryImpl.java:219)
        at com.sun.xml.ws.api.pipe.TubelineAssemblerFactory$TubelineAssemblerAdapter.createClient(TubelineAssemblerFactory.java:136)
        at com.sun.xml.ws.client.WSServiceDelegate.createPipeline(WSServiceDelegate.java:411)
        at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:572)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:320)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:302)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:295)
        at javax.xml.ws.Service.getPort(Service.java:92)
        at org.me.calculator.client.CalculatorWSService.getCalculatorWSPort(CalculatorWSService.java:56)
        at org.me.calculator.client.NewClass.main(NewClass.java:16)
BUILD SUCCESSFUL (total time: 2 seconds)


which doesn't surprise me at all as I haven't configured any truststores for the client. Where do I set this up? And how did it know to read the wsit-client.xml configuration file. I can find no reference to that in the Ant and it certainly isn't in that class I've just shown or any of the stub code. I'm extremely confused. Where is the clever voodoo and it's documentation?

Cheers in advance for any help.
[Message sent by forum member 'dpwr' (dpwr)]

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