开发者

How to host custom Web Service in Dynamic CRM 4.0

开发者 https://www.devze.com 2023-03-17 01:41 出处:网络
Desired Outcome: Expose my own Web Service in Dynamic CRM 4.0 (IFD), and accessible by external application

Desired Outcome: Expose my own Web Service in Dynamic CRM 4.0 (IFD), and accessible by external application

e.g.

CRM Web Server URL: https://Org.CrmServer.com/

CRM Web Service URL: https://Org.CrmServer.com/MSCRMServices/2007/CrmService.asmx

My own Web Service URL: https://Org.CrmServer.com/MyServices/Dummy.asmx

Problem Encountered:

  1. By accessing my Service URL in the browser, it redirects me to the sign in page. I entered a valid credential, and then it redirects me back to the Service Description page. So far so good

  2. In my external application (C#), I've added Web Service Reference, and tried to call my Web Service by

    MyService.Dummy d = new MyService.Dummy();

    string s = d.HelloWorld();

  3. The code above throws exception with error message (a HTML doc with "Object Moved" to CRM sign in page. (It's like what I see in the browser, redirecting to sign in page)

  4. Modified code to pass in the credential but still doesn't work

    MyService.Dummy d = new MyService.Dummy();

    d.Credentials = new System.Net.NetworkCredential("username", "password");

    string s = d.HelloWorld();

Questions:

  • Have I hosted my Web Service in the correct开发者_如何学JAVA manner? If not, what's the correct way of doing it?

  • How to I consume my Web Service without being redirected to sign in page?

Thanks for the help.


I've hosted web services inside the CRM Website. But to do this, I put them in the ISV folder. Therefore my service urls look something like

https://CrmServer.com/ISV/MyServices/Dummy.asmx

You could try doing it this way. I have assumed you are doing this on an IFD.

0

精彩评论

暂无评论...
验证码 换一张
取 消