Microsoft Developer Network >
Forums Home
>
Windows Networking Development Forums
>
Windows Web Services API
>
REST and XML with WWSAPI
REST and XML with WWSAPI
- I was able to implement REST and XML variants based on SOAP with WCF using
XMLServiceHostFactory. Here is the VB.NET code:===========================================Public Class XMLServiceHostFactoryInherits ServiceHostFactoryProtected Overloads Overrides Function CreateServiceHost(ByVal serviceType As Type, ByVal baseAddresses As Uri()) As ServiceHostReturn New XMLServiceHost(GetType(Service), baseAddresses)End FunctionEnd ClassPublic Class XMLServiceHostInherits ServiceHostPublic Sub New(ByVal serviceType As Type, ByVal ParamArray baseAddresses As Uri())MyBase.New(serviceType, baseAddresses)End SubProtected Overloads Overrides Sub ApplyConfiguration()MyBase.ApplyConfiguration()For Each endpoint As ServiceEndpoint In Me.Description.EndpointsIf endpoint.Name = "SereviceRESTEndpoint" ThenDim newBinding As New CustomBinding(endpoint.Binding)Dim webMEBE As WebMessageEncodingBindingElement = newBinding.Elements.Find(Of WebMessageEncodingBindingElement)()webMEBE.ContentTypeMapper = New XMLWebContentTypeMapper()endpoint.Binding = newBindingEnd IfNextEnd SubPublic Class XMLWebContentTypeMapperInherits WebContentTypeMapperPublic Overloads Overrides Function GetMessageFormatForContentType(ByVal contentType As String) As WebContentFormatReturn WebContentFormat.RawEnd FunctionEnd ClassEnd Class===========================================Is this possible with WWSAPI?
Answers
- Hello,
With the version of WWS that ships with Windows 7 and Windows Server 2008 R2, building REST services is not supported. You won't be able to build the services you have implemented with VB. At this point, WWS only helps with building SOAP based services and clients to SOAP based services.
Thanks,
Nikola
Nikola Dudar is the Program Manager for Windows Web Services API team. This post is provided "AS IS" with no warranties, and confer no rights. Use of any samples is subject to the terms specified at http://www.microsoft.com/ info/cpyright.htm- Marked As Answer byNikola Dudar [MSFT]MSFTFriday, July 31, 2009 11:34 PM
- Edited byNikola Dudar [MSFT]MSFTFriday, July 31, 2009 11:35 PMtypo
All Replies
- Hello,
With the version of WWS that ships with Windows 7 and Windows Server 2008 R2, building REST services is not supported. You won't be able to build the services you have implemented with VB. At this point, WWS only helps with building SOAP based services and clients to SOAP based services.
Thanks,
Nikola
Nikola Dudar is the Program Manager for Windows Web Services API team. This post is provided "AS IS" with no warranties, and confer no rights. Use of any samples is subject to the terms specified at http://www.microsoft.com/ info/cpyright.htm- Marked As Answer byNikola Dudar [MSFT]MSFTFriday, July 31, 2009 11:34 PM
- Edited byNikola Dudar [MSFT]MSFTFriday, July 31, 2009 11:35 PMtypo
- I believe I can develop these extensions - they will be just a wrapper around SOAP.
I needed to know about your plans.
One more question. Can we host WWSAPI server in IIS?Thanks,Constantine - Hi Constantine,
We do not provide direct guidance around hosting of WWSAPI services in IIS. There are several ways of hosting native code in IIS like ISAPI extensions for example. From WWSAPI standpoint, the service has to run as part of some process and the Service Host should be able to register listener on a specific URL address. As long as IIS passes the messages on this URL to the process where the Service Host runs, it should work. I will find time later this year to look into this scenario and post some form of tutorial.
Thanks,
Nikola
Nikola Dudar is the Program Manager for Windows Web Services API team. This post is provided "AS IS" with no warranties, and confer no rights. Use of any samples is subject to the terms specified at http://www.microsoft.com/ info/cpyright.htm - Hi Nikola,If WWSAPI services can be hosted in IIS, this will give a quick migration pathfor WCF services and also a functionality not otherwise possible.Let me share some of my experience creating web services (>5 years, >30 ASMX
and WCF web services) for a well established company.What was most important from customers' point of view related to WCF:1) Running in IIS compatibility mode was important because only that waywe can get the IP address of the caller. This combined with CustomerIDadds the functionality for relating the CustomerID and customer licensetied to IP address.2) Multiple end points are confusing to them. One end point is very easy to
explain and deal with internally.3) We had a big problem related to http and https. With ASMX by defaulthosted in IIS getting https functionality is as easy as adding an "s" to httpand it is transparent. With WCF there is no other way but to add a differentend point. Customers are asking why they need to handle this on client side.It was easier before. In this case the company decided to have only httpswhich solution is a compromise.4) I created REST, XML, SOAP versions all based on SOAP. Recently a big customerusing SAP needed integration. It turned out SAP was not implementing the SOAPstandard right and they made a patch. During the time they released the patch ( 2 weeks)I offered the customer to try REST. He made and tested his application for one day!For comparison he was running in a loop with SAP implementing SOAP right for three months.One day rather three months is not exaggregation. Finally after SAP issuing the patchI asked them to test the SOAP version. It worked fine but told us it will go with REST.5) The perofrmance of WCF being based on .NET is not good no matter what you do.6) Web.Config configuration is very easy to deal with and maintain.REST was easy to implement based on SOAP with above mentioned extension I wrote.SOAP is easier to develop and maintain because there are very good MS tools.
REST is easier to work with, you can use it from the browser for a quick test, and intgrate iteasy too.Bottom line - the pattern I followed SOAP as a basis, REST and XML as extensionsproved good.In my opnion WWSAPI is the right solution from performance stand point. In order to have asuccess it needs IIS hosting, REST functionality and configuration possibilities similar likeWeb.Config in WCF. These to be an option is someone needs them.Best Regards,Constantine- Edited bythstart Thursday, August 06, 2009 7:04 PM
- Thanks for sharing for your thoughts! We will consider this information in the planning for the next version.
Thanks,
Nikola
Nikola Dudar is the Program Manager for Windows Web Services API team. This post is provided "AS IS" with no warranties, and confer no rights. Use of any samples is subject to the terms specified at http://www.microsoft.com/ info/cpyright.htm

