In this post I will explain what a property set is, how it looks and how to build a property set using eScript.
Property set is a set of data containing Type, Property and Value. It is stored in a form of XML. For example, when you write a business service a script under Service_PreInvokeMethod and Inputs to this is a property set and it could something like this.
<Inputs status=”Active” Type=”Credit Request”/>
Where Inputs is a Type, status=”Active” is a property name-value pair and so is Type=”Credit Request”. This propertyset has no value.
Lets see another property set.
<UsernameToken xmlns=”http://siebel.com/webservices”>SADMIN</UsernameToken>
Here UsernameToken is a property type, xmlns=”http://siebel.com/webservices” is property name-value pair and SADMIN is a property value.
Using eScript we can build propertyset. Lets try to build a property set that looks something like this.
<SOAP-ENV:Header>
<UsernameToken xmlns=”http://siebel.com/webservices”>SADMIN</UsernameToken>
<PasswordText xmlns=”http://siebel.com/webservices”>SADMIN</PasswordText>
<SessionType xmlns=”http://siebel.com/webservices”>Stateless</SessionType>
</SOAP-ENV:Header>
The above XML code is a SOAP header normally used with webservices. The above whole code is one single property set having three child propertysets UsernameToken, PasswordText and SessionType.
The script to build this whole propertyset is here below.
//Initialize a propertyset
var soapHeader = TheApplication().NewPropertySet();
//This sets the type-Builds line 1 and 5
soapHeader.SetType(”SOAP-ENV:Header”);
var UsernameToken = TheApplication().NewPropertySet();
var PasswordText = TheApplication().NewPropertySet();
var SessionType = TheApplication().NewPropertySet();
//This builds line 2
UsernameToken.SetType(”UsernameToken”);
UsernameToken.SetProperty(”xmlns”,”http://siebel.com/webservices”);
UsernameToken.SetValue(”SADMIN”);
//This builds line3
PasswordText.SetType(”PasswordText”);
PasswordText.SetProperty(”xmlns”,”http://siebel.com/webservices”);
PasswordText.SetValue(”SIEB2008″);
//This builds line4
SessionType.SetType(”SessionType”);
SessionType.SetProperty(”xmlns”,”http://siebel.com/webservices”);
SessionType.SetValue(”Stateless”);
//Add lines 2,3 and 4 as child of line 1
soapHeader.AddChild(UsernameToken);
soapHeader.AddChild(PasswordText);
soapHeader.AddChild(SessionType);
Hope this helps in understanding the representation of propertysets and how it is stored. Leave your comments.
Related posts(Auto Generated):





September 19th, 2008 at 2:46 pm
wonderful scripting suggestions to newbies!!!
November 4th, 2008 at 12:59 pm
It was really helpul..
March 23rd, 2009 at 12:11 am
Hey Sridhar,
Its one of the most simplets way to undesrstand property sets.
Thanks,
Varun
May 1st, 2009 at 3:53 am
Shridhar,
This is very helpful and explains clearly even to a beginer like me.thanks a lot!!!
May 1st, 2009 at 6:05 pm
you are welcome.
October 16th, 2009 at 5:00 pm
Thanks Sridhar, this is very helpful to understand property set’s representation. Nice explanation!!
January 19th, 2010 at 8:29 am
Hey,
Thats really nice approach to make things easy.Thanks a lot!
February 28th, 2010 at 11:52 am
Very Excellent yaar.
i didnt know the basic concept of this though i am writing the script for years. Blindly we used to set the property or AddChild etc. to the propery set variable.
Thanks alot for elucidating th concept.
Best Regards
Mahesh
May 21st, 2010 at 9:06 am
really nice
bookshelf should be something like this man instead all it does is to complicate stuff in my head