This file contains hidden or 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
public static String buildSoapLogin(String username, String password) { | |
def builder = new StreamingMarkupBuilder() | |
builder.encoding = 'UTF-8' | |
def soapEnv = builder.bind { | |
mkp.xmlDeclaration() | |
mkp.declareNamespace(soapenv: SOAP.SOAP11_NS) | |
mkp.declareNamespace(tns: 'urn:partner.soap.sforce.com') | |
mkp.declareNamespace(ens: 'urn:sobject.partner.soap.sforce.com') | |
'soapenv:Envelope' { | |
'soapenv:Header' { |
This file contains hidden or 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
package com.example; | |
import org.apache.commons.lang.NullArgumentException; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.IOException; |
This file contains hidden or 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
/*** | |
Adapted from the great Dan Appleman. | |
For more on this and many other great patterns - buy his book - http://advancedapex.com/ | |
This class can be used to schedule any scheduled job without risk of locking the class. | |
DO NOT CHANGE THIS CLASS! It is locked by the scheduler. Instead make changes to ScheduledHelper or your own IScheduleDispatched class | |
To use: | |
1) Create a new class to handle your job. This class should implement ScheduledDispatcher.IScheduleDispatched | |
2) Create a new instance of ScheduledDispatcher with the type of your new class. | |
3) Schedule the ScheduledDispatcher instead of directly scheduling your new class. | |
See ScheduledRenewalsHandler for a working example. |
NewerOlder