Skip to content

Instantly share code, notes, and snippets.

View venkyvb's full-sized avatar

Venki Balakrishnan venkyvb

View GitHub Profile
@venkyvb
venkyvb / CustomerQueryByContactPerson
Created September 12, 2012 17:48
CustomerQueryByContactPerson - Payload
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global">
<soapenv:Header/>
<soapenv:Body>
<glob:CustomerByElementsQuery_sync>
<CustomerSelectionByElements>
<SelectionByContactPersonWorkplaceEmailURI>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryEmailURI>...emailid...</LowerBoundaryEmailURI>
</SelectionByContactPersonWorkplaceEmailURI>
@venkyvb
venkyvb / A2XCall.java
Last active March 16, 2016 13:16
Consume A2X services using HTTP client. Dependencies: - Apache HTTPClient - Velocity Template - the usual apache dependencies like commons No proxy / stubs are generated, payload is created using velocity and plain HttpPost is used to make the SOAP call. Since velocity template is used extension fields can be handled easily. NOTE that this is on…
package a2x;
import java.io.StringWriter;
import java.io.Writer;
import java.net.URI;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.util.Iterator;
@venkyvb
venkyvb / ODataReadMetadata.py
Created November 1, 2015 02:21
Python OData Read Metadata
import urllib2, base64
username = "user_name_here"
password = "password_here"
request = urllib2.Request("https://myNNNNNN.crm.ondemand.com/sap/c4c/odata/v1/c4codata/$metadata")
base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
request.add_header("Authorization", "Basic %s" % base64string)
result = urllib2.urlopen(request)
content = result.read()
@venkyvb
venkyvb / SOAPTest.java
Created December 13, 2015 01:08
SAP Cloud for customer CustomerQueryByElements Sample
package main.java.venkyvb.soap;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
@venkyvb
venkyvb / samplerest.js
Created November 7, 2016 07:11 — forked from joshbirk/samplerest.js
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')

Keybase proof

I hereby claim:

  • I am venkyvb on github.
  • I am venkyvb (https://keybase.io/venkyvb) on keybase.
  • I have a public key whose fingerprint is 33D8 289D 6137 9195 5941 1937 C7F8 EA0B 4DF9 B40B

To claim this, I am signing this object:

@venkyvb
venkyvb / index.js
Created June 26, 2017 06:20 — forked from JonathanMH/index.js
JSON Web Token Tutorial: Express
// file: index.js
var _ = require("lodash");
var express = require("express");
var bodyParser = require("body-parser");
var jwt = require('jsonwebtoken');
var passport = require("passport");
var passportJWT = require("passport-jwt");
@venkyvb
venkyvb / odp_integration.md
Created December 8, 2017 04:09
Using SAP Hybris Cloud for Customer Operational Data Provisioning API (payload samples)

Operational Data Provisioning (ODP) payload examples

This document outlines some example payloads for using ODP (Operational Data Provisioning) API to pull data from SAP Hybris Cloud for customer (SAP Hybris C4C) system to non-BW systems. For integration with SAP NetWeaver Business Warehouse systems refer to the help documentation.

Configuring your tenant to enable ODP

Please refer to the help documentation that outlines the steps needed to set-up ODP in your SAP Hybris C4C tenant.

Operational Call Sequence

GetList -> GetDetails -> FetchDataDirect

@venkyvb
venkyvb / nbody.py
Created January 2, 2018 18:04
n-body simulation (Astrophysics)
from visual import *
from time import clock
from random import random,uniform
import numpy
import math
# Sets up a bunch of masses and lets them move under the influence of their
# mutual gravity.
# Masses are put in random positions within a sphere originally. An additional
# force is applied which simulates an equal density distributed over the
package com.example.jersey;
import javax.net.ssl.*;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.Configuration;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.CertificateException;