Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.paypal.base.soap;
 
SignatureSOAPHeaderAuthStrategy is an implementation of com.paypal.base.AuthenticationStrategy which acts on com.paypal.base.credential.SignatureCredential and retrieves them as SOAP headers
public class SignatureSOAPHeaderAuthStrategy implements
	}

Returns:
the thirdPartyAuthorization
	}

Parameters:
thirdPartyAuthorization the thirdPartyAuthorization to set
			ThirdPartyAuthorization thirdPartyAuthorization) {
		this. = thirdPartyAuthorization;
	}
		String payLoad = null;
			payLoad = tokenAuthPayLoad();
else if ( instanceof SubjectAuthorization) {
			payLoad = authPayLoad(credential,
else {
			payLoad = authPayLoad(credentialnull);
		}
		return payLoad;
	}
	private String tokenAuthPayLoad() {
		StringBuilder soapMsg = new StringBuilder();
		soapMsg.append("<ns:RequesterCredentials/>");
		return soapMsg.toString();
	}
	private String authPayLoad(SignatureCredential credential,
			SubjectAuthorization subjectAuth) {
		StringBuilder soapMsg = new StringBuilder();
		soapMsg.append("<ns:RequesterCredentials>");
		soapMsg.append("<ebl:Credentials>");
		soapMsg.append("<ebl:Username>" + credential.getUserName()
"</ebl:Username>");
		soapMsg.append("<ebl:Password>" + credential.getPassword()
"</ebl:Password>");
		soapMsg.append("<ebl:Signature>" + credential.getSignature()
"</ebl:Signature>");
		if (subjectAuth != null) {
			soapMsg.append("<ebl:Subject>" + subjectAuth.getSubject()
"</ebl:Subject>");
		}
		soapMsg.append("</ebl:Credentials>");
		soapMsg.append("</ns:RequesterCredentials>");
		return soapMsg.toString();
	}
New to GrepCode? Check out our FAQ X