Package org.apache.ws.sandbox.security.trust2.exception

Examples of org.apache.ws.sandbox.security.trust2.exception.NoSoapBody


        UsernameToken userToken = new UsernameToken(WSSConfig.getDefaultWSConfig().isPrecisionInMilliSeconds(),doc);
        userToken.setName("bob");
        userToken.setPassword("bobspass");

        RequestSecurityTokenResponse tokenResponse = new RequestSecurityTokenResponse(doc, new SecurityTokenOrReference(userToken));
        tokenResponse.setContext(new URI("http://context.context"));
        tokenResponse.setTokenType(TokenTypes.USERNAME);
   
        /*
        Data data = new Data();
View Full Code Here


                this.usernameToken = new UsernameToken(wssConfig, element);
            if (el.equals(BinarySecurity.TOKEN))
                this.binarySecurityToken = new BinarySecurity(wssConfig, element);
            doc = element.getOwnerDocument();
        } catch (WSSecurityException e) {
            throw new ElementParsingException("WSSecurityException while trying to create a SecurityTokenOrReference object from an XML Element: "
                    + e.getMessage());
        }
    }
View Full Code Here

                        if (el.equals(UsernameToken.TOKEN))
                            return new UsernameToken(wssConfig, tokenElement);
                        if (el.equals(BinarySecurity.TOKEN))
                            return new BinarySecurity(wssConfig, tokenElement);
                    } catch (WSSecurityException e) {
                        throw new ElementParsingException("WSSecurityException while trying to create a SecurityToken object from a SecurityTokenReference: "
                                + e.getMessage());
                    }
                }
            } catch (WSSecurityException e) {
                throw new InvalidSecurityTokenReference("WSSecurityException while trying to dereference a <SecurityTokenReference>: " + e.getMessage());
View Full Code Here

                this.usernameToken = new UsernameToken(element);
            if (el.equals(BinarySecurity.TOKEN_BST))
                this.binarySecurityToken = new BinarySecurity(element);
            doc = element.getOwnerDocument();
        } catch (WSSecurityException e) {
            throw new ElementParsingException("WSSecurityException while trying to create a SecurityTokenOrReference object from an XML Element: "
                    + e.getMessage());
        }
    }
View Full Code Here

                        if (el.equals(UsernameToken.TOKEN))
                            return new UsernameToken(tokenElement);
                        if (el.equals(BinarySecurity.TOKEN_BST))
                            return new BinarySecurity(tokenElement);
                    } catch (WSSecurityException e) {
                        throw new ElementParsingException("WSSecurityException while trying to create a SecurityToken object from a SecurityTokenReference: "
                                + e.getMessage());
                    }
                }
            } catch (WSSecurityException e) {
                throw new InvalidSecurityTokenReference("WSSecurityException while trying to dereference a <SecurityTokenReference>: " + e.getMessage());
View Full Code Here

                            addCustomElement((Element) currentNode);
                    }
                }
            }
        } catch (URISyntaxException e) {
            throw new ElementParsingException("URISyntaxException while creating SecurityTokenMessage from XML element: " + e.getMessage());
        } catch (WSSecurityException e) {
            throw new ElementParsingException("WSSecurityException while creating SecurityTokenMessage from XML element: " + e.getMessage());
        }
    }
View Full Code Here

                String textContent = getTextContent(currentNode);
                if (textContent != null && !textContent.equals("")) {
                    try {
                        setRequestType(new URI(textContent));
                    } catch (URISyntaxException e) {
                        throw new ElementParsingException("URISyntaxException while creating RequestSecurityToken (RequestType) from XML Element: "
                                + e.getMessage());
                    }
                }
            } else if (currentNode.getLocalName().equals(TrustConstants.BASE)) {
                Element elem = getFirstNonBlankChildAsElement(currentNode);
View Full Code Here

    protected Element createTokenOrReferenceElement(String enclosingTagName, SecurityTokenOrReference token) throws TrustException {
        Element element = doc.createElementNS(TrustConstants.WST_NS, enclosingTagName);
        Element tokenElement = token.getElement();
        if (tokenElement == null)
            throw new EmptyTokenOrReference("SecurityTokenOrReference specified does not contain " +
                    "a security token element or reference element.");
        element.appendChild(tokenElement);
        return element;
    }
View Full Code Here

                        throw new ElementParsingException("WSSecurityException while trying to create a SecurityToken object from a SecurityTokenReference: "
                                + e.getMessage());
                    }
                }
            } catch (WSSecurityException e) {
                throw new InvalidSecurityTokenReference("WSSecurityException while trying to dereference a <SecurityTokenReference>: " + e.getMessage());
            }
        }
        return null;
    }
View Full Code Here

                        throw new ElementParsingException("WSSecurityException while trying to create a SecurityToken object from a SecurityTokenReference: "
                                + e.getMessage());
                    }
                }
            } catch (WSSecurityException e) {
                throw new InvalidSecurityTokenReference("WSSecurityException while trying to dereference a <SecurityTokenReference>: " + e.getMessage());
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.ws.sandbox.security.trust2.exception.NoSoapBody

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.