Thursday, November 6, 2008

In Hyderabad now

Well its been a long time since i did a post on my blog...
the reason is nothing more then laziness...
I relocated to Hyderabad in August and then it took around a month to find a place to stay and another 7 days or so to figure out an internet provider. By the time i got it all sorted out i kind of lost touch with the blog. And then came a lot of changes in the personal life and hence another month or so without finding the so called "Time".
So much changed in the world during these past 3 months. To begin with America got Obama as new president, Lehman brothers filed bankruptcy, World economy took a downward spiral, Stock markets crashed, Nuclear deal between India and US got signed and the list goes on....But the most important to me personally was that i relocated to Hyderabad from Bangalore.
Now when i relocated i had high hopes from this city but seems like the expectations i had were too high :).
Here are a few positives and negatives of the city which i experienced in past 3 months....
Positives first :-
1) Wide roads :- Well the roads are too wide according to the indian standards. At some places it seems like a 6 lane road with 3 lanes both ways.
2) Lots of flyovers :- Yeah there are tons of flyovers in the city and it kind of reminds me of Seattle on a small scale though :)
3) Less traffic :- The traffic is too less compared to Bangalore. There are in the heart of the city however if you decide to stay a bit out of the main city the traffic congestion won't find you :)
4) Nice places to hang out :- There are a whole lot of places near Hussein Sagar Lake to hang out like eat street, water front restaurant, Snow world, Prasada's IMax, Birla Temple etc.
5) Cheap movie tickets :- The min. price of a movie ticket is 35 Rs. (Platinum class or Balcony) in talkie town, the multiplex right next to the place i stay in hyderabad.
Now the negatives :-
1) When people drive in Hyderabad they become "TERRORISTS". Better concentrate while you are on the road. Anyone and everyone out there in the vehicles is planning to hurt you. I got 2 autos banged into my feet while i was standing besides the road waiting for a bus and a car almost killed me while i was crossing the road from a zebra crossing
2) Autos :- If you are living outside the city as in my case, the autos don't have a meter and the fare is decided by the kind of clothes you're wearing and the language you use to communicate with the driver
3) Dhols :- Well people in my part of the city keep celebrating something almost every week and hence play dhol ( An indian instrument which resembles to a drum) right till mid night thus ensuring you can't sleep early and go to work with a headache the next week. (Yeah you get a hangover even if you don't party :P)
4) Dust :- Though the most of the city is clean there's lot of dust and dust storms which will keep one busy if he/she has a dust allergy.
5) Expensive :- The city is expensive if people can figure out that you are into IT :D

So that's what's going on personally.....

Professionally i've started working on some new cool stuff. I'll post some interesting stuff in days to come and try to be more regular on this space....

~Abhishek

Thursday, July 31, 2008

Nice reads...

For those people who are from CBSE board and are looking for the text books currently in the syllabus here's a great link Books. One can read online any book from the syllabus and prepare for the exam or recall the old days like i will by reading all the history books ;-)

~Abhishek

Nice search engine....

After a long time i have hit a cool search engine concept i.e. Cuil . The engine claims that they have indexed 3 times more pages then Google and 10 times more then Microsoft which i would like to believe but somehow my blog doesn't feature in the results :). As off now results apart, the concept of Categories introduced in the results is good.
I wish them all the best in challenging google and live search. This might take search to its next level where it can be more intuitive then just a set of dumb results....
~Abhishek

Tuesday, July 1, 2008

Dilbert and Dan

I must admit that i am a big fan of Dilbert and have read 2 books from Scott on how to weasel your way out in a corporate.
Recently i found a blog http://my25percent.blogspot.com/ and its an interesting blog which catches many of the trends in IT world...
Nice read of software engineers i must say :)...

~Abhishek

Saturday, June 28, 2008

Go Audio....

I found an interesting utility to convert the blogs to audio. It can be found on odiogo.com.
All one needs to do in order to make the blog an audio blog is to subscribe to the service with the url feed of the blog. Its simple to sign up as well. All one needs to do it to provide e-mail address and blog url to the site and a consent to convert all the content on the blog to voice format.
There are a couple of features missing in this utility though
1) It can't convert non english blogs to voice. (I can understand that it would be hard to globalize such a utility).
2) Ability to filter out certain posts to be converted to audio. (I miss this since i had to take a couple of non English posts out of my blog to enable my posts to be accessible through odiogo).

A good lesson i learnt while checking this utility is the way i have lost all the punctuations like ",", ".", "!" etc. in my writing skills. The audio version of my earlier posts might not be as interesting to listen since the automated reader used by this utility really depends a lot on this stuff to hook up the listener. Anyways, i would try to be more careful later on.....

~Abhishek

Tuesday, June 17, 2008

Clustering patterns

As usually is the case in most of the software problems we have identified patterns which solve the most common known problems. Similarly we have patterns for know problems in case of availability and performance as well.

There are 2 well known patterns for clustering which i would discuss in this post

1) Load Balanced Clustering

Any application server runs on a piece of software which is running on a piece of hardware. Which basically means that the server definitely has a performance threshold after which the performance would fall below expectations of the client. Even if we take the world's most advanced hardware it would have a limit to number of requests which it can server for a given piece of software. Once the number of requests increase over this number the server has to be scaled up (Not possible in this case as we already are on most advanced piece of hardware) or scaled out (Feasible option). To scale out an application running on such hardware we can add some more servers and cluster them using a load balancer.

