Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ns2="http://oracle.apps.ctb.cdapersistence.types">
- <env:Header>
- <ns1:Security>
- <ns1:UsernameToken>
- <ns1:Username>weblogic</ns1:Username>
- <ns1:Password>password</ns1:Password>
- </ns1:UsernameToken>
- </ns1:Security>
- </env:Header>
- <env:Body>
- <ns2:PersistCDADocumentRequest>
- <ns2:Document/>
- </ns2:PersistCDADocumentRequest>
- </env:Body>
- </env:Envelope>
- Map<String, Object> requestContext = ((BindingProvider) cDAPersistenceServicePortType).getRequestContext();
- requestContext.put(BindingProvider.USERNAME_PROPERTY, "weblogic");
- requestContext.put(BindingProvider.PASSWORD_PROPERTY, "password");
- Map<String, Object> requestContext = ((BindingProvider) cDAPersistenceServicePortType).getRequestContext();
- Map<String, List<String>> headers = new HashMap<String, List<String>>();
- headers.put("Username", Collections.singletonList("weblogic"));
- headers.put("Password", Collections.singletonList("password"));
- requestContext.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
- @Generated("Oracle JDeveloper")
- public static void setPortCredentialProviderList(Map<String, Object> requestContext) throws Exception {
- // TODO - Provide the required credential values
- String username = "weblogic";
- String password = "password";
- credList.add(getUNTCredentialProvider(username, password));
- requestContext.put(WSSecurityContext.TRUST_MANAGER, new TrustManager() {
- public boolean certificateCallback(X509Certificate[] chain, int validateErr) {
- // boolean result =
- // (chain != null && chain.length > 0) && (chain[0].equals(serverCert) || chain[0].equals(clientCert));
- // return result;
- return true;
- }
- });
- credList.add(getSAMLTrustCredentialProvider());
- requestContext.put(WSSecurityContext.CREDENTIAL_PROVIDER_LIST, credList);
- }
- @Generated("Oracle JDeveloper")
- public static CredentialProvider getUNTCredentialProvider(String username, String password) {
- return new ClientUNTCredentialProvider(username.getBytes(), password.getBytes());
- }
- @Generated("Oracle JDeveloper")
- public static CredentialProvider getSAMLTrustCredentialProvider() {
- return new SAMLTrustCredentialProvider();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement