Package org.jboss.ws.metadata.wsse

Examples of org.jboss.ws.metadata.wsse.WSSecurityConfiguration


            "</wsse:Security>" +
            "</env:Header>" +
            "<env:Body><ns1:echo xmlns:ns1='http://org.jboss.ws/jbws1988'><arg0>Hi!</arg0></ns1:echo></env:Body>" +
            "</env:Envelope>";

      WSSecurityConfiguration configuration = WSSecurityOMFactory.newInstance().parse(new StringReader(serverConf));
     
      //"2008-03-12T17:12:31.310Z"
      Calendar created = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
     
      sec.decodeMessage(configuration, getMessage(created, envStr), null);
View Full Code Here


      return factory.createMessage(null, inputStream);
   }
  
   public void testEncodeMessageWithNonceAndCreated() throws Exception
   {
      WSSecurityConfiguration configuration = WSSecurityOMFactory.newInstance().parse(new StringReader(clientConf));
      ByteArrayInputStream inputStream = new ByteArrayInputStream(testMessage.getBytes());
      MessageFactory factory = new MessageFactoryImpl();
      SOAPMessage soapMsg = factory.createMessage(null, inputStream);
      sec.encodeMessage(configuration, soapMsg, null, "kermit", "therealfrog");
      Element securityEl = (Element)soapMsg.getSOAPHeader().getChildElements(Constants.WSSE_HEADER_QNAME).next();
View Full Code Here

      assertNotNull(DOMUtils.getTextContent(createdEl));
   }
  
   public void testEncodeMessageWithNonce() throws Exception
   {
      WSSecurityConfiguration configuration = WSSecurityOMFactory.newInstance().parse(new StringReader(clientConf));
      ByteArrayInputStream inputStream = new ByteArrayInputStream(testMessage.getBytes());
      MessageFactory factory = new MessageFactoryImpl();
      SOAPMessage soapMsg = factory.createMessage(null, inputStream);
      Username username = new Username(true, true, false);
      Config config = new Config();
View Full Code Here

      assertFalse(DOMUtils.getChildElements(usernameTokenEl, new QName(Constants.WSU_NS, "Created")).hasNext());
   }
  
   public void testEncodeMessageWithCreated() throws Exception
   {
      WSSecurityConfiguration configuration = WSSecurityOMFactory.newInstance().parse(new StringReader(clientConf));
      ByteArrayInputStream inputStream = new ByteArrayInputStream(testMessage.getBytes());
      MessageFactory factory = new MessageFactoryImpl();
      SOAPMessage soapMsg = factory.createMessage(null, inputStream);
      Username username = new Username(true, false, true);
      Config config = new Config();
View Full Code Here

            + "      <encryption/>"
            + "      <signature/>"
            + "    </requires>"
            + "  </config>"
            + "</jboss-ws-security>";
      WSSecurityConfiguration configuration = WSSecurityOMFactory.newInstance().parse(new StringReader(conf));
      ByteArrayInputStream inputStream = new ByteArrayInputStream(envStr.getBytes());
      MessageFactory factory = new MessageFactoryImpl();
      SOAPMessage soapMsg = factory.createMessage(null, inputStream);
      String expected = DOMWriter.printNode(soapMsg.getSOAPPart().getEnvelope(), true);
View Full Code Here

   protected boolean handleInboundSecurity(MessageContext msgContext)
   {
      Exception exception = null;
      try
      {
         WSSecurityConfiguration configuration = getSecurityConfiguration(msgContext);
         if (configuration != null)
         {
            CommonMessageContext ctx = (CommonMessageContext)msgContext;
            SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
           
View Full Code Here

   protected boolean handleOutboundSecurity(MessageContext msgContext)
   {
      Exception exception = null;
      try
      {
         WSSecurityConfiguration configuration = getSecurityConfiguration(msgContext);
         if (configuration != null)
         {
            CommonMessageContext ctx = (CommonMessageContext)msgContext;
            SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
           
View Full Code Here

   private WSSecurityConfiguration getSecurityConfiguration(MessageContext msgContext)
   {
      EndpointMetaData epMetaData = ((CommonMessageContext)msgContext).getEndpointMetaData();
      ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();

      WSSecurityConfiguration config = serviceMetaData.getSecurityConfiguration();
      if (config == null) // might be set through ServiceObjectFactory
      {
         try
         {
            WSSecurityConfigFactory wsseConfFactory = WSSecurityConfigFactory.newInstance();
View Full Code Here

   protected boolean handleInboundSecurity(MessageContext msgContext)
   {
      Exception exception = null;
      try
      {
         WSSecurityConfiguration configuration = getSecurityConfiguration(msgContext);
         if (configuration != null)
         {
            CommonMessageContext ctx = (CommonMessageContext)msgContext;
            SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
            new WSSecurityDispatcher().decodeMessage(configuration, soapMessage, null);
View Full Code Here

   protected boolean handleOutboundSecurity(MessageContext msgContext)
   {
      Exception exception = null;
      try
      {
         WSSecurityConfiguration configuration = getSecurityConfiguration(msgContext);
         if (configuration != null)
         {
            CommonMessageContext ctx = (CommonMessageContext)msgContext;
            SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
           
View Full Code Here

TOP

Related Classes of org.jboss.ws.metadata.wsse.WSSecurityConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.