The load balancer would act as the virtual resource to the clients and redirect the requests to appropriate physical servers lying behind it. So the network would look like the following...





The load balancer can delegate the requests to various servers based on various algorithms like
a) Round Robin :- Every one gets equal amount of requests
b) Weighted Round Robin :- A certain weightage given to servers based on hardware configuration by the administrator. The Load Balancer can decide based on these weightages to redirect the incoming requests to appropriate server
c) Least Connection :- Whichever server is serving the least connections gets the next request
d) Load Based :- Whichever server has the least load gets the next request

Normally a load balancer is intelligent enough to detect the failures of a particular server in the network and can stop sending requests to the failed node.
One of the interesting thing which goes down to the level of application design if we plan to deploy our application on a load balanced cluster is the state management. Normally applications store the Session information in the container provided objects (Session object in ASP.NET), now by default these session objects reside in the memory of the application server on which the request has been processed. In case the next request goes to a different server node in the cluster that node will have no clue about the session state stored in the memory of a different server in the cluster and important data might be lost in this case.
There can be 3 solutions to this problem
a) Use a external state server or state service to store the session object
b) Use an algorithm on the load balancer such that a request coming in the same session context always gets redirected to the same node in the cluster. (Server Affinity)
c) Ask each server to broadcast the session state in the whole . (Asynchronous Session state management ). This would be a cheap solution however with lot of network chaos inside the cluster.

Now one of the important questions which remains is to define what exactly is this load balancer. Basically it can be a piece of Software (Installed on one of the servers in the cluster) or Hardware (Special routers with intelligence for load balancing) which act as the gateway to the external world.
This kind of clustering is a good choice to meet the non functional requirements for high availability and Scalability

2) Failover Clustering

Some applications have a major requirement in terms of availability. e.g. the application can't go down even for an upgrade/patching. In such a case we can go for a configuring a failover cluster. In this pattern the idea is that a standby server is waiting to take over the primary server in case it goes down due to some reasons.
To detect that the server has gone down there can be 2 ways
a) Pull Heartbeat :- The standby server keeps checking the availability of primary server after a specified interval. In case it finds that the sever is not responding it assumes that the primary server is down and takes over the job and starts working on requests.
b) Push Heartbeat :- In this case the primary server keeps telling the standby server that its up. If the secondary server doesn't receive the heartbeat for a specified period of time it takes over the job and starts processing the requests.

In either cases before the standby server starts processing the requests it needs to synchronize with the primary server in order to be in exact same state so as to honour any open sessions/ transactions. Here are the strategies which can be used to do the same
a) Transaction Log :- Everytime the state of the primary server changes it logs the change in a transaction log. The log is synchronized with the standby server periodically and it brings itself into the same state as primary server. As soon as secondary server finds out that it has to take over it synchronizes with the latest transaction log so as to come into the same state in which primary server was before it went down. Now it is ready to take over and serve the requests....
b) Hot Standby :- In this strategy any change in the state of primary server is immediately sent to the secondary server to copy. The advantage is that as soon as the primary goes down the secondary can take over without any delay.
c) Shared Storage :- The state of both the servers is maintained on a external storage device. So it is as good as Hot Standby. It can be more or less performant based on how we synchronize the state in Hot Standby case and how responsive the is the external device to store/retrieve the state.

Another important aspect of this pattern is determining the active server. If multiple servers in a cluster assume that they are the active servers then unexpected behaviors like deadlock and data corruption may occur.

It is very important to design the cluster in such a way that we do not loose the performance. Additionally it might be a bit costly since standby server is normally not used unless there's a failure of primary one.

Now that i have summarized the 2 clustering patterns in this post the next logical step would be to setup an IIS cluster for each pattern. It should result in a new post in this series :). Here's what i plan to do ....
1) Have 2 IIS Servers on a network
2) Install a single ASP.NET Hello World applcation on it
3) Configure a Failover cluster between the 2 IIS instances and test that it works
4) Configure a software load balancing cluster and test that it works (May need a load runner kind of tool to simulate many requests).

~Abhishek



Thursday, June 12, 2008

Non functional requirements like Availibility,Scalability...

Any application being built in today's world has lot of non functional requirements. 2 of the non functional requirements are Availability and Scalability.
Availability is the ability of the sysytem to serve the requests of the users for the measurable amount of time. It is a major factor when the software is deployed in a production environment. Lots of business processes will depend on the availability of the system and if the system is unavailable then it is more often then not loss to the customer using the system. If the application is a e-biz. application then its a direct loss of money while if application is something else then its a loss in productivity and hence indirect loss of money to the customer.
In a SaaS scenario availability will be of even more concern since downtime of the service may translate into the breach of a legal contract between provider and consumer of the service and can result in bigger losses for the provider of the service.
Scalability of a system can be defined as ability of the system to be able to serve the increasing demands of the system while stealing maintaining the acceptable performance levels. Once a system is online and is a success then its but natural that the it would be used by more and more people and hence it is but natural that the system would have to handle the increasing demands.
Now a system can either be Scaled Up or Scaled Out based on the increasing demands. Scaling Ua system would normally mean increasing the hardware (memory/ more processors) of the server to enable it to perform faster. Scaling Out a system would normally mean that we increase the number of servers in the landscape and try to meet the performance standard with more servers.

