Last active
December 25, 2015 19:39
-
-
Save edubriguenti/7029225 to your computer and use it in GitHub Desktop.
Basic Authentication WebService
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
Authenticator.setDefault(new Authenticator() { | |
@Override | |
protected PasswordAuthentication getPasswordAuthentication() { | |
return new PasswordAuthentication( | |
Properties.obterPropertiesEndPoint().readString(Constantes.ENDPOINT_PESSOAS_USERNAME), | |
descriptografarSenha(Properties.obterPropertiesEndPoint().readString(Constantes.ENDPOINT_PESSOAS_PASSWORD)).toCharArray()); | |
} | |
}); | |
soap11 = new ContratoIntegrationServiceSoap11 (new URL(Properties.obterPropertiesEndPoint().readString(Constantes.ENDPOINT_CONTRATOS)), | |
new QName(QNAME_1, QNAME_2) | |
); | |
proxy = soap11.getContratoIntegrationServiceSoap11SOAP(); | |
((BindingProvider)proxy).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, Properties.obterPropertiesEndPoint().readString(Constantes.ENDPOINT_PESSOAS_USERNAME)); | |
((BindingProvider)proxy).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, descriptografarSenha(Properties.obterPropertiesEndPoint().readString(Constantes.ENDPOINT_PESSOAS_PASSWORD))); | |
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,Properties.obterPropertiesEndPoint().readString(Constantes.ENDPOINT_PESSOAS)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment