Wednesday, January 27, 2010

Making the Skeleton Dance

This is a very interesting marketing strategy.  A guy walks into an into an interview and  highlights his negatives.

As I look over my copy of Thompson's application, I mentally reduce his chances from minuscule to nonexistent. I glance at my watch. I've got an early flight. I wonder how long it will take my compatriots to blow poor Thompson off.
"So why should we hire you, Mr. Thompson?" the area manager asks, starting with the question she usually finishes with.
Thompson smiles.
"I'm 53 years old," he says without hesitation. "I'm not pretty. I've been unemployed for almost five months—ever since my last company went belly-up. I've got no experience in your industry. If you take a look at my application you'll see that there's a checkmark next to the yes on that question about whether or not I've ever been convicted of a felony. I've applied for any number of other jobs and no one else will hire me." He looks at us each in turn while he's slowly ticking off these points on his fingers, as confidently as if he were explaining his Harvard MBA, his Olympic gold medals and his seven years as CEO of General Motors. "So let me tell you why I'm the best possible candidate you're ever going to find for this position."
And that's exactly what he proceeds to do—demonstrating the poise and assurance and experience he'd gained in those 53 years.
"If you hire me, I can't afford not to succeed!" he tells us with passion and conviction. "I don't have the option of being able to move on to greener pastures—or even brown pastures—when the job gets too grueling. I'm 100 percent committed. As locked into this position as I was locked into that jail cell 35 years ago. And if you'll notice that's where I earned the most of the credits for my college degree. I never wanted a Master's, so I've made sure I've never had to go back. But what I learned in that place—the formal and the informal training—has a lot to do with why I've been so successful at every job I've had since then."

Read the full article here.

http://www.evancarmichael.com/Sales/372/Making-the-Skeleton-Dance-Bragging-about-the-Negatives.html

Monday, January 18, 2010

How to write a custom message receiver for WSF/CPP

When you have to go beyond the supported interface of a ServiceSkeleton when implementing a service, you can use a custom message receiver to achieve that functionality.  For example, recently we encountered such scenario where the unparsed soap enveloped body has to be accessed for some custom logic. But when implementing a service using ServiceSkeleton interface, you would always ended up getting the first child of the soap body as an argument.

In that kind of a situation, the best option would be to implement a custom message receiver. WSF/CPP now provides a very convenient API for implementing a message receiver. 

For implementing a custom message receiver, WSF/CPP provides a class named MessageReceiver. What a user has to do is to extend from this and implement the abstract method invokeBusinessLogicSync which will receive inflow message context and outflow message context as arguments. Then you have the full control over the processing of the message received by the message receiver.

Next add the macro WSF_MESSAGE_RECEIVER_INIT and pass the message receiver class name as the argument.

Next compile the written code as a shared library and place it in <WSFCPP_REPO>\lib directory. When implementing a service which would be invoked using this custom message receiver, set the name of the shared library as the “messageReceiver” parameter for each operation. For example, if the shared library name is “CustomMsgRecv

<operation name=”Op1”><messageReceiver class=”CustomMsgRecv”/></operation>

Here is the example message receiver code.

/* CustomMsgRecv.h */

#include <MessageReceiver.h>

class CustomMsgRecv : public wso2wsf::MessageReceiver
{
public:
WSF_EXTERN bool WSF_CALL
invokeBusinessLogicSync(wso2wsf::MessageContext *inMsgCtx,
wso2wsf::MessageContext* outMsgCtx);
CustomMsgRecv(void);
~CustomMsgRecv(void);
};


/** CustomMsgRecv.cpp */



#include "CustomMsgRecv.h"
#include <MessageReceiver.h>

using namespace wso2wsf;

WSF_MESSAGE_RECEIVER_INIT(CustomMsgRecv)

CustomMsgRecv::CustomMsgRecv(void)
{
}

CustomMsgRecv::~CustomMsgRecv(void)
{
}

WSF_EXTERN bool WSF_CALL
CustomMsgRecv::invokeBusinessLogicSync(wso2wsf::MessageContext *inMsgCtx,
wso2wsf::MessageContext *outMsgCtx)
{
/** Add Your Logic Here */
}