I believe These 2 non functional requirements will be affecting the design application .
How is something i will try to figure out and may be post it in a different post.

Clustering is a solution to meet these non functional requirements. Basically clustering is nothing but to present a group of physical servers to the client as 1 virtual resource. The requests coming from the clients to this virtual resource can be redirected to the physical servers based on various algorithms.
A logical view of such an arrangement would look something like this..


So the above picture basically depicts that we have a cluster of server 1 and server 2 which is handling requests from client based on some kind of request routing done by the virtual resource.

There are various ways of configuring a cluster based on what kind of requirements we have. I'll look into them and post on a different post....

~Abhishek

Wednesday, June 11, 2008

Clustering !!!!

Clustering has always been a term to me rather then a topic. A few days back while having a discussion about application availability, scalability and performance i suggested clustering as a solution.
However i myself was and am not sure of what topic could this term possibly unearth for me.
So after avoiding to read on this topic for around 2 weeks now finally i decided to blog it as an action item.
I'll be reading about clustering soon and would come up with a post or 2 with the label Clustering (And added labels as required for the topics the term unearths for me)

~Abhishek

Thursday, May 29, 2008

Implementing logic in the proxy and consuming the service in .NET

First the good news :)
I managed to create the service and was able to consume it from .NET.
Here were the open questions from the last post....
1) How to write some logic in the server proxy
2) Where and how to find the wsdl with binding information so that i can consume it from .NET

In order to write the logic into proxy i went to the package in which i generated the proxy. In that package i found that an interface has been generated for the message interface we generated in ESR and a class to implement the interface. I found the method instance method of the class and went ahead editing the method implementation. My first unassisted ABAP code. Here's how it looked like....


OUTPUT-GET_EMPLOYEE_OUTPUT-ID = INPUT-GET_EMPLOYEE_INPUT.
OUTPUT-GET_EMPLOYEE_OUTPUT-NAME-FIRST_NAME = 'Abhishek'.
OUTPUT-GET_EMPLOYEE_OUTPUT-NAME-LAST_NAME = 'Kumar'.


Once done i went to the transaction SOAMANAGER. This is the new transaction which replaces the transactions WSADMIN and WSCONFIG. This opened a webdynpro UI with a tab Business Administration on which there's a link Web Service Administration. There i can search for the design time component i want to configure. (EmployeeService) in my case. Once selecting the service i can go to Configurations tab where i select to Create a Service. I can choose a name for the service and binding. Whatever i choose here appears in the final wsdl as service and binding. Once done I can choose a type of authentication. I chose http authentication. and saved the configuration.

On the same page i found the link to the wsdl with all the binding and port information. On having a look at the wsdl i confirmed that binding and service tags are available.
Copy the link to the wsdl and try setting the reference to this wsdl in Visual Studio. Once done i am able to call the service easily from .NET.

Now the second question which was how to add more then one operation to the Message Interface. This is a limitation in 700 release of BASIS. And unfortunately the sandbox system has a 700 release of BASIS. According to some documentation i found i can add more then 1 operations in the message interface. So i parked it for the time being.....

~Abhishek

PS :- This was my hello world to the world of ABAP. i.e. a first program in ABAP. This post is the last in the series of blogs i started on May 23rd 2008 :)

Tuesday, May 27, 2008

Generating a Proxy

Here's what i did next. I just added a message interface called EmployeeService in the Message interfaces of my . I marked it as inbound synchronous method in the option. I couldn't find much documentation about what the various options mean however i assume that inbound means inbound message coming from client to the server and synchronous means that server would process them and give the results back to client then and there itself.
Now i selected the input and output messages and there you go . I got a nice wsdl which looks like the following....

<?xml version="1.0" encoding="ISO-8859-1"?>

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:p1="http://sap.office.tst" name="EmployeeService" targetNamespace="http://sap.office.tst">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sap.office.tst" targetNamespace="http://sap.office.tst">
<xsd:element name="GetEmployeeInput" type="EmployeeId" />
<xsd:element name="GetEmployeeOutput" type="Employee" />
<xsd:simpleType name="EmployeeId">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
a64268c22be811dda00f000bcd9b93dd
</xsd:appinfo>
</xsd:annotation>
<xsd:restriction base="xsd:string" />
</xsd:simpleType>
<xsd:complexType name="Employee">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
a644d9c02be811dd90e2000bcd9b93dd
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="Id" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
4ca5845028aa11ddb1c2001321f4509b
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="Name" type="Name">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
4ca5845128aa11ddb4a1001321f4509b
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Name">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
a64994b02be811ddc2e4000bcd9b93dd
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="FirstName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
93b077b028aa11ddcc0b001321f4509b
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="LastName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
93b077b128aa11ddb07c001321f4509b
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="GetEmployeeInput">
<wsdl:documentation>
Input to GetEmployee Operation
</wsdl:documentation>
<wsdl:part name="GetEmployeeInput" element="p1:GetEmployeeInput" />
</wsdl:message>
<wsdl:message name="GetEmployeeOutput">
<wsdl:part name="GetEmployeeOutput" element="p1:GetEmployeeOutput" />
</wsdl:message>
<wsdl:portType name="EmployeeService">
<wsdl:operation name="EmployeeService">
<wsdl:input message="p1:GetEmployeeInput" />
<wsdl:output message="p1:GetEmployeeOutput" />
</wsdl:operation>
</wsdl:portType>
<ifr:properties xmlns:ifr="urn:com-sap:ifr:v2:wsdl">
<ifr:category>
ifmmessif
</ifr:category>
<ifr:methods>
<ifr:method name="EmployeeService">
<ifr:isSynchron>
true
</ifr:isSynchron>
<ifr:isInbound>
true
</ifr:isInbound>
<ifr:interfaceCategory>
inbound
</ifr:interfaceCategory>
</ifr:method>
</ifr:methods>
<ifr:messages>
<ifr:message name="GetEmployeeInput">
<ifr:messType>
ifmmessage
</ifr:messType>
<ifr:technicalNamespace>
http://sap.office.tst
</ifr:technicalNamespace>
</ifr:message>
<ifr:message name="GetEmployeeOutput">
<ifr:messType>
ifmmessage
</ifr:messType>
<ifr:technicalNamespace>
http://sap.office.tst
</ifr:technicalNamespace>
</ifr:message>
</ifr:messages>
</ifr:properties>
</wsdl:definitions>

