Skip to content

Instantly share code, notes, and snippets.

View skenderbeu's full-sized avatar

Peter Campbell skenderbeu

View GitHub Profile
public void createDomesticShipment( utcdatetime _shipmentDate,
SalesTable _salesTable,
str _noOfParcels = "1"
)
{
RoyalMail.shippingAPIPortTypeClient serviceClient;
RoyalMail.createShipmentRequest shipmentRequest;
RoyalMail.createShipmentResponse shipmentResponse;
private ZoomFSRoyalMail.RoyalMail.shippingAPIPortTypeClient getRMServiceClient()
{
CLRObject clientType;
RoyalMail.shippingAPIPortTypeClient serviceClient;
RoyalMail.EndPointBehaviour endPointBehaviour;
System.ServiceModel.EndpointAddress endpointAddress;
private RoyalMail.SecurityHeaderType getSecurityHeaderType(RecId _recId = 0)
{
RoyalMail.SecurityHeaderType securityHeaderType = new RoyalMail.SecurityHeaderType();
str passwordDigest;
str userName;
System.Byte[] hashedPassword;
System.Byte[] digest;
str concatednatedDigestInput;
str encodedNonce;
private System.Xml.XmlDocument getSecurityHeaderXML(str _username, str _passwordDigest,
str _encodedNonce, str _creationDate)
{
System.Xml.XmlDocument xDoc;
System.Xml.XmlNode xmlRoot;
System.Xml.XmlElement securityElement;
System.Xml.XmlElement usernameTokenElement;
System.Xml.XmlElement usernameElement;
System.Xml.XmlElement passwordElement;
System.Xml.XmlElement nonceElement;
private System.Byte[] getSHA1(Str _input)
{
System.Security.Cryptography.SHA1Managed sha1Managed;
System.Text.Encoding encoding;
System.Byte[] bytes;
str errorMessage;
try
{
sha1Managed = new System.Security.Cryptography.SHA1Managed();
private int getRandomInt()
{
int randomNumber;
RandomGenerate randomGenerate;
randomGenerate = RandomGenerate::construct();
randomGenerate.parmSeed(new Random().nextInt());
randomNumber = RandomGenerate.randomInt(0, 9); // get a random integer between 0 and 9 inclusive
private str getNonce(RecId _recId)
{
str nonce;
System.Random random = new System.Random();
System.Int32 randomNumber = random.Next();
if(_recId > 0)
{
private RoyalMail.integrationHeader getIntegrationHeader(str _identifier)
{
RoyalMail.integrationHeader integrationHeader;
RoyalMail.identificationStructure identificationStructure;
identificationStructure = new RoyalMail.identificationStructure();
identificationStructure.set_applicationId(this.parmRMTTApplicationID());
identificationStructure.set_transactionId(strFmt("%1", _identifier));
public void createShipment( utcdatetime _shipmentDate,
SalesTable _salesTable,
str _noOfParcels = "1"
)
{
RoyalMail.shippingAPIPortTypeClient serviceClient;
RoyalMail.createShipmentRequest shipmentRequest;
RoyalMail.createShipmentResponse shipmentResponse;
public interface IZip
{
void SetZipFileName(string zipfileName);
void SetFilesToZip(List<string> files);
void CreateArchive();
}