gpt4 book ai didi

com.sun.xml.wss.XWSSecurityException.getMessage()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 03:46:40 28 4
gpt4 key购买 nike

本文整理了Java中com.sun.xml.wss.XWSSecurityException.getMessage()方法的一些代码示例,展示了XWSSecurityException.getMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWSSecurityException.getMessage()方法的具体详情如下:
包路径:com.sun.xml.wss.XWSSecurityException
类名称:XWSSecurityException
方法名:getMessage

XWSSecurityException.getMessage介绍

暂无

代码示例

代码示例来源:origin: com.hynnet/xws-security

public void writeTo(OutputStream os)  {
  Marshaller writer;
  try {
    writer = getMarshaller();
    
    JAXBElement ed = getEK(writer);
    writer.marshal(ed,os);
  } catch (javax.xml.bind.JAXBException ex) {
    logger.log(Level.SEVERE,LogStringsMessages.WSS_1921_ERROR_WRITING_ENCRYPTEDKEY(ex.getMessage()), ex);
  } catch (com.sun.xml.wss.XWSSecurityException ex) {
    logger.log(Level.SEVERE,LogStringsMessages.WSS_1921_ERROR_WRITING_ENCRYPTEDKEY(ex.getMessage()), ex);
  }
}

代码示例来源:origin: com.hynnet/xws-security

/**
 * Delete security header
 */
public void deleteSecurityHeader() {
  try {
    findSecurityHeader();
    if (null != wsseSecurity) {
      wsseSecurity.detachNode();
      wsseSecurity = null;
    }
  } catch (XWSSecurityException e) {
    log.log(Level.SEVERE, "WSS0370.error.deleting.secheader", e.getMessage());
  }
}

代码示例来源:origin: com.hynnet/xws-security

public void writeTo(javax.xml.stream.XMLStreamWriter streamWriter) throws javax.xml.stream.XMLStreamException {
  Marshaller writer;
  try {
    if (streamWriter instanceof Map) {
      OutputStream os = (OutputStream) ((Map) streamWriter).get("sjsxp-outputstream");
      if (os != null) {
        streamWriter.writeCharacters("");        // Force completion of open elems
        writeTo(os);
        return;
      }
    }
    writer = getMarshaller();
    JAXBElement ed = getEK(writer);
    writer.marshal(ed,streamWriter);
  } catch (javax.xml.bind.JAXBException ex) {
    logger.log(Level.SEVERE,LogStringsMessages.WSS_1921_ERROR_WRITING_ENCRYPTEDKEY(ex.getMessage()), ex);
  } catch (com.sun.xml.wss.XWSSecurityException ex) {
    logger.log(Level.SEVERE,LogStringsMessages.WSS_1921_ERROR_WRITING_ENCRYPTEDKEY(ex.getMessage()), ex);
  }
}

代码示例来源:origin: com.hynnet/xws-security

/**
 * Make Security Header Non-MustUnderstand
 */
public void resetMustUnderstandOnSecHeader() {
  try {
    findSecurityHeader();
    if (null != wsseSecurity) {
      wsseSecurity.removeAttributeNS(this.getEnvelope().getNamespaceURI(), "mustUnderstand");
    }
  } catch (XWSSecurityException e) {
    log.log(Level.SEVERE, "WSS0370.error.deleting.secheader", e.getMessage());
  }
}

代码示例来源:origin: com.hynnet/xws-security

logger.log (Level.FINEST,"Error occurred while resolving"+uri,ex);
throw new URIReferenceException (ex.getMessage ());

代码示例来源:origin: com.hynnet/xws-security

public void writeTo(java.io.OutputStream os)  {
  try {
    Marshaller writer = getMarshaller();
    CryptoProcessor dep;
    
    dep = new CryptoProcessor(Cipher.ENCRYPT_MODE, edt.getEncryptionMethod().getAlgorithm(), data, key);
    
    CVAdapter adapter = new CVAdapter(dep);
    writer.setAdapter(CVAdapter.class,adapter);
    com.sun.xml.security.core.xenc.ObjectFactory obj = new com.sun.xml.security.core.xenc.ObjectFactory();
    JAXBElement ed = obj.createEncryptedData(edt);
    writer.marshal(ed,os);
  }catch (com.sun.xml.wss.XWSSecurityException ex) {
    logger.log(Level.SEVERE, LogStringsMessages.WSS_1919_ERROR_WRITING_ENCRYPTEDDATA(ex.getMessage()), ex);
  }catch (javax.xml.bind.JAXBException ex) {
    logger.log(Level.SEVERE, LogStringsMessages.WSS_1919_ERROR_WRITING_ENCRYPTEDDATA(ex.getMessage()), ex);
  }
}