As soon as i was done with this i though of generating a .NET proxy for this wsdl. (Me being a .NET developer i couldn't control my instincts and stay away from Visual Studio too long :) )

Anyways i tried to generate a proxy and failed. Basically nothing is generated. On looking closely at the wsdl i found that wsdl:service and wsdl:binding tags are missing. Which is understandable. If i was designing the ESR i wouldn't want the information about binding and implementation address in my repository. I would probably keep it somewhere else like UDDI. This is an open question that i need to figure out now. Where doesn SAP keep this information. I'll touch this back once i am sure that implementation works.

So leaving the visual studio i came back to my ABAP system and started sproxy to generate a implementation proxy for my wsdl. After struggling a lot with package concept of ABAP i was suggested to make the proxy as a local object. I still can't figure out why it can't be a server object.... Everyone i contacted gave me different reasons however i chose to believe that i do not have appropriate permissions to create a server side object. (Sad and interesting, since this is a sandbox i thought i have all the permissions)

So i have managed to generate a proxy for this wsdl in ABAP and now comes the first place where i would code. All i want to do is to give back the employee with some hardcoded name and passed id from the method. Once i am able to do this i would actually go ahead and find the answer to my first question i.e. where to find the binding and service info for this interface.

Another open question which looms large is to add another method to this interface. I choose to address this at the end.

~Abhishek

Sunday, May 25, 2008

Show a document on the post

One of my friends wanted to post a pdf document on the blog. On doing a quick google i found a nice tool to post documents on the blog.
Check out http://www.scribd.com/ for finding how to upload and show documents on your blog.....

~Abhishek

Friday, May 23, 2008

Posting xml on the blog

Here's a simple javascript web application application that will format source code text into html for inserting into your blog.

http://formatmysourcecode.blogspot.com/

~Abhishek

Defining the Interface using Integration builder

In the previous steps I am done with setting the prereqs to start defining an interface in the ESR. I started with defining the interface now. Here are the steps
1) Login to the PI system
2) Double click on User Menu -> Exchange Infrastructure ->SXMB_IFR - Start Integration Builder. Alternatively execute the transaction SXMB_IFR.
3) This should open an internet explorer window with links to various tools. Click on Integration Repository
4) Step 3 would download and install a Java application (jnlp file) to your system
5) Provide credentials to login to the integration builder
6) Once the integration builder starts go to Tools -> Transfer from System Landscape Directory -> Import Software Component Versions
7) Select the software component in which we want to develop our interface and import it
8) Once we do this select the Software Component Version in the left naviagtion menu. Right click and add a namespace in which we would be doing the development
9) Expand the interface objects -> Data Types and right click on Data Types to add Data Types
10) Add the Data Types Employee, EmployeeId, Name

Here's how various structures look like after editing them using Integration Builder ...

a) Name
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sap.office.tst" targetNamespace="http://sap.office.tst">
<xsd:complexType name="Name">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
1a2def0028c111dd8c9c000bcd9b93dd
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="FirstName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
93b077b028aa11ddcc0b001321f4509b
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="LastName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
93b077b128aa11ddb07c001321f4509b
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>


b) EmployeeId
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sap.office.tst" targetNamespace="http://sap.office.tst">
<xsd:simpleType name="EmployeeId">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
b58a93e028c111ddcfe2000bcd9b93dd
</xsd:appinfo>
</xsd:annotation>
<xsd:restriction base="xsd:string" />
</xsd:simpleType>
</xsd:schema>


c) Name
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sap.office.tst" targetNamespace="http://sap.office.tst">
<xsd:complexType name="Name">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
1a2def0028c111dd8c9c000bcd9b93dd
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="FirstName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
93b077b028aa11ddcc0b001321f4509b
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="LastName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
93b077b128aa11ddb07c001321f4509b
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

