Tech Support > Microsoft Windows > Windows CRM > Re: Programming:How do we connect to Microsoft CRM server...
Re: Programming:How do we connect to Microsoft CRM server...
Posted by Rihan Meij on August 12th, 2003


hi

You dont need to use the com interface, you can use webservices. If you
want to use the com interface there is 2 dll's you need to register, I would
suggest you get hold of the CRM SDK if you dont have it you can email me
privatley and I can send it to you, here is some sample code straight out of
the SDK

BizMerchant.ChangeName Method
The ChangeName method is used to change the name of a business.

Syntax

[Visual Basic .NET]
Public Sub ChangeName(
ByVal Caller As CUserAuth,
ByVal BusinessId As String,
ByVal NewName As String
)[C#]
public void ChangeName(
CUserAuth Caller,
string BusinessId,
string NewName
);[C++]
public: void ChangeName(
CUserAuth* Caller,
String* BusinessId,
String* NewName
);Parameters

Caller
Specifies the identity of the caller. The caller must have the
prvWriteBusinessUnit privilege to perform this action. See CUserAuth.
BusinessId
Specifies the ID of the business. This ID is specified by the platform and
obtained at creation time.
NewName
Specifies a new name for the business.
Return Value

No return value.

Remarks

If there is an error, SOAP will throw an exception and the error message
will be reported in
System.Web.Services.Protocols.SoapException.Detail .OuterXml.

All IDs passed to the platform are GUIDs wrapped in braces. For example:
{6522D89A-A752-4455-A2B0-51494C6957C3}

Examples

[Visual Basic .NET][C#]
// server should be set with the name of the platform Web server
string server = "myservername";

// virtualDirectory should be set with the name of the Microsoft CRM
// Virtual Directory on the platform Web server
string virtualDirectory = "mscrmservices";
string strDir = "http://" + server + "/" + virtualDirectory + "/";

// BizUser proxy object
Microsoft.CRM.Proxy.BizUser oBizUser = new Microsoft.CRM.Proxy.BizUser ();
oBizUser.Credentials = System.Net.CredentialCache.DefaultCredentials;
oBizUser.Url = strDir + "BizUser.srf";

// BizMerchant proxy object
Microsoft.CRM.Proxy.BizMerchant oMerchant = new
Microsoft.CRM.Proxy.BizMerchant ();
oMerchant.Credentials = System.Net.CredentialCache.DefaultCredentials;
oMerchant.Url = strDir + "BizMerchant.srf";

String strErrorMsg;
try
{
Microsoft.CRM.Proxy.CUserAuth oUserAuth = oBizUser.WhoAmI();

oMerchant.ChangeName(oUserAuth, oUserAuth.MerchantId, "My New Business
Name");
}
catch (System.Web.Services.Protocols.SoapException err)
{
// Process the platform error here
strErrorMsg = ("ErrorMessage: " + err.Message + " " + err.Detail.OuterXml
+ " Source: " + err.Source );
}
catch (Exception err)
{
// Process other errors here
strErrorMsg = ("ErrorMessage: " + err.Message );
}"Bhaskar Prasad Thamma" <cyberbhaskar@hotmail.com> wrote in message
news:%23Xf%23YN%23XDHA.1872@TK2MSFTNGP12.phx.gbl.. .


Posted by Bhaskar Prasad Thamma on August 13th, 2003


hai Rihan,
What are 2 dll's to registred ,i done Programming with SDK.I
want to work with COMintreface.

please Explain about the dlls.

Thanks and regards
Bhaskar Thamma


"Rihan Meij" <Rihan.Meij@cpt.softwarefutures.com> wrote in message
news:OR9D91JYDHA.1480@tk2msftngp13.phx.gbl...



Similar Posts