Search This Blog

Adding Header in BPM and BPEL - REST Service

Adding Header in  BPM and BPEL - REST Service


   For setting headers in REST service no need of any entry in composite.xml. Only for SOAP service   we have to make entry in composite.xml



  Properties :    rest.binding.http.<<Custom Header Name >>

  Example   :    rest.binding.http.username



    BPM Service setting header - Service Properties


 BPM Service setting header - Message Headers


 
BPEL Service getting header -  Receive activity in .BPEL


OPENLDAP configuration in Weblogic

OPENLDAP configuration in Weblogic


Step 1: OpenLDAP Installation


Refer below URL for openLDAP installation


http://www.userbooster.de/en/support/feature­articles/openldap­for­windows­installation
.aspx



Step 2 : Create two files under


C:\OpenLDAP\ldifdata


File One Name :  FileOne.ldif

## DEFINE DIT ROOT/BASE/SUFFIX  ####
## uses RFC 2377 format
## replace maxcrc and com as necessary below
## or for experimentation leave as is


## dcObject is an AUXILLIARY objectclass and MUST
## have a STRUCTURAL objectclass (organization in this case)
# this is an ENTRY sequence and is preceded by a BLANK line


dn: dc=maxcrc,dc=com dc: maxcrc
description: My wonderful company as much text as you want to place objectClass: dcObject
objectClass: organization o: Maxcrc, Inc.

## FIRST Level hierarchy - people
## uses mixed upper and lower case for objectclass
# this is an ENTRY sequence and is preceded by a BLANK line


dn: ou=people, dc=maxcrc,dc=com ou: people
description: All people in organisation objectclass: organizationalunit

## SECOND Level hierarchy
## ADD a single entry under FIRST (people) level
# this is an ENTRY sequence and is preceded by a BLANK line
# the ou: Human Resources is the department name


dn: cn=Robert Smith,ou=people,dc=maxcrc,dc=com objectclass: inetOrgPerson

cn: Robert Smith cn: Robert J Smith cn: bob  smith
sn: smith uid: rjsmith userpassword: rJsmitH carlicense: HISCAR 123
homephone: 555-111-2222 mail: r.smith@example.com mail: rsmith@example.com mail: bob.smith@example.com description: swell guy
ou: Human Resources


Run following commands in cmd :

>>> C:\OpenLDAP\ClientTools
ldapmodify.exe -a -x -h localhost -p 389 -D "cn=manager,dc=maxcrc,dc=com" -f
C:\OpenLDAP\ldifdata\FileOne.ldif -w secret


File Two Name : FileTwo.ldif


## SECOND Level hierarchy
## ADD a single entry under FIRST (people) level
# this is an ENTRY sequence and is preceded by a BLANK line
# the ou: Human Resources is the department name


dn: cn=krishna moorthi,ou=people,dc=maxcrc,dc=com objectclass: inetOrgPerson
cn: krishna moorthi cn: P krishna
cn: moorthi sn: kris
uid: krishna
userpassword: SomePassword carlicense: HISCAR 123 homephone: 555­111­2222
mail: panji.pratomo555@gmail.com mail: panji.pratomo555@mysamz.com mail: panji_pratomo555@yahoo.com description: football maniac
ou: SOA




Run following commands in cmd :

>>> C:\OpenLDAP\ClientTools
ldapmodify.exe -a -x -h localhost -p 389 -D "cn=manager,dc=maxcrc,dc=com" -f
C:\OpenLDAP\ldifdata\FileTwo.ldif -w secret










Step 3: Open Jxplorer ( LDAP Browser )


Now you can able to see user created in OpenLDAP. Enter following details :
Host Name :    ServerName   ( Ex: localhost ) Port             :    389
Base DN     :     dc=maxcrc,dc=com
Level           :     Anonymous








Step 4 : Configure OpenLDAP in weblogic console


weblogic console Security Relams MyRealms   providers Authentication


Click New Enter LDAP Name ( Ex : KrishnaLDAP )






Click KrishnaLDAP change control flag to Sufficient





Host Name      : localhost
Port                 : 389
User base DN :  ou=people, dc=maxcrc, dc=com





Note : Restart weblogic Server

 

Python simple and easy to learn

Python simple and easy to learn


from math import pi

check_data=True
check_value = True
check_sample =True
letters="Hello Krishna"
numbers = [6,7,8]
if check_data:
  print ("Hello World" "  " "Moorthi")
  if check_sample:
    print ("Hello Moorthi")
 
if check_value == False:
 print ("I am in False")
elif check_value == True:
 print ("I am in \n True")
else:
 print ("Checking")


for char in letters:
  print (char)
total=0
for num in numbers:
  total = total + num

  print ("Total : ",total)
for test in numbers:
  pass


def krishnaMethod():
  """ Documentation """
  print ("I am inside method ",min(numbers))
 
krishnaMethod()


def greet(*names, msg = "Good morning!"):
   """
   This function greets to
   the person with the
   provided message.

   If message is not provided,
   it defaults to "Good
   morning!"
   """
   for name in names:
    print("Hello",name + ', ' + msg)

greet("Kate","krishna","Moorthi")
greet("Bruce",msg="How do you do?")
print("Pi Value : ",pi)

 
while True:
  try:
    validnumber=int(input("Please eneter number :"))
    break
  except:
    print("Invalid data")
   
 

Output:

Hello World  Moorthi
Hello Moorthi
I am in 
 True
H
e
l
l
o
 
K
r
i
s
h
n
a
Total :  6
Total :  13
Total :  21
I am inside method  6
Hello Kate, Good morning!
Hello krishna, Good morning!
Hello Moorthi, Good morning!
Hello Bruce, How do you do?
Pi Value :  3.141592653589793
Please eneter number : 3

Simple Python Program to Write and read xml file

Simple Python Program to Write and read xml file
import os
import xml.dom.minidom

dirs = os.listdir()
ListofFileNames = []
for filename in dirs:
  print ("List of files : ",filename)
  ListofFileNames.append(filename)

print("Files Names : ",ListofFileNames)
print("Current Dir : ",os.getcwd())

filecomposite= open("Composite.xml","w+")
filecontent ='<note><to>Tove</to><from id="12345">Jani</from><heading>Reminder</heading><body>Don forget me this weekend!</body></note>'
filecomposite.write(filecontent)
filecomposite.close()

f=open("Composite.xml", "r")
if f.mode == 'r':
  contents =f.read()
  print (" File contents  :  ",contents)

def readxmltags():
  doc = xml.dom.minidom.parse("Composite.xml")
  elementValues = doc.getElementsByTagName("from")

 
  for elementvalue in elementValues:
        print("I am inside method - From element value : ",elementvalue.firstChild.data)
        attributeValue = elementvalue.getAttribute("id")
        print("Attribute values : ",attributeValue)
readxmltags()




Output :

List of files :  Composite.xml
List of files :  .bash_logout
List of files :  .profile
List of files :  .bashrc
List of files :  .pylint.d
List of files :  _test_runner.py
Files Names :  ['Composite.xml', '.bash_logout', '.profile', '.bashrc', '.pylint.d', '_test_runner.py']
Current Dir :  /home/runner
 File contents  :   <note><to>Tove</to><from id="12345">Jani</from><heading>Reminder</heading><body>Don forget me this weekend!</body></note>
I am inside method - From element value :  Jani
Attribute values :  12345