WCF

Windows Communication Foundation (WCF) is a tool used to implement and deploy a service-oriented architecture (SOA) to support distributed computing where services have remote consumers. It features a runtime and a set of APIs in the .NET Framework for building connected, service-oriented applications. Services typically have a WSDL interface (Web Services Description Language) that any WCF client can use to consume the service, regardless of which platform the service is hosted on. WCF implements many advanced Web services (WS) standards such as WS-Addressing, WS-ReliableMessaging, WS-Security, RSS Syndication Services, WS-Discovery, routing and better support for REST services.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello,
I have written a mock for a REST service using SoapUI free version. The resource path looks like <webservice>/employees which returns all employees in JSON. Now I want to pass a parameter which is a date range, something like <webservice>/employees?from=01-01-2017&to=31-12-2017
This will return only a few employees who joined during the date range. I am not able to find a way to accept parameters in the mock response and not sure how do i check something like if(date == 01-01-2017 to 01-04-2017) { //pass this json text   } else if(date == 08/08/2017 to 31/12/2017) { pass this text }

Any help would be greatly appreciated as I am new to SoapUI
0
Free Tool: SSL Checker
LVL 10
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hi,

We have a server 2012 R2. When we want to add 1 of the 2 features below the installation failes with error 0x800f0922

The 2 features who fail are:
.NET Framework 4.5 Features\WCF Services\Named Pipe Activation
.NET Framework 4.5 Features\WCF Services\TCP Activation

What can we do to solve this? Any help is appreciated.
0
I have a C# WCF Service which is hosted in IIS8 and has a WebForm Client. I have just recently found out about SignalR and I am trying to implement it on my Service. Initially I just want to display a message to prove it is working. I have stepped through the many examples on the web. However I am still failing to connect to the hub from my Clientside Javascript below.

(function () {
    var tiosHub = $.connection.tios;
    $.connection.hub.start()
 .done(function () {
            $.connection.hub.logging = true;
            $.connection.hub.log("Connection established");
            tiosHub.server.announcement("Connected!");
        })
        .fail(function () {
            writeToPage("Error connecting to SignalR");
        });
    tiosHub.client.announce = function (message) {
        writeToPage(message);
    }

Open in new window


I get an error "Uncaught TypeError: Cannot read property 'tios' of undefined" on the 2nd line of the javascript function above (var tiosHub = $.connection.tios;).

Appreciate any advice about where may be going wrong.  

Hub definition on Server
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;

namespace DCRules2
{
    [HubName("tios")]
    public class TiosHub : Hub
    {
        public void Announce(string message)
        {
            Clients.All.Announcement(message);
        }
    }
 }

Open in new window


owinStartup which is called from IIS

using System;
using System.Threading.Tasks;
using Microsoft.Owin;
using Owin;
using Serilog;
[assembly: OwinStartup(typeof(DCRules2.Startup1))]
namespace DCRules2
{
    public class Startup1
    {
        public void Configuration(IAppBuilder app)
        {
                app.MapSignalR();
    	 }
     }
 }

Open in new window


Client WebForm1
   
 </script>
     <script src="scripts/json2.js"></script>      
    <script src="Scripts/jquery-1.10.2.min.js"></script>
    <script src="<%= ResolveUrl("~/Scripts/jquery.signalR-2.2.1.js") %>"></script>
    <script src="<%= ResolveUrl("~/signalr/hubs") %>"></script>

Open in new window


The of the above scripts are all successfully loaded.
0
I have a C# WCF Service hosted in IIS 8.5 which has a simple Client webform consisting of a ComboBox for data entry. The ComboBox can be populated manually or via barcode scanner on the users mobile device. Every time the user uses scanned input the scanned value is written to a database table with UserId, dateTime & value. I have an API which will return the last scanned input for a user based on dateTime scanned.

So I now have a webform which can take its input either manually or via scanned input. If there is no selected value in the comboBox then I want to run a background job to call the API and return any scanned input value to the ComboBox.  

CheckForScannedTransactions below is part of the Client WebForm1 and it calls the background job StartBackgroundProcess passing parameters MyBGJobParms. I expected control to return to UI but when there is no scanned input to return control never returns to the UI despite RunWorkerAsync. Why is this ?

In this scenario every logged on user will call CheckForScannedTransactions() to check for their own scanned input. Is there a better way of doing this ? Could I for instance have just 1 background job running continuously and updating scanned input to each users webform page. Is that possible if so How so?



//CheckforSacnnedTransactions will run in background and populate any scanned value to ComboBox if ComboBox is empty 
if (ComboBox1.SelectedIndex == -1 )
{
    CheckForScannedTransactions ();
}

Open in new window



Open in new window

0
I am trying to install Sharepoint 2016 and have just been running into issue after issue. I have tried all suggested solutions available but have had no luck. Any clue why this is happning? The prerequisite installer (such a terrible and useless tool IMO) failed to install anything during the prerequisite installation process so I had to install the prerequisites manually. I tried reinstalling WCF data services 5.6 tools using the prerequisite installer in command line with the correct parameters and had no luck. I have tried reinstalling the .net 4.6.2 framework as well.

I am running a fresh install of Windows Server 2012 R2 and the database server is running Microsoft SQL Server 2014

Here is the error:

One or more configuration settings failed. Completed configuration settings will not be rolled back. resolve the problem and run this configuration wizard again. The following contains detailed information about the failure.

Failed to create the configuration database.

An exception of type Microsoft.Sharepoint.Upgrade.SPUpgradeException was thrown. Additional exception information: One or more types failed to load. Please refer to the upgrade log for more details.

I have also attached the error log. Any suggestions?
PSCDiagnostics_9_22_2017_15_31_48_91.log
0
Hi there,
We have a customer who is using a software provider who's product is hosted in the cloud. Basically the customer has a reporting tool that they would like to connect to the back end of the software to interrogate and pull data out. The software provider wont allow this, but they are going to setup a WCF service which pulls the data out of their SQL server, and makes it available to the customer. What we need to do is create a WCF client that can connect to the WCF service, and pull the data out (ie daily), and then we would like to store the data in a local SQL DB, where the reporting tool can interrogate. Any thoughts / tips on this?
0
I have a self-hosted VBNet database application that utilizes WCF.  It communicates with another WCF application.  When the first application is running in the debugger on a Windows 10 machine, it refuses to allow connections.  Running in the debugger on a Windows 7 machine does not cause this problem nor is the problem present in release mode regardless of the OS.  Any suggestions to solve this problem would be appreciated.
0
I currently have a C# WCF Service hosted in IIS 8.5  which allows users to print labels. Because the label printers are local printers for each user (USB connection on their laptops) they are forced to open the label in their browser and then click print on each label to print to local label printer. What the users want is for the labels to print automatically without any user intervention but without the printers being networked this does not seem possible - or is it?

Is it possible to use FTP to drop the text files (labels) directly onto the label printer spool queue of the laptop requesting the label?  The Service will have the IP address of each logged in user  but how can I send a file to a spooler rather than a folder and if it can be done can it be done silently ,without any user interaction.

I notice that when I send a label manually to the USB printer on the laptop (Windows 7 64bit) there are two files populated into c:/windows/system32/spool/PRINTERS. a SHD file type and a SPL file type. Is there any way of generating these two file for  the label text file to be printed?
 
I assume that a common FTP Site would need to be configured on each laptop for this to work. Appreciate any guidance and/or examples I can get.

regards
Pat
0
Hi Experts,

Quick question. Just followed this article here
http://bitoftech.net/2014/10/27/json-web-token-asp-net-web-api-2-jwt-owin-authorization-server/

I have tested with Postman but it doesn't really say how you can run the project on visual studio

any ideas as always will be helpful..

Thanks

Mike
0
I have a C# WCF Service which is hosted in IIS 8.5 and has a number of web services. One of these web services is called MobileRegistration and when called from the Client works correctly (see below)

using (var svc = new DCRulesServiceRef1.TransactionClient())
{string returnval = svc.MobileRegistration(enterpriseId, userId, deviceId, qrcode);}

Open in new window


However I also need to be able to call the webservice MobileRegistration directly via a URL without having to go through the client. The URL I created is as follows

http://xx.xx.xx.xxx/DCRules2Alias/Service.svc/MobileRegistration/?&userId=TESTUSER&enterpriseId=TESTENTERPRISE&deviceId=TESTDEVICE&qrcode=TESTQRCODE
This fails with HTTP400 Webpage cannot be found.

http://xx.xx.xx.xxx/DCRules2Alias/Service.svc  does return the TransactonService Service page successfully.  So why can it not find my service. Is the format of the URL incorrect for a WCF web service ? Below is some of the relevant code and WSDL. Appreciate if someone can point out what I am doing wrong

regards
Pat

Operation Contract for MobileRegistration web service
[OperationContract]
[WebGet(UriTemplate = "MobileRegistration?enterpriseId={enterpriseId}&userId={userId}&deviceId={devicerId}&qrcode={qrcode")]

        string MobileRegistration(string enterpriseId, string userId, string deviceId, string qrcode);

Open in new window


Web.config file
   <!-- Required to prevent error

Open in new window

0
How to Use the Help Bell
LVL 10
How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Hello
I have WCF service which emails invitation for members to join a particular enterprise. The URL sent to the users is as follows:

Please respond to invitation using the Link below:
http://www.tios.ie/account/invite.aspx?enterprise=AAAAAA&enterpriseName=BBBBBB&emailaddress=CCCCCC

This would take this to the Invite Page where they could accept or reject the invitation. This all worked fine until recently. However now when the URL is clicked, instead of going to the invite page , it seems to be trying to redirect to the Login Page. Nothing is displayed but the URL displayed on the browser is as follows:  

http://www.tios.ie/Account/Login.aspx?ReturnUrl=%2faccount%2finvite.aspx%3fenterprise%3dAAAAAA%26enterpriseName%3dBBBBBB....

I am not sure why this is happening or how I would go about debugging. Appreciate some suggestions.
0
I am part of a development for a SOAP web services client on WCF/.NET. After a session of sending request, team for server side left feedback "extend someAction from schema i am mentioning below", and mentioned an URL. In this context, what does it mean to extend from schema?
0
Dear ,

I have a web service that opens normally under https after adjusting below in web.config of my WCF
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="ServiceBehavior" name="Soc_MobileWebServices.MobileService">
        <endpoint address=""  
                  binding="basicHttpBinding"  
                  bindingConfiguration="secureHttpBinding"  
                  contract="Soc_MobileWebServices.IMobileservice"/>  

        <endpoint address="mex"  
                  binding="mexHttpsBinding"  
                  contract="IMetadataExchange" />  
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <dataContractSerializer maxItemsInObjectGraph="2147483647" />
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpsGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="ServiceEndpointBehavior">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <bindings>
      …
0
Dears.,

Referring to some links, I could fix by changing in web config of my WCF to open WCF using https from IIS manager but in my application upon running it gives below error message when calling a method from WCF web services: The provided URI scheme ‘https’ is invalid; expected ‘http’.Parameter name: via

Any hint?
Regards

Besides , in order to let my WCF open normally, we recommend to adjust in web.config mainly in 3 parts below:
Part 1
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="ServiceBehavior" name="Soc_MobileWebServices.MobileService">
        <endpoint address=""  
                  binding="basicHttpBinding"  
                  bindingConfiguration="secureHttpBinding"  
                  contract="Soc_MobileWebServices.IMobileservice"/>  

        <endpoint address="mex"  
                  binding="mexHttpsBinding"  
                  contract="IMetadataExchange" />  
      </service>
    </services>
Part 2
          <serviceMetadata httpsGetEnabled="true"/>

Part 3
    <bindings>
      <webHttpBinding>
        <binding name="" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        </binding>
      </webHttpBinding>
      <basicHttpBinding>  
        <binding …
0
Dears.,

Referring to some links, I could fix by changing in web config of my WCF to open WCF using https from IIS manager but in my application upon running it gives below error message when calling a method from WCF web services: The provided URI scheme ‘https’ is invalid; expected ‘http’.Parameter name: via

Any hint?
Regards

Besides , in order to let my WCF open normally, we recommend to adjust in web.config mainly in 3 parts below:
Part 1
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="ServiceBehavior" name="Soc_MobileWebServices.MobileService">
        <endpoint address=""  
                  binding="basicHttpBinding"  
                  bindingConfiguration="secureHttpBinding"  
                  contract="Soc_MobileWebServices.IMobileservice"/>  

        <endpoint address="mex"  
                  binding="mexHttpsBinding"  
                  contract="IMetadataExchange" />  
      </service>
    </services>
Part 2
          <serviceMetadata httpsGetEnabled="true"/>

Part 3
    <bindings>
      <webHttpBinding>
        <binding name="" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        </binding>
      </webHttpBinding>
      <basicHttpBinding>  
        <binding …
0
I dont want to re-invent the wheel and build a new WCF or Rest webservice. Please advise, how can I find out if the service I need has already been created by someone? I would love to be able to re-use that WCF/Rest service.

Example: I need a service that would convert currencies.

Thanks,
Ricky
0
All

We have a requirement where we need to build a WCF service which can make outbound calls (as client) to backend services which requires 2-way SSL (mutual-authentication).

We have been trying this with no luck. It works with 1-way SSL (WCF as client), but when we set the backend services to require 2-way SSL, the handshake failed at the point where WCF is supposed to send its certificate to the backend service, but it doesn't.

Any one has experience doing this? Any clues of what the problem could be will be much appreciated.

Best Regards
Charles
0
Hello sir , i'm using WCF services in both web application and android . Now i want to implement encryption and decryption of various id's  so if i apply the encryption and decryption then on the web end i can easily manage the code but for android developer this is very hectic problem therefore suggest me how can i manage the code.
0
I have a class called "globals" which holds multiple classes that are use by my WCF application. So for example globals consists of up to 50 classes. Until now I have been defining classes with globals  as follows:

   public class Commands
    {
        DataSet ds = new DataSet();
        DataTable dt1=new DataTable("dt1");
        DataSet ds2 ;//= new DataSet("ds2");
        DataTable dt2; //= new DataTable("dt2");
        DataRow dr2;
        string[] delimitedList1;
        string[] delimitedList2;
        string[] delimitedList3;
        string[] delimitedList4;
        string[] delimitedList5;

        string currentDataType = null;
        string ds1XmlString = " ";
        string ds2XmlString = " ";
        string myStringValue = "";
        int cnt = 0;
        DataSet dsCopy = null;
        DataSet dsCopy2 = null;
        DataSet cltDS = null;
        DataSet dsSav1 = null;
        DataSet dsSav2 = null;
        DataSet dsSav3 = null;
        DataTable fileSchema;
        public Commands()
        {

        }

Open in new window


      globals g;

I now realize that by placing globals into class Commands that it is part of this class rather than a reference.I want to create class Commands and be able to reference variables that are available in globals without having to imbed globals as part of class commands. Appreciate if someone can explain how I can achieve this ?

regards
Pat
0
Free Tool: Path Explorer
LVL 10
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

public void PostImagesToServer(Stream Images)
        {
         
            try
            {
                Guid Unique = System.Guid.NewGuid();
                string U = Unique.ToString();
                string Name = U + ".jpg";
                FtpWebRequest req = (FtpWebRequest)WebRequest.Create("ftp://NikhelPrans117@182.50.151.43/webservice/ChachaChaudaryImages/ComicImages/" + Name);
                req.Credentials = new NetworkCredential("NikhelPrans117", "Nilesh@2188");
                req.KeepAlive = true;
                req.UseBinary = true;
                req.Method = WebRequestMethods.Ftp.UploadFile;
                byte[] fileData = StreamToByte(Images);
                req.ContentLength = fileData.Length;
                Stream reqStream = req.GetRequestStream();
               
                reqStream.Write(fileData, 0, fileData.Length);
               
                reqStream.Close();
}
0
I have a simple page (SOAP Request) I can call in  a browser or from SoapUI.org app

http://mywcfClient.com/Service.asmx?op=SendMail

I type in the two variables and it returns a success or fail string

How do I call that in a C# Web Page?
0
Trying to consume webservice using wcf client, getting following error

The content type multipart/related; boundary=MIMEBoundaryurn_uuid_B50EC784A204DC07C91495512014914; type="text/xml"; start="<0.urn:uuid:B50EC784A204DC07C91495512014915@apache.org>"; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the  . The first 1024 bytes of the response were ...

Fiddler is showing the complete response but wcf is not able to deserialize the complete response. Response contains Japanese characters.
0
C# code is unable to parse the response from webservice, the information is in Japanese language.

Any help would be good.
0
I have a WCF Service written in C# which makes extensive user of global variables. The Service runs menus and transaction which are made up of sequenced database records with each database record capable of calling specific logic based on inbuilt commands. A typical simplistic example could be:

  05  Start
  10  Display Screen
  20  Input Range of Items
  30  run SQL statement to retrieve item details from Item master table
  40  Display Item Details
  50  Confirm selected Items
*60  Run SQL statement to report on Item Usage
*70  Output SQL results to CSV  
*80  Email usage report to user
  90  Goto Start

Those marked with * should run in a background thread so that after seq 50 the user will be returned to seq 05 whilst the background thread takes over. The issue I have is that Many of the variables controlling the transactions are global variables and so when the user returns to 05 and then exists to a new transactions this effects the background job since the background job is running the same code as the UI , except in the background thread.

I have copied all of the variables from UI to the background thread however the UI continues to update these global background thread variables after the background thread is launched. How can I stop the UI from affecting the background thread global variables ?

Pat
0
This app.config is resided in my c# class library. and I have class library called service.cs


I also have web application in c# and try to called service.cs (of course I added reference inside of the web app)
and I have alert about "Could not find default endpoint element that references contract"

so I create another web application project and add web reference directly and the webconfig is exactly the same. there is no error and I can call as usual.
What did I do wrong?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
              <binding name="BasicHttpBinding_IQuotingService" allowCookies="true" maxBufferSize="20000000" maxReceivedMessageSize="20000000">
                <readerQuotas maxDepth="32" maxStringContentLength="200000000" maxArrayLength="200000000"/>
                <security mode="Transport"/>
              </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="abc.svc" 
                      binding="basicHttpBinding" 
                      bindingConfiguration="BasicHttpBinding_IQuotingService" 
                      contract="NGICService.IQuotingService" 
                      name="BasicHttpBinding_IQuotingService"
                      />
        </client>
    </system.serviceModel>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>

Open in new window

0

WCF

Windows Communication Foundation (WCF) is a tool used to implement and deploy a service-oriented architecture (SOA) to support distributed computing where services have remote consumers. It features a runtime and a set of APIs in the .NET Framework for building connected, service-oriented applications. Services typically have a WSDL interface (Web Services Description Language) that any WCF client can use to consume the service, regardless of which platform the service is hosted on. WCF implements many advanced Web services (WS) standards such as WS-Addressing, WS-ReliableMessaging, WS-Security, RSS Syndication Services, WS-Discovery, routing and better support for REST services.

Top Experts In
WCF
<
Monthly
>