PowerBuilder 12.5.NET WCF Web Service – Consumed by ASP.NET MVC4 Application
Page 3
Steps Completed
PowerBuilder 12.5.NET WCF Web Service Application
Steps Remaining
Visual Studio 2012 ASP.NET MVC4 Application that consumes the PowerBuilder 12.5.NET WCF Service
Create the ASP.NET MVC4 Application
- The next steps of the Visual Studio Program are too numerous too list separately. I will list some of the notable items.
- Category Controller, Index Method
- Notice, that we are using a WebService class to assist with the calling of Web Services, and we are calling the GetCategoriesAll from our PowerBuilder WCF Service Application

Web Service Class – Generic Wrapper for Calling WCF Web Services in ASP.NET MVC Applications
-
using System; using System.ServiceModel;
namespace LinkDBMvc.Controllers { public class WebService<T> { public static void Use(Action<T> action) { ChannelFactory<T> factory = new ChannelFactory<T>("*"); T client = factory.CreateChannel();bool success = false; try { action(client); ((IClientChannel)client).Close(); factory.Close(); success = true; } catch (EndpointNotFoundException e) { LinkDBMvc.AppViewPage.apperror.LogError("WebService", e, "Check that the Web Service is running");} catch (CommunicationException e) { LinkDBMvc.AppViewPage.apperror.LogError("WebService", e, "Check that the Web Service is running"); } catch (TimeoutException e) { LinkDBMvc.AppViewPage.apperror.LogError("WebService", e, "Check that the Web Service is running"); } catch (Exception e) { LinkDBMvc.AppViewPage.apperror.LogError("WebService", e, "Check that the Web Service is running"); } finally { if (!success) { // abort the channel ((IClientChannel)client).Abort(); factory.Abort(); } } } } }
The Main Page
x
The Category List using the PowerBuilder 12.5 WCF Web Service
Create a new Category via PB WCF Web Service in ASP.NET MVC4 Application
The inserted Category
Category Edit Functionality
Category Edit after Update
Category Delete
Source Code Downloads
PB125 WCF Service - PowerBuilder 12.5.NET Solution Source Code
LinkDBMvc - Visual Studio 2012 Express ASP.NET MVC4 Solution Source Code
CategoryTable - DDL to create lm_r_category table in SQL Server 2008 Database
Steps to create the ASPNET Membership Tables if you don’t already have them in your database.
- Run C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regsql.exe.
- Hit Next.
- Select “Configure SQL Server for application services…” and hit Next.
- Select “Windows Authentication” and the “XXXX” Database and hit Next.
- Your settings are then presented…then hit Next.
- Finally you should be presented with a done screen, hit Finish.










No comment yet
1 ping
Creating & Using a PowerBuilder 12.5 WCF Service – Page 2 of 3 » The Displaced Guy says:
October 16, 2012 at 11:10 PM (UTC -5)
[...] Jump ahead to Page 3 of the article for file downloads [...]