代码示例来源:origin: com.hynnet/xws-security

throw SecurableSoapMessage.newSOAPFaultException(
    MessageConstants.WSSE_UNSUPPORTED_SECURITY_TOKEN,
    xwsse.getMessage(),
    xwsse);

代码示例来源:origin: com.hynnet/xws-security

public void writeTo(OutputStream os) {
  try {
    Marshaller writer = getMarshaller();
    CryptoProcessor dep;
    
    dep = new CryptoProcessor(Cipher.ENCRYPT_MODE, eht.getEncryptedData().getEncryptionMethod().getAlgorithm(), data, key);
    CVAdapter adapter = new CVAdapter(dep);
    writer.setAdapter(CVAdapter.class,adapter);
    com.sun.xml.ws.security.secext11.ObjectFactory obj = new com.sun.xml.ws.security.secext11.ObjectFactory();
    JAXBElement eh = obj.createEncryptedHeader(eht);
    writer.marshal(eh,os);
  }catch (com.sun.xml.wss.XWSSecurityException ex) {
    logger.log(Level.SEVERE, LogStringsMessages.WSS_1916_ERROR_WRITING_ECRYPTEDHEADER(ex.getMessage()), ex);
  }catch (javax.xml.bind.JAXBException ex) {
    logger.log(Level.SEVERE, LogStringsMessages.WSS_1916_ERROR_WRITING_ECRYPTEDHEADER(ex.getMessage()), ex);
  }
}

代码示例来源:origin: com.hynnet/xws-security

