The truth of the matter is as a consultant it is your job to work with the people whom you are supposed to work. Despite the Office Space memes, most consultants are not empowered to make sweeping company wide changes, enforce their will despite objections of the staff, and call meetings where they get to tell the employees how their work will be done from now on.
The vast majority consultants are intended as temporary augmentation of staff either for a project or to provide support. In either scenario working smoothly with the permanent staff is your prime directive. The best consultants are the ones who can get along with the often contentious permanent staff and still accomplish all of the contracted goals. This can be difficult as there are some people who seem to enjoy the office politics where they get to feel empowered by taking someone else down. If you allow this to prevent you from completing your contract then this is a failure on your part.
For me, I try to start out by creating a good impression. My first few weeks I do my best to bond with the staff, I will bring in donuts, bagels, and jelly beans to share. I work to find a common interest and bond that way. And if someone is especially difficult I will try to find an ally to help me break through. It is also something you need to force your self to spend 10-15 minutes every day renewing those bonds. As a consultant I think this is the most important part of the job. When the management wants to know how you are doing they will ask some or all of the people you are working with. Having them on your side is important.
For accomplishing actual work tasks then I prefer then consult with the "experts" method. I am the expert in what I do, in my case programming. They are the experts in their business, and how the business is done there. So getting the key people to buy in to your solution is important. I find the most effective way is to show them my solution and ask for their opinion. If I do not know the solution then ask what they think. If a meeting is required to figure something out then if I can I will get one of the team to suggest or at least organize the meeting. And above all simple flaterry. Nothing outlandish but "Thank you for all your help, I don't think I could do this with out it," or "It helps me a lot to have you around to get me pointed in the right direction." This goes along way to helping keep the permanent staff on your side, which increases the chance of success for your contract.
Occasionally I will run into some permanent staff that does not want my project to succeed. The most effective way I have found is to get an ally of similar level to help me navigate that mine field. Rather than asking for help to roll over, or get around this person I ask for help in getting them on board. Sometimes it will lead to a good working relationship, and if it is truely a battle that can not be won then sometimes you can get someone to act as a shield for you.
The other important thing is to pass around the credit. Especially with manager, PM's and leads. Giving the team credit for your accomplishments does two things. First all that they really care about is that you are here and the job is getting done. You benefit not at all from extra kudos on your own back. However the people with whom you are working do benefit from your acknowledgement of their abilities and contributions to their management. This good will reflects well on you from all sides.
Finally, treat every day as though it was part of your job interview, because it is. As a consultant it pretty much is. Having a bad day as a consultant can mean you do not get offered a contract in the future. So even when you are dealing with outside stress it must stay home. Even if you do not want to work for this company again, if you stay in consulting you will be surprised where the people you meet while contracting, turn up for other assignments. I found out that I got my current assignment because I worked with a friend of my hiring manager at a previous contract and was recommended. That friend is in a city about 150 miles from where I am now.