Next we go ahead and define 2 Message Types as input and output message of the operation we want to define in our wsdl . ( I am unable to find how to have more then 2 messages in my interface for wsdl and hence i am adding only 2 Message Types as off now. To Add a message type in the Navigation Tree we can right click on Message Type and add a new one

Here are 2 schemas of 2 message types i added

a) GetEmployeeInput
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sap.office.tst" targetNamespace="http://sap.office.tst">
<xsd:element name="GetEmployeeInput" type="EmployeeId" />
<xsd:simpleType name="EmployeeId">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
02f3c70028c211ddad54000bcd9b93dd
</xsd:appinfo>
</xsd:annotation>
<xsd:restriction base="xsd:string" />
</xsd:simpleType>
</xsd:schema>

b) GetEmployeeOutput
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sap.office.tst" targetNamespace="http://sap.office.tst">
<xsd:element name="GetEmployeeOutput" type="Employee" />
<xsd:complexType name="Employee">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
886faed028c211dd8216000bcd9b93dd
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="Id" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
4ca5845028aa11ddb1c2001321f4509b
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="Name" type="Name">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
4ca5845128aa11ddb4a1001321f4509b
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Name">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
88721fd228c211ddb301000bcd9b93dd
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="FirstName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
93b077b028aa11ddcc0b001321f4509b
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="LastName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
93b077b128aa11ddb07c001321f4509b
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Once done with adding these 2 MessageTypes i have added a MessageInterface to my little POC using the Add New MessageInterface wizard which we again get by right clicking the MessageInterfaces node on the navigation tree in my SCV
Here's where my confusions have started as there are various options on what type of Message Interfaces do i want. So i am stopping this blog post here and would write the next steps in my next post.....

~Abhishek

PS: Its relatively simple to write a service in .NET since we follow inside out approach of defining a wsdl i.e. we define our classes first and wsdl is generated out of the box by the Visual Studio. This approach is time consuming however this way i have more control over how my wsdl, schemas etc. should look like so i like this more then .NET :) . Its taking lot of time since it is my first time i am doing this however i am sure with time it would become easier for me to use outside in approach of defining a web service.....

Settnig the prereqs.....

According to various documents on SDN i found out that ESR will be the repository in which the interface of a service will be stored. While the implementation of this system will lie in a business system
Now the first question is how to define the interface. The tool which can be used for defining this interface is Integration Builder. Now in order to work with the Integration builder one needs a Software Component Version and for defining a Software Component Version one needs to have a Product.
So the first step is to create a Product. Here are the steps to do this
1) Login to your PI system
2) Double click on User Menu -> Exchange Infrastructure -> Administration -> SLDCHECK - Test SLD Connection. Alternatively execute transaction SLDCHECK
3) Step 2 should open the SLD UI in an internet explorer
4) Click on the link Products
5) Add a new Product Version by clicking "New Product Version"
6) Come back to the SLD UI in internet explorer (You can use Home link on your page or use the back button in the browser)
7) Click on the Software Components link
8) Add a New Software Component Version by clicking the button
9) In the Add New Software Component Version Select the product as the product you defined in the step 5
Once we are done with this we have got the first 2 prerequisites ready to develop our interface.
Next is to use the integration builder to start defining the interface....

~Abhishek

Initial setup

After struggling through at least 30-40 pdf documents on SDN over 100 google searches i finally figured out a system where SAP allows me to develop and test in
The system is HU6 and the details can be found in ES Workplace handbook Page 67.(https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d91e4d16-0b01-0010-57b5-c4473111136f)
There are some very specific settings which you need to do if you are accessing this system from your corporate machine. Its actually a DMZ system and you need SAP Log on to access this system.
If you are in SAP Corporate network then you need not enter any SAP Router String which is given inside the above document.
Anyways by the time i figured out the workaround to access this system i figured out a SAP internal system with a similar BASIS Component release which is there on the system HU6 which you can use for your development. Most of the things in the blog series i would be posting should work as it is on HU6.
So my intial setup was over as soon as i configured HU6 i knew i have access to a XI system which by this time i came to know is called PI and not XI anymore.
For anyone out there who wants to play with PI add HU6 system to your SAP Log on utility and off you go....
I would play with ESR now....
~Abhishek

Playing with ESR and XI

After struggling with SAP systems from outside for around 3 years now i decided to go and do something inside it. I say struggling from outside since all i did with SAP systems till now was to look at the interfaces and consume the interfaces to make something in .NET world or to look at the Netweaver screens with horror, look at the ABAP developers in awe as to how they work on such complex looking UI and look at the ABAP technology stack as a neutral observer and sometimes criticising it.
This time i decided to go in and develop at least something in the Netweaver ABAP stack myself and get rid of this fear, awe and helplessness when some discussion happens around ABAP stack.

So here's the POC which i decided to do around a week back
1) Define a simple service interface in ESR
2) Provide an implementation in ABAP stack
3) Consume the service from .NET and prove that service works

Over the period of last week it gor refined to
1) The service should have 2 methods GetEmployeeIds and GetEmployeeById
2) Use ESR, XI Integration builder and implement the service in ABAP

I'll be posting my struggles in a series of blogs and will tag this series with ESR/XI/PI

~Abhishek

Sunday, April 20, 2008

Microsoft .NET team spoiled my weekend

Well the plan for the triple thrill weekend went for a toss and culprit is me and Microsoft. Me for making certain basic assumptions about .NET as a framework and Microsoft for breaking those assumptions :).

