Microsoft Dynamics CRM UI: Silverlight WCF Call inside sitemap - wcf

I've built a Silverlight Dashboard to be hosted in Dynamics 4.0 UI (sitemap link) - It calls a WCF service which inturn uses Linq to Sql (with a CrmImpersonator) to query the CRM database. It all works on my Dev machine but when I deploy it to our development server I get the following javascript errors:
"Unhandled Error in Silverlight Application. An Exception occurred during the operation, making the result invalid. Check inner exception for System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary at ...SilverlightDash.CRMObjService.CRMMethodCompletedEventArgs.get_Result
at ...MainPage.svc_GetMethod.get_Result(object sender, CRMObjService.GetValueCompletedEventArgs e)
I have enabled anonymous access to see if the wsdl is available from the ISV folder which it is - Please help :)

Well I found the answer or rather two steps:
First step was to alter the silverlight clients service url doh!
But on the way I found that I had to add crossdomain.xml into the root of the Web App (which was hosting the wcf service).
TTFN ... Ashley

Related

Cannot connect to WCF Web Service Reference in DotNet Core 3.1

There is an issue for connecting to my WCF service from dotnet core 3.1 . For adding service reference I'm using Add Connected Service and then enters WCF URI http://10.10.10.10:8330/mywcfservice. If I enter the remote address as I said before it works fine and server asks for authenticate my request. but after I entered my credentials, in status box it said:
An error occurred while attempting to find services at '10.10.10.10/mywcfservice'. The remote server returned an error:(400) Bad Requst.
If I add / after WCF URI, in status box it said:
An error occurred while attempting to find services at '10.10.10.10/mywcfservice/'. The remote server returned an error:(401) Unauthorized.
I tested my WCF Service with WCF Storm and it works just fine. On the other hand I can connect to WCF Service from .Net Standard Project like a charm. So where is the problem?
Based on the information you provided, I cannot know what happened to your server. You can refer to this link to record the error that occurred on the server-side:
Trying to add a service reference results in Bad Request (400) in one project, otherwise runs fine
Another solution is to use dotnet-svcutil command:
Use a browser to access the WSDL file of the service, and then save it locally.
Then use the dotnet-svcutil command to generate the proxy class.
Finally, add the proxy class to the project.
To use the proxy class also need to add these two packages:
Call WCF service in core:
BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress endpointAddress = new EndpointAddress("http://localhost:8000/GettingStarted/CalculatorService");
CalculatorClient calculatorClient = new CalculatorClient(binding,endpointAddress);
Another thing to note is that there are some WCF functions that are not supported in core. For details, please refer to the link below:
WCF service works in MVC client but not in .Net Core 3 client
Feel free to let me know if the problem persists.

WCF in windows service hosting with silverlight application

I have written WCF and hosted in windows service now when accessing the services via basic http binding, it is showing "This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details." Please suggest solution step by step
Thanks to all for not replying but I got the solution. Please suggest if anything is not in order.
We have created WCF and hosted it in Windows Services as netTCP. Now, I created Silverlight Enabled WCF Services in Silverlight.Web Project and call netTcp service from here and Silverlight WCF enabled Services called in Silverlight Project and it is running fantastic. Before this I tried from Web Service but it is taking when large data calling from silverlight application.

How do I access a workflow service in silverlight?

I have one worflow service named GetDataWorkflowService.xamlx that I want to use in Silverlight.
When I add a service reference to my application, it gives a message 'This Operation is not supported for the relative URI.' It still adds the reference, however.
When I use the referece:
Servicelient proxy=new ServiceClient();
proxy.GetDataCompleted += (o, a) => Debug.WriteLine("Result is " + a.Result);
proxy.GetDataAsync(123);
I get the following error:
An error occurred while trying to make a request to URI 'http://localhost:1234/GetDataWorkflowService.xamlx'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.
I don't understand what's happening.
A few things:
What happens if you use the WCF Test Client to call GetData()? Do you get an error or does that work just fine. If you get an error here concentrate on the server parts.
What happens if you set a service reference from a console application and call your workflow service. Same error or does that work?
Is the workflow service hosted in the same web site as the Silverlight client? If not do you have the cross domain policy files setup correctly.
Assuming the WCF Test Client works. Open up fiddler and compare the request from your Silverlight client with that from the WCF Test Client. What is different?
Enable tracing on the server to see if there are any exceptions or warnings that might provide more insight to what is wrong.
Check your startup project to be sure you are starting a web project and not the Silverlight project. For more details see Troubleshooting Workflow Services / Silverlight on my blog

can't browse to a .cs file in a WCF service

I'm running my WCF service program. This error has occurred; how can it be solved?
Server Error in '/' Application.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cs' may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Requested URL: /IService1.cs
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
You aren't deploying your service correctly, you should be using .asmx/.svc files and dlls. You probably need to walk through a MSDN WCF Walkthrough
Here is another good MSDN document explaining the Hosting of WCF Services

How can I add a 'test service' page to a WCF Webservice in VB.Net

I am building a Web service using WCF as a way to provide access to data within my VB.Net application.
When building web services hosted on IIS, there is a helpful test page as part of the service that allows the webservice to be invoked with parameters there and then. It's very helpful for testing.
Is there a way to configure a WCF hosted web service to provide the same sort of test interface, rather than the fairly unhelpul 'use svcutil' response?
Just fyi, you can also use, the WcfTestClient located at:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\WcfTestClient.exe
which provides a lot of the functionality you are looking for
I am afraid you have to build web pages form e.g. aspx to call the service and display the result, WCF service no more generates the UI for you anymore.