writer.marshal(ed,streamWriter);
}catch (com.sun.xml.wss.XWSSecurityException ex) {
  logger.log(Level.SEVERE, LogStringsMessages.WSS_1919_ERROR_WRITING_ENCRYPTEDDATA(ex.getMessage()), ex);
}catch (javax.xml.bind.JAXBException ex) {
  logger.log(Level.SEVERE, LogStringsMessages.WSS_1919_ERROR_WRITING_ENCRYPTEDDATA(ex.getMessage()), ex);

代码示例来源:origin: com.hynnet/xws-security

logger.log(Level.SEVERE, LogStringsMessages.WSS_1916_ERROR_WRITING_ECRYPTEDHEADER(ex.getMessage()), ex);
} catch (com.sun.xml.wss.XWSSecurityException ex) {
  logger.log(Level.SEVERE, LogStringsMessages.WSS_1916_ERROR_WRITING_ECRYPTEDHEADER(ex.getMessage()), ex);

代码示例来源:origin: spring-projects/spring-ws

/**
 * Secures the given SoapMessage message in accordance with the defined security policy.
 *
 * @param soapMessage the message to be secured
 * @throws XwsSecuritySecurementException in case of errors
 * @throws IllegalArgumentException          when soapMessage is not a {@code SaajSoapMessage}
 */
@Override
protected void secureMessage(SoapMessage soapMessage, MessageContext messageContext)
    throws XwsSecuritySecurementException {
  Assert.isTrue(soapMessage instanceof SaajSoapMessage, "XwsSecurityInterceptor requires a SaajSoapMessage. " +
      "Use a SaajSoapMessageFactory to create the SOAP messages.");
  SaajSoapMessage saajSoapMessage = (SaajSoapMessage) soapMessage;
  try {
    ProcessingContext context = processor.createProcessingContext(saajSoapMessage.getSaajMessage());
    SOAPMessage result = processor.secureOutboundMessage(context);
    saajSoapMessage.setSaajMessage(result);
  }
  catch (XWSSecurityException ex) {
    throw new XwsSecuritySecurementException(ex.getMessage(), ex);
  }
  catch (WssSoapFaultException ex) {
    throw new XwsSecurityFaultException(ex.getFaultCode(), ex.getFaultString(), ex.getFaultActor());
  }
}

代码示例来源:origin: org.springframework.ws/spring-ws-security

/**
 * Validates the given SoapMessage message in accordance with the defined security policy.
 *
 * @param soapMessage the message to be validated
 * @throws XwsSecurityValidationException in case of errors
 * @throws IllegalArgumentException          when soapMessage is not a {@code SaajSoapMessage}
 */
@Override
protected void validateMessage(SoapMessage soapMessage, MessageContext messageContext)
    throws WsSecurityValidationException {
  Assert.isTrue(soapMessage instanceof SaajSoapMessage, "XwsSecurityInterceptor requires a SaajSoapMessage. " +
      "Use a SaajSoapMessageFactory to create the SOAP messages.");
  SaajSoapMessage saajSoapMessage = (SaajSoapMessage) soapMessage;
  try {
    ProcessingContext context = processor.createProcessingContext(saajSoapMessage.getSaajMessage());
    SOAPMessage result = processor.verifyInboundMessage(context);
    saajSoapMessage.setSaajMessage(result);
  }
  catch (XWSSecurityException ex) {
    throw new XwsSecurityValidationException(ex.getMessage(), ex);
  }
  catch (WssSoapFaultException ex) {
    throw new XwsSecurityFaultException(ex.getFaultCode(), ex.getFaultString(), ex.getFaultActor());
  }
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Secures the given SoapMessage message in accordance with the defined security policy.
 *
 * @param soapMessage the message to be secured
 * @throws XwsSecuritySecurementException in case of errors
 * @throws IllegalArgumentException          when soapMessage is not a {@code SaajSoapMessage}
 */
@Override
protected void secureMessage(SoapMessage soapMessage, MessageContext messageContext)
    throws XwsSecuritySecurementException {
  Assert.isTrue(soapMessage instanceof SaajSoapMessage, "XwsSecurityInterceptor requires a SaajSoapMessage. " +
      "Use a SaajSoapMessageFactory to create the SOAP messages.");
  SaajSoapMessage saajSoapMessage = (SaajSoapMessage) soapMessage;
  try {
    ProcessingContext context = processor.createProcessingContext(saajSoapMessage.getSaajMessage());
    SOAPMessage result = processor.secureOutboundMessage(context);
    saajSoapMessage.setSaajMessage(result);
  }
  catch (XWSSecurityException ex) {
    throw new XwsSecuritySecurementException(ex.getMessage(), ex);
  }
  catch (WssSoapFaultException ex) {
    throw new XwsSecurityFaultException(ex.getFaultCode(), ex.getFaultString(), ex.getFaultActor());
  }
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Validates the given SoapMessage message in accordance with the defined security policy.
 *
 * @param soapMessage the message to be validated
 * @throws XwsSecurityValidationException in case of errors
 * @throws IllegalArgumentException          when soapMessage is not a {@code SaajSoapMessage}
 */
@Override
protected void validateMessage(SoapMessage soapMessage, MessageContext messageContext)
    throws WsSecurityValidationException {
  Assert.isTrue(soapMessage instanceof SaajSoapMessage, "XwsSecurityInterceptor requires a SaajSoapMessage. " +
      "Use a SaajSoapMessageFactory to create the SOAP messages.");
  SaajSoapMessage saajSoapMessage = (SaajSoapMessage) soapMessage;
  try {
    ProcessingContext context = processor.createProcessingContext(saajSoapMessage.getSaajMessage());
    SOAPMessage result = processor.verifyInboundMessage(context);
    saajSoapMessage.setSaajMessage(result);
  }
  catch (XWSSecurityException ex) {
    throw new XwsSecurityValidationException(ex.getMessage(), ex);
  }
  catch (WssSoapFaultException ex) {
    throw new XwsSecurityFaultException(ex.getFaultCode(), ex.getFaultString(), ex.getFaultActor());
  }
}

代码示例来源:origin: org.springframework.ws/spring-ws-security

/**
 * Secures the given SoapMessage message in accordance with the defined security policy.
 *
 * @param soapMessage the message to be secured
 * @throws XwsSecuritySecurementException in case of errors
 * @throws IllegalArgumentException          when soapMessage is not a {@code SaajSoapMessage}
 */
@Override
protected void secureMessage(SoapMessage soapMessage, MessageContext messageContext)
    throws XwsSecuritySecurementException {
  Assert.isTrue(soapMessage instanceof SaajSoapMessage, "XwsSecurityInterceptor requires a SaajSoapMessage. " +
      "Use a SaajSoapMessageFactory to create the SOAP messages.");
  SaajSoapMessage saajSoapMessage = (SaajSoapMessage) soapMessage;
  try {
    ProcessingContext context = processor.createProcessingContext(saajSoapMessage.getSaajMessage());
    SOAPMessage result = processor.secureOutboundMessage(context);
    saajSoapMessage.setSaajMessage(result);
  }
  catch (XWSSecurityException ex) {
    throw new XwsSecuritySecurementException(ex.getMessage(), ex);
  }
  catch (WssSoapFaultException ex) {
    throw new XwsSecurityFaultException(ex.getFaultCode(), ex.getFaultString(), ex.getFaultActor());
  }
}

代码示例来源:origin: spring-projects/spring-ws

/**
 * Validates the given SoapMessage message in accordance with the defined security policy.
 *
 * @param soapMessage the message to be validated
 * @throws XwsSecurityValidationException in case of errors
 * @throws IllegalArgumentException          when soapMessage is not a {@code SaajSoapMessage}
 */
@Override
protected void validateMessage(SoapMessage soapMessage, MessageContext messageContext)
    throws WsSecurityValidationException {
  Assert.isTrue(soapMessage instanceof SaajSoapMessage, "XwsSecurityInterceptor requires a SaajSoapMessage. " +
      "Use a SaajSoapMessageFactory to create the SOAP messages.");
  SaajSoapMessage saajSoapMessage = (SaajSoapMessage) soapMessage;
  try {
    ProcessingContext context = processor.createProcessingContext(saajSoapMessage.getSaajMessage());
    SOAPMessage result = processor.verifyInboundMessage(context);
    saajSoapMessage.setSaajMessage(result);
  }
  catch (XWSSecurityException ex) {
    throw new XwsSecurityValidationException(ex.getMessage(), ex);
  }
  catch (WssSoapFaultException ex) {
    throw new XwsSecurityFaultException(ex.getFaultCode(), ex.getFaultString(), ex.getFaultActor());
  }
}

代码示例来源:origin: com.hynnet/xws-security

MessageConstants.REQUESTER_SERIAL, sharedState.get(REQUESTER_SERIAL));
    }
     private void populateSharedStateFromContext(Map sharedState, ProcessingContextImpl context) {
      sharedState.put(
        REQUESTER_SUBJECT, context.getExtraneousProperty(MessageConstants.AUTH_SUBJECT));
      sharedState.put(
        REQUESTER_KEYID, context.getExtraneousProperty(MessageConstants.REQUESTER_KEYID));
      sharedState.put(
        REQUESTER_ISSUERNAME, 
          context.getExtraneousProperty(MessageConstants.REQUESTER_ISSUERNAME));
      sharedState.put(
        REQUESTER_SERIAL, context.getExtraneousProperty(MessageConstants.REQUESTER_SERIAL));
     }
}

代码示例来源:origin: com.hynnet/xws-security

SecurableSoapMessage.newSOAPFaultException(
    MessageConstants.WSSE_INTERNAL_SERVER_ERROR,
    xwse.getMessage(), xwse);
Message msg = Messages.create(getSOAPFault(wsfe));
packet.setMessage(msg);

代码示例来源:origin: com.hynnet/xws-security

qname, xwse.getMessage(), xwse);
throw getSOAPFaultException(wsfe);

代码示例来源:origin: com.hynnet/xws-security

SecurableSoapMessage.newSOAPFaultException(
     MessageConstants.WSSE_INTERNAL_SERVER_ERROR,
     xwse.getMessage(), xwse);
throw getSOAPFaultException(wsfe);

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com