I am trying to generate WCF Services Xamarin Cross platform ( PCL ) project based on the sample giving by xamarin itself i.e. TodoWCF
I found few issues wile generating WCF Services in xamarin using VS2015
1) I don't see Add service option to add WSDL file
to resolve this i found this thread and i tried to remove windows phone 8.1 after removing Xamarin.Forms and adding it again.
2) After that i tried to tap on Add Services and entered the WSDL
but VS2015 is constantly getting restarted when it tries to generate code for
service endpoint.
3) I dont see any of the dependency added in TodoWFC sample provided by xamarin itself in my project
and really dont know how did they manage to generate WCF code inside it.
I read WCF Walkthrough in Xamarin and Consuming WCF in Xamarin but no where they have specified how to add WCF Service and System.ServiceModel dependencies.
hence i fill this topics are still not resolved
From the updates of Xamarin and .Net Framework it is not possible to add the service references as WCF from the solution explorer, you can verify this post where they proposed how to solve it
https://github.com/dotnet/wcf/issues/2464#event-1474936235
If you are still using PCL, it is possible to change the ProfileTarget, you can see this post
https://luisdavidxamshap.wordpress.com/2018/01/26/consumir-web-service-wcf-con-xamarin-forms-pcl-paso-a-paso/
Related
I have a Xamarin Forms App. Using latest Xamarin/VS2017 I'm using the built in Connected Service to generate my Proxy from WSDL.
It generates a file which I can reference in my .Net Standard project. It compiles/builds fine in all projects. Runs and works fine in UWP.
In iOS I receive the following error when using the service:
monotouch does not support dynamic proxy code generation override this method or its caller
Is this not the correct way to generate a WCF Proxy from a WSDL in Visual Studio for Xamarin iOS? Is there a different way I should be generating?
I've also tried svcutil which produces the same results.
svcutil https://MyApp/services/Service?wsdl /namespace:*,MyAppServices
I've seen some chatter around slsvcutil Is this correct you need to use Silverlight command line? I don't have Silverlight installed at this point either.
https://forums.xamarin.com/discussion/53856/problems-to-start-slsvcutil-exe
In our application a Service Reference was added to connect to a SOAP Web Service. When connecting to the Web Service we get an error. The owner of the web service told us that the error was caused because we use SOAP 1.2 and theirs web service only supports SOAP 1.1.
This answer mentions to add a textMassageEncoding setting in our custom binding. But it is not clear where to add this setting. Where should this setting been added?
Instead of adding a Service Reference add a Web Reference. I use VS 2013 (VS 2017 is exactly the same), right click on project name in Solution Explorer, select add then Service Reference, click Advanced button, click Add Web Reference at the bottom. Web references are a bit dated, but I use them all the time because I have a ton of legacy software, including android and iOS apps that use them. RESTful apis are typically the most used api these days.
I have created a WCF service using Service Library template. Using the Service.dll generated, I have hosted the service in a console application.
However, when I add a Service Reference in my web project, on viewing the Service details in Object browser, it points to incorrect assembly in the object browser as shown in the screen shot below.
One possible issue could be that, while renaming the namespaces in my web project, I ended up renaming the namespace of Service project also. But even after fixing all the namespaces, I still have this issue.
Any ideas on what can be done to resolve it?
While adding a Service Reference, it displays the correct members/interfaces as shown in the screenshot below. Only when I view the Service Reference in the object browser, I don't see those interfaces exposed by the service.
Project dependencies of service project
Not sure why the web project is a dependency of the Service library project? It should not be as I have not added any reference to it in the Service project.
I came across this question here after researching on this issue.
I also found out that the reference.cs file was empty in my case also. After unchecking Reuse types in referenced assemblies from 'Configure Service Reference' dialog, I was able to generate the Service reference client code successfully. My Service reference is now pointing to the correct Interface/members. In case of any queries, feel free to comment or contact me directly.
I am new to both Silverlight and WF (both 4.0 version), i was wondering if we can integrate WF4.0 with Silverlight 4.0 in such a way that, when we click on some button in sliverlight UI the workflow should be executed and the output from the final activity of the workflow is displayed in the Silverlight screen. If it can be done then please provide me with some link or any tutorial where i can learn about this and start implementing.
Thanks in advance.
In WF 4.0 you can have workflows started (or progressed) by WCF endpoints. Therefore, if you can call the WCF endpoint from your Silverlight application you should be able to do this quite easily. Lots of information on Microsoft's WF Developer Centre.
Assuming you are using Visual Studio 2010, you can get up and running with a very simple Silverlight -> WF example very quickly...
Create a new project (and new solution) from the 'WCF Workflow Service Application' template. The project will be named DeclarativeServiceLibraryX. This should give you a very simple WorkflowService definition using SequentialService that simply receives the request from a client (with a single integer argument) and sends a response (with the same value). This project is created as a web project so includes a Web.config.
Create a new Silverlight 4 application. You will be asked if you want to host the Silverlight app in the existing web project (created in step #1). Probably a good idea to say yes.
In the Silverlight application, select 'Add Service Reference...', then 'Discover/ Services in Solution'. Service1.xamlx will appear as an option, select it and click Ok.
VS will then generate a WCF service reference client. You could then add a TextBox & Button to capture some data, create the client and send the service call across the wire to the WCF Workflow Service. This Workflow Service could then be modified as necessary (or use these steps to add a WCF Workflow Service to your own web project).
One area that might be challenging is modifying the WCF service bindings to be compatible with Silverlight; perhaps create a Silverlight-compatible WCF service in your server-side project first, then create a WF WCF endpoint and look at the generated code & config to see how to put things together.
The MSDN Endpoint blog is also a useful resource for learning more about WF and WCF (especially with the new style lightweight REST-style 'WCF Web HTTP' bindings, which might be more suitable for consumption by a Silverlight client.
I am assuming that you don't want to host the workflow inside the Silverlight app itself, as WF is a full .Net framework component rather than being Silverlight compatible. I'm sure you could write your own lightweight workflow framework that runs inside Silverlight, but given workflow is generally a multi-user, server-side concern this probably wouldn't be very useful concern.
I found an example with WPF here for these samples. Hope they will help you a bit or at least give a general look at this topic.
Workflow Foundation is not included in the Silverlight 4.0 runtime and thus cannot be used within a Silverlight app. So Silx answer do not relate at all to Silverlight. And James Websters answer is the only solution to make use of WF from Silverlight.
You cant use WF with silverlight.... the only way is , You can call WCF service to access WF as explained by James Webster.
I am working on a Silverlight application that uses WCF. I need to have my WCF project separate from the ASP.Net application that will host my Silverlight project. I am looking for some guidance on how I should organize my solution and list gotchas other people have experienced during debugging and deployment.
Specifically my questions are
What type of project should I use for the WCF service?(A WCF project, an ASP.NET project with self-hosted WCF services, something else)
What do I need to so to get it so that when I press F5 I can debug both my Silverlight project and my WCF service? Will I need a cross-domain policy just to debug the thing?
Some background info on why I want to do this:
I have legacy web application that I am gradually converting over to a Silverlight application. Because it is a large web application some of its features will be converted to Silverlight before others.
The legacy web application has lots of code in it that is no longer used. Much of the code that is no longer used references 3rd part assemblies. This is why I want to get rid of the old web application. So obviously I don't want to host WCF services that will be kept for future versions in it. That is my reason for wanting to make the WCF project separate.
We're doing the exact same thing.
We're using a WCF project just in case we have to change how it's hosted in the future. (I.E. no longer using IIS)
2.a. You can have a solution with your silverlight projects, and your wcf project. The silverlight project will have a service reference to the wcf service in your solution. That allows you to debug using F5. However, when you go to deploy, you will have to change your app.config service URIs to refer to your production location.
2.b. You will only need a cross-domain policy file if your fully qualified domain names are different for the wcf service and the silverlight app. Ours happen to be different. Here is an excellent article on when to use the policy file: Clicky
Good luck!
Just remember that when you get ready to deploy, if your service is going to be hosted on a different machine than your app, you need to deploy the service first. Then re-configure your service reference, and finally re-compile your Silverlight before deploying. Otherwise, your Silverlight app will look for the service on your local machine instead of where you deploy it.