XABP and WCF wsHttpBinding - iis-7

How can I use WCF wsHttpBinding on my WPF Browser application?

It works normally as it is on Windows application project and ASP.Net application. You just need to add ServiceReference to your xbap project pointing to your wcf service and Visual Studio will automatically generate the bindings (of wsHttpBinding type) and client endpoint pointing to your service on the app.config (xbap also uses app.config).
Then on your xbap page's codebehind, just do the usual coduing on consuming WCF services.

Related

How to configure and call non-anonymous WCF services from SharePoint application and WPF?

We have a CRM/ERP web application (ASP.Net Forms) running on top of SharePoint (WSS and 201x).
On the other hand we have add-ins for Office (WPF) closely integrated to the web application via WCF services.
Both rely heavily on a WCF services project, in three ways:
WCF services called from code behind
AJAX-enabled client web services using webhttpbinding / enablewebscript
WCF services called from the add-ins.
However, there is a security concern.
In our current set-up, the WCF services need to be set to Anonymous authentication.
Otherwise our web application and add-ins won't work using the current configuration.
Our goal: to disable the anonymous access to the WCF services somehow, without breaking either the web application or add-ins.
This proved much less straight-forward than expected.
This is our typical set-up:
Extended SharePoint site (WSS / 201x). Alternate Access Mapping
configuration:
Default: Active Directory, NTLM.
Intranet: Membership Provider, Anonymous access.
ASP.Net web application runs within the main SharePoint web application (no sub web application in IIS).
WCF services project is configured in IIS as a 'sub' web application beneath the SharePoint web application.
This is what we came up with so far:
Added in the WCF services web.config
Changed Windows Authentication -> Advanced Settings to the following:
Extended Protection: Accept
[X] Enable Kernel-mode authentication
Changed client binding configuration of add-ins and web application to Security Mode TransportCredentialOnly with clientCredentialType Ntlm.
Above solution works in our SharePoint 2007 test environment in all three aforementioned places.
However in SharePoint 201x we can't get the WCF calls from within the web application to work.
At least not using the same client bindings as the add-ins (while the WCF calls from the add-ins also work in SharePoint 2013).
The error message we’re getting is: No credentials are available in the security package.
Another one we encountered is: Provider type not defined. (Exception from HRESULT: 0x80090017)
Question: How can we use WCF services non-anonymously from within a SharePoint web application and from WPF?
Any idea's on how to configure and call these in this scenario? (one way or another)
Any thoughts on this are greatly appreciated!

Is Web Service in ASP.NET obsolete? What to use with ASP.NET 4.0?

I have to write a simple Web Service application in ASP.NET. I read somewhere that Web Services is now obsolete and some new technologies like WCF is there.
But as the name suggests, Windows Communication Foundation, might me restricted to WinForms applications only and not for ASP.NET. What shall I use with Visual Studio 2010?
I want to build a simple Web Forms application and not MVC.
What shall I use with Visual Studio 2010?
You have many choices other than ASP.NET Web Services which are completely obsolete now. So if you are starting a new project and need to develop a web service you might consider:
WCF
ASP.NET Web API
ServcieStack
ASP.NET MVC
But as the name suggests, Windows Communication Foundation, might me
restricted to WinForms applications only
The name is misleading. WCF has strictly nothing to do with Windows Forms only. You could host a WCF service in an ASP.NET application or self-host it if you want.
Simple Web Service application in ASP.NET (webForm OR mvc) ?
My firt choice : ASP.NET WebApi
Easy to unit test
Easy to secure
Restful
Still, WCF is pretty cool too because it is very well integrated with VS, and easy to configure through web.config
Both WebApi and WCF make it possible to version your web services.

how to call oracle web service using asp.net web service

How to call Oracle web service using asp.net web service? Is there a difference between calling asp.net web service and calling Oracle web service from asp.net web service?
I found how to call asp.net web service from another one but not Oracle
If the web service (any web service) has a WSDL, then you can call it from .Net code. Just point the WCF Configuration utility at the URL, or import the WSDL and it will generate the proxy for you.

Consuming WCF in ASP.NET Web Application

My application is in asp.net 2.0. Is it possible to consume WCF service developed in asp.net 3.5? If possible, how can we consume wcf service in asp.net 2.0?
Thanks in advance.
If the WCF service in question exposes a basic http endpoint, you should be able to connect to it from an ASP.NET 2.0 website as if it was a web service. Simply right-click the ASP.NET 2.0 project in Visual Studio, and select "Add Web Reference" - this will startup the wizard that can generate a proxy for you to consume the WCF service as if it is simply a web service.

Hosting a Silverlight compatible Web Service in a Windows Service

Is it possible to create a Windows Service (background apps accessible in services.msc) application and host an ASP.NET WebService or a Silverlight compatible WebService within it?
I want to create a WebService that performs COM interop calls to something and decided that a Windows Service that interfaces with COM directly as well as hosting the WebService would be the most flexible way to go. I can then create a ASP.NET website and Silverlight application to interact with the WebService.
The other way is to have the ASP.NET perform the COM interop calls on the server side but how safe is this and does .NET even allow that?
You cannot host an ASMX web service in a Windows Service. You can, and should, do it with WCF, which replaces ASMX.
On the other hand, there's no reason you can't use COM interop in an ASP.NET application, as easily as you can with any other .NET application. The only thing to be aware of is multithreading; since it will be called from a service, your COM object will be getting called on multiple threads, which it may not expect.

Resources