Using Siebel CRM On Demand Web Services in Microsoft.NET


1) Create a new windows application.

2) Put the following code in the form load

private void Form1_Load(object sender, EventArgs e)

{

string loginUrlString = https://servername/Services/Integration?command=login”;

String sessionID = ManageSession.Login(loginUrlString, @”orgname-devusername”, “password”);

}

3) Define the login method within ManageSession class in the following manner


public static string SessionID = “”;

public static String Login(String loginUrlString, String userName, String password)

{

try

{

// create a http request and set the headers for authentication

HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(loginUrlString);

HttpWebResponse myResponse;

myRequest.Method = “POST”;

// passing username and password in the http header

// username format if it includes slash should be the forward slash /

myRequest.Headers[“UserName”] = userName;

myRequest.Headers[“Password”] = password;

myResponse = (HttpWebResponse)myRequest.GetResponse();

Stream sr = myResponse.GetResponseStream();

// retrieve session id

char[] sep = { ‘;’ };

String[] headers = myResponse.Headers[“Set-Cookie”].Split(sep);

for (int i=0; i <= headers.Length-1; i++)

{

if (headers[i].StartsWith(“JSESSIONID”))

{

sep[0] = ‘=’;

SessionID = headers[i].Split(sep)[1];

break;

}

}

sr.Close();

myResponse.Close();

}

catch (WebException webException)

{

}

catch (Exception ex)

{

}

// send back the session id that should be passed to subsequent calls

// to webservices

return SessionID;

}

That’s it..


Discover more from Nishant Rana's Weblog

Subscribe to get the latest posts sent to your email.

Unknown's avatar

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

6 thoughts on “Using Siebel CRM On Demand Web Services in Microsoft.NET”

  1. That’s great – except SessionID is undefined in this code, as it is in the Oracle manual. A small oversight, perhaps, but shouldn’t they test this stuff before they print it?

    Like

  2. Hi Nishat,

    I am trying to use webservices in SIEBEL CRM on Demand to extract data and store it in an in-house SQL Server 2005 system.

    All I have is WSDL files that I downloaded from Siebel CRM on Demand web interface, one for every entity.

    Can you please comment on how to use these WSDL files in SQL Server 2005(and Visual Studio if required) to extract data.

    Thanks,
    Owais

    Like

  3. Hi,
    Create a new project in Visual studio it could be windows application or webapplication.
    You can select the project name, right click on it, and select add web reference, there you could pass on the location of your wsdl files. It would create a proxy class, which you can use.

    Using the proxy class first you could retrieve the values for your entities.
    And the using SqlConnection,SqlCommand object in .NET you could save it in your SQL server database.

    Like

  4. I tried it out and wrote the code using one of your articles which is;
    https://nishantrana.wordpress.com/2009/03/23/updating-account-record-using-oraclesiebel-crm-on-demand-web-service-in-net/

    Now I have a main function called InsertAccount in which I am calling another function called GetAccountName which actually calls the webservice functions.

    InsertAccount just inserts the values in SQL Server using SqlCommand and SqlConnection objects.

    In GetAccountName function I have used AccountQueryPage in place of AccountUpdate as in your article.

    The first error is “the name ManageSession doesn’t exist in the current context”

    … whereas it is done exactly the same in your article at above link.

    Secondly, the line myAccUpdateInput.ListOfAccount = myLstOfAcctData; …. is giving error because the datatype of ListOfAccount in AccountQueryPage_Input is ListOfAccountQuery.

    Other than ManageSession thing, I think all I am missing is the sequence of calls.

    Please comment.

    Like

Leave a reply to David Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Nishant Rana's Weblog

Subscribe now to keep reading and get access to the full archive.

Continue reading

Power Platform Puzzles

D365 CRM, Power Platform Tips &Tricks

Power Spark

Power Spark By Shrangarika

Van Carl Nguyen

Exploration of Power Platform

My Trial

It is my experience timeline.

Power⚡Thomas

Sharing my knowledge and experience about the Microsoft Power Platform.

Arpit Power Guide

a guide to powering up community

Welcome to the Blog of Paul Andrew

Sponsored by Cloud Formations Ltd

Deriving Dynamics 365

Deriving Solutions and features on Power Platform/Dynamics 365

The CRM Ninja

Thoughts & musings from a Microsoft Business Applications Ninja!

D CRM Explorer

Learn about Microsoft Dynamics CRM Power Platform customization and implementation and other cool stuffs

Stroke // Jonas Rapp

I know pre-stroke. I will improve who I was.

Power Melange

Power Melange By Shalinee

Clavin's Blog - PPUG.ORG

AI - Power Automate - Power Apps - SharePoint Online - Azure - Nintex - K2 - Artificial Intelligence

Sat Sangha Salon

An Inquiry in Being

The Indoencers

The Influencers & Influences of Indian Music

Monika Halan's blog

Hand's-free money management

D365 Demystified

A closer look at Microsoft Dynamics 365.

Microsoft Mate (msftmate) - Andrew Rogers

Experienced consultant primarily focused on Microsoft Dynamics 365 and the Power Platform

Manmit Rahevar's Blog

One Stop Destination for Microsoft Technology Solutions

MG

Naturally Curious

Brian Illand

Power Platform and Dynamics 365

Steve Mordue

The Professional Paraphraser

Subwoofer 101

Bass defines your home theater

SQLTwins by Nakul Vachhrajani

SQL Server tips and experiences dedicated to my twin daughters.

Everything D365

Discovering Azure DevOps and D365 Business Applications

Tech Wizard

Lets do IT Spells

XRM Tricks (Power Platform & Dynamics CRM )

Power Platform & Dynamics CRM

CRM TIPS BY PRM

Mail to crmtipsbyprm@gmail.com for queries and suggestions

nijos.dev

Giving back to the community what I have learned

Power Platform Learning

Your Go-To Resource for Power Apps, Power Automate & More

xrm CRM Dynamics

Dynamics CRM Technical & Functional Info

Dynamics 365 Blogs - Explained in unique way

Sometimes you need to look at things from different perspective.