Well so here's an interesting fact.
If you have .NET Framework 3.0 installed on your system, it doesn't mean that you have the .NET framework 2.0 SP1 class library as well on your system.

Yeah really i ain't kidding here...
According to the msdn (http://msdn2.microsoft.com/en-us/library/bb822049.aspx) .NET framework 3.0 installer would install 3.0 on top of 2.0 or 2.0 SP1 whatever is available on your system. Now .NET 2.0 SP1 gives some extra classes (I used DateTimeOffset in my code) .

The assumption i made was that if the user has .NET 3.0 on her system of course the class would be available since if a class is present in .NET 2.0 SP1 it won't be absent in a higher version. However it is not true. I can't blame MSFT since they documented it however the fun is that if i install .NET 3.0 SP1 then i have that class again.

So the matrix becomes ...
1) .NET 2.0 Class not available
2) .NET 2.0 SP1 Class is available
3) .NET 3.0 May or may not be available
4) .NET 3.0 SP1 Class is Available


and the 3rd line in the matrix is what spoiled my previous weekend. I got a call from office on a saturday that things are not working and throwing a runtime exception and i had to cancel my all weekend travel plans to figure this out.

Well what can i say except that yeah its a mess up done by me (Since i didn't read the documentation) however i still believe folks at Microsoft messed up.
I think its a happened of deadlines and schedules of the framework release ....

So its a lesson for me that now on i would never believe on classes introduced in SP releases of .NET framework....

~Abhishek

Friday, April 11, 2008

Duplicate e-mails detection by a mail client

This is the topic i worked on for last 2 days and i still do not have a certain answer. Basically i was trying to find out how can a mail client like outlook or may be Exchange server detect a duplicate message.
The scenario i considered is like the following
I send a mail from a@a.com to d@d.com. Now there can be 2 paths from SMTP server for a.com to SMTP server d.com and the paths are a.com->b
.com->d.com and a.com->c.com->d.com Now what happens if a.com relays the message to both b.com and c.com . This can be because of a bug or may be because of some implementation logic. In such a case d.com would receive the same mail twice and then the question is will the SMTP server at d.com or a mail client for d@d.com be able to detect that it is the same copy of 2 messages.
Me and my colleagues' thoughts on looking at the mail headers of various mails in our inbox was that the Message-Id parameter in the message header should help detect and delete/merge such duplicates.
So i did a simple POC by sending 2 messages with same message id (even same header) to my inbox. And i got 2 messages in my inbox as well :(.
Now the question is, is it a exchange/outlook bug or a feature. I still do not have an answer. I'll be trying it for my gmail account soon.
In the meantime i got SMTP specs by Jonathan Postel on http://www.ietf.org/rfc/rfc0821.txt and a cursory look at it makes me conclude 2 things
1) An ideal SMTP server would never do something as crazy as i am thinking (It very clearly discusses the protocol for relaying a message from 1 SMTP to another and i kind of feel that it would do it only to 1 SMTP server and would jump to next only when it gets an error code. No clue on what happens if other SMTP goes down after receiving this message and before giving a OK)
2) Message Id is something we can't rely on as primary key for an e-mail message as it is quite possible that there are malicious SMTP servers which can change the header while mail is passing through their place.

So on the whole my current feeling is ideally the duplicate e-mails won't be generated and if they are then there's no fool proof way to figure them out and merge them at the destination server/ mail client.


~Abhishek

PS :- I am off for triple thrill of Climbing, burma bridge and rappelling this weekend. Will write a post on that once back and some more details on the above topic as well :)

Sunday, April 6, 2008

Conquering the nandi hills on foot

Finally after a long time I did what i wanted to do long back :)
We trekked the nandi hills on foot...
Well the idea was to go to Kalvarhalli Beta (Henceforth K-Beta) for a trek with 4 friends however that didn't work out. We had planned to start at 4 in the morning and the start got delayed by an hour and a half (As usual when its waking up early in the morning me and all my friends are late :) ) Anyhow we started off from my place at 5.30 in the morning and on the way decided to go to nandi hills instead of K-Beta as it would be damn hot by the time we figure out our original destination.
My first reaction in the morning when we got up was forget trekking we'll just go on a drive and be back however by the time we reached nandi hills i was all pumped up :)
So as soon as we reached nandi hills (Around 6.30 ) we did a small trek on a small hill first so as to warm ourselves up and see if we can catch clouds on the peak of this small hill. As luck would have it by the time we reached to the peak the clouds were gone :(
Anyhow it served as a nice warm up trek (4 Kms) for us and the next in line was Nandi hills waiting to be conquered.
So we came down, had a nice breakfast and started Nandi hills trek on foot at around 8.30 AM. On the way we got some nice patches and the brutal sun. By 11.30 AM we were up on Nandi hills and it was quite tiring to walk all the way up. Once up all of us jumped on all the water, melons, anything which can rehydrate us...
We killed some time on the top and then everyone was of the opinion to take a bus back however on persistent pleas made by me and because we had to wait for the bus for at least 45 mins. we all decided to walk all the way back and damn it was fun.
Specially the last 4 Kms as everyone was stretched out of their limits and that's what the treks are meant for. To cross the boundaries of your physical limitations (Wow i can't believe i came up with that :D )
At the end we all reached the foot of the hill and somehow made it back to Bangalore. All tired and dehydrated it was a fun trek and the good thing was to see that the sunburn hit me back after the ski vacation in Auli.
We made a total walking of around 20 Kms during the day :)
At the end of it as they say pictures speak.....
Here are a couple of them from my camera





