1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| import electric.registry.*;
import electric.server.http.*;
import electric.soap.security.*;
import electric.soap.security.authenticators.*;
import electric.soap.security.guards.*;
import electric.soap.security.signature.*;
import electric.soap.security.signature.xml.*;
import electric.glue.context.*;
public class Server
{
public static void main(String[] args) throws Exception
{
HTTP.startup( "http://localhost:8004/GLUEX509Interop" );
// Configure the WS-Security Context
ProxyContext proxyContext = new ProxyContext();
WSSContext wss = new WSSContext();
proxyContext.setWSSContext( wss );
// Change the end point if we want to use the SOAP Trace Utility from the SOAP Toolkit 3.0
//proxyContext.addProperty("endpoint","http://localhost:8005/sig1/services/exchange");
// Set the Authenticator and Guard to trap incoming requests and validate signatures
WSSSignature signatureSpec = new WSSSignature( new ElementReference( "/soap:Envelope/soap:Body" ) );
wss.in.addAuthenticator( new X509NullAuthenticator() );
wss.in.addGuard( new SignatureGuard( signatureSpec ) );
// Publish the service
Registry.publish( "Service1", new Service1(), proxyContext );
}
} |
Partager