~Abhishek

Wednesday, March 12, 2008

skiing vacation .....

I am composing this blog from Mumbai bound Rajdhani express and I am amazed that in spite of all the chaos on the platform it is quiet inside this train. I am on my way home to finish my last 3 days of a 15 days vacation and am pretty excited about these last three days as I am there to attend wedding of a very dear friend of mine.
I spent my last week learning skiing in the small town of Auli in the Himalayas. I went there with a college friend of mine and we made a whole load of new friends on the trip. The place is not known to many and finding information about skiing in India on Google is a herculean task. You need to type in the correct keywords and you might just hit the website of Garhwal Mandal Vikas Nigam (GMVN) http://www.gmvnl.com/ . The place is situated in Uttaranchal and reaching Auli is loads of fun. I took a 2.5 hours flight from Bangalore to Delhi. From Delhi I reached Haridwar by a holiday special train in little over 5 hours. After that begins a road journey of around 10 hours to reach Joshimath and from there I took 2 cable cars (around 30 mins.) to reach the town of Auli. There isn’t much except the GMVN quarters and a private shop and a hotel in Auli. There’s an abandoned temple from where one can see the nice view of Nanda Devi (2nd Highest peak in India) and other peaks like Palki, Dronagiri etc.
Stay:-
We stayed in a Dorm and had a mess where one can have nice meals with the warmth of Bukhari. We had a Bukhari in our dorm however it was in the common area and hence one had no access to the Bukhari once you want to go to bed. I was dreaded at the thought of going to bed for first couple of days as even if you turn around in your sleep you would hit an area in the bed which is cold and damp. It was easier during the later part of the stay, may be because I was damn tired by the time I hit the bed or may be because I got acclimatized to the cold J .
Ski Equipment:-
First day was the day when GMVN people registered us and distributed the equipments to us. The equipment was basically a pair of sticks, skis and shoes. We found it damn difficult to walk in those shoes and I fell a couple of times trying to walk in those shoes. However it became easier by the day to balance in those shoes and I found it comparatively easy to walk as I got tips from the instructors on how to make them easy on feet.
Skiing progress:-
Since ours was a March batch the snow from the lower slopes had already melted and hence we didn’t have access to the ski lift. This meant that we had to carry our skis up on the slope every time we come down on the skis, which was a tiring job however enthusiasm in the batch was awesome and people did it tirelessly. First day we got just the basic of how to wear the skis, what is meant by tip, heel, mountain, valley, fall line etc. We also got to know how to stand on the skis without falling or sliding.
On the second day when the instructors started I couldn’t stand on my skis and got so damn frightened that my legs started trembling on the skis. That was a bad sign however instructors started again and taught us how to stand as well as how to do side stepping and go up the slope. We also got to do the basic snow plough on our skis.
Third day again was to perfect the snow plough and braking skills.
Personally the fourth day was a disaster as the instructors started to teach how to turn on the skis and how to traverse the slope by weight balancing on upper and lower skis. I couldn’t do that and to top it I couldn’t even do the snow plough which I was able to do on the second day. That was the day I didn’t manage to stop the skis even for once without falling. My brake was to fall sideways that day. I had at least 15 falls that day.
As they say Fifth day was a charm as not only I managed to traverse the whole slope in the first shot I got my snow plough and braking technique back too. I had a spectacular somersault fall that day which I wish someone had video shot for everyone to see J
Sixth day again we kept traversing the slope and it was nice to see that instructors managed to teach it to the whole batch including non athletic people like me on how to turn the skis and how to lean on the skis.
Evenings:-
We used to be back from skiing at around 1.30 and had lunch from 2.00 to 3.00 PM. Post this we had all the time in the world and it was killed playing cards, doing bakar near Bukhari, having tea, Maggi and Momos.
Badge Ceremony:-
At the end of the sixth day the whole batch got a badge from the instructors and the whole batch was all praise for the instructors as they were as patient as Himalayas with us and they taught basic skiing to almost everyone in the batch.
Group:-
I managed to make a few acquaintances’ on the trip. There was a Doc (Sonal) in the group who treated me for a blister in my leg. Her 7 year old twins (Buddies) were the best in the whole group in learning skiing. They were the only ones who treated the skis as extension of their feet. IIT Guys (Nitin and Gaurav) who donated their cold cream and jacket to protect me against the sun and snowJ. Gujju no. 1 (Hemali) and Gujju no. 2 (Jineesha) whom I always defeated in cards ;-) (Well you defeated me twice and I defeated you 1000 times). Israeli buddy (ET) with whom I sang hotel California like I used to in college. Sohel bhai and Sirji (Pushpak, the navy guy) from whom I knew about lot of other adventure sports stuff like Waterfall rappelling, rafting etc.
So that’s the end of a long post about the short visit I had to Auli and some terms which I learned about skiing.

Thursday, January 31, 2008

SSOProvider for BDC doesn't work for .NET 3.5

If you are using Visual Studio 2008 to build a SSOProvider for BDC in Sharepoint 2007 it might not work.
It'll work if you build the dll by targetting it for .NET 2.0 framework.
Looks like Sharepoint 2007 can't load the SSOProvider assembly if the target runtime is 3.5

~Abhishek

Writing a simple SSOProvider for BDC in Sharepoint 2007

Here's a simple code which i wrote to enable BDC call webservices which support basic authentication.

I started with msdn sample for a simple pluggable SSOProvider and hardcoded the user according to my own needs.
I was getting an exception when Sharepoint tried to call this SSOProvider as it expects that GetRestrictedCredentials method of ISSOProvider is also implemented. I just returned the output of GetCredentials from this method and was able to call the service successfully.
Here's the code for reference ....


public class BasicAuthentication : ISsoProvider
{
#region ISsoProvider Members
public SsoCredentials GetCredentials(string AppID)
{
try
{
SsoCredentials ssoCreds = null;
switch (AppID)
{
case MyAppName:
{
//this is our application so return the basic credentials
ssoCreds = CreateSsoCredentials(AppID);
break;
}
default:
{
//not our application so let's not even let it have access to our SSO
throw new SingleSignonException(SSOReturnCodes.SSO_E_ACCESSDENIED);
}
}
//return the created SSO Credentials
return ssoCreds;
}
catch (SingleSignonException singleSignonEx)
{
EventLog.WriteEntry("GetCredentials has thrown SSO Exception");
throw;
}
catch (Exception exception)
{
EventLog.WriteEntry("SimpleSSOProvider", exception.ToString());
throw new SingleSignonException(SSOReturnCodes.SSO_E_EXCEPTION, exception);
}
}
private SsoCredentials CreateSsoCredentials(string AppID)
{
SsoCredentials ssoCreds = new SsoCredentials();
ssoCreds.Evidence = new SecureString[2];
ssoCreds.Evidence[0] = MakeSecureString("D034677M1");
ssoCreds.Evidence[1] = MakeSecureString("Welcome1");
// Put the User Name and Password values into the credential object
ssoCreds.UserName = ssoCreds.Evidence[0];
ssoCreds.Password = ssoCreds.Evidence[1];
return ssoCreds;
}
private SecureString MakeSecureString(string sourceString)
{
if (sourceString == null)
{
//we don't have a good source string so return null
return null;
}
SecureString secureString = new SecureString();
foreach (char ch in sourceString)
{
//append each character in the source string to the end of our secure string
secureString.AppendChar(ch);
}
return secureString;
}
public SsoCredentials GetRestrictedCredentials(string AppID)
{
return this.GetCredentials(AppID);
}
public SsoProviderInfo GetSsoProviderInfo()
{
//This method is required for all SSO Providers.
SsoProviderInfo ssoProvInfo = new SsoProviderInfo();
//setup the information about our sso provider
ssoProvInfo.AssemblyName = Assembly.GetExecutingAssembly().FullName;
ssoProvInfo.Vendor = MyAppName;
ssoProvInfo.Version = "1.0.0.0";
return ssoProvInfo;
}
private const string MyAppName = "MyApp";

////Continue to implement other methods of the interface
////You can safely throw NotSupportedException from these methods...
}


~Abhishek

Calling SAP ESOA services from .NET

If you are calling a webservice from SAP ESOA world and are getting an InvalidOperationException then don't be surprised.
You just need to open the wsdl file and replace '' with '' and recreate the proxy. It should start working ....

According to a document on https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0421f9a-4c9e-2910-1085-a45f8e813324 SAP supports document style wsdl while Microsoft Visual Studio expects a RPC style wsdl and hence the runtime exception.

Hope this helps anyone who's struggling with calling SAP ESOA services from .NET world...

~Abhishek

Friday, January 11, 2008

BDC Metaadata Editor

Finally after struggling for one full day i got a BDC Metadata Editor from Microsoft in their SDK.
The SDK can be downloaded from http://www.microsoft.com/downloads/details.aspx?familyid=6d94e307-67d9-41ac-b2d6-0074d6286fa9&displaylang=en
Happy BDC'ng...

~Abhishek

Thursday, January 10, 2008

Setting a reference to assembly in GAC

I wanted to set reference to an assembly and couldn't find a direct way to do it from Visual Studio.
So here's how i hacked into registry and was able to view the GAC as i view any file in windows explorer.

Here is how:
1) Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion in the RegEdit
2) Add a new Binary Value DisableCacheViewer and given it a value of 1
3) Navigate to C:\WINDOWS\assembly and you can see the contents of the folder as sub folders, not the standard GAC Viewer


Happy coding...

~Abhishek

Wednesday, January 2, 2008

Using ISO Images without burning them on DVD

I am trying to use ISO images to install some stuff on my machine and i found it very strange that not many easy to use tools are available on web to read ISO files and use them. Most of the tools allow you to burn the iso image on a DVD and then use them. Now this is pretty time consuming process.
So i googled hard and found an unofficial tool from microsoft which can be downloaded from http://download.microsoft.com/download/7/b/6/7b6abd84-7841-4978-96f5-bd58df02efa2/winxpvirtualcdcontrolpanel_21.exe
Its probably unsupported from Microsoft but is very easy to use. Don't forget to read the readme file which you would get once you extract the exe.

So happy mounting the ISO images...

~Abhishek