WCF

4K

Solutions

4

Articles & Videos

4K

Contributors

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 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
Free Tool: Path Explorer
LVL 8
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.

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
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
Hi All,

I have compile error below.


using System;
using System.Collections.Generic;
 
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Net;
using System.Web.Http;
 
using System.Web.OData;

Error      8      'System.Web.OData.Delta<ERVJGMERPDATASERVICE.TMCARCOLOR>' does not contain a definition for 'GetEntity' and no extension method 'GetEntity' accepting a first argument of type 'System.Web.OData.Delta<ERVJGMERPDATASERVICE.TMCARCOLOR>' could be found (are you missing a using directive or an assembly reference?)       

What component is missing ?

Thank you.
0
Dear,
Can someone let me know what to do to let our application developed in VS2015 using http as wen application and wcf services
There is any walk through to follow it

Thank you,
0
On Demand Webinar: Networking for the Cloud Era
LVL 8
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Example for WinRM  API using SOAP
0
We have the WCF service .SVC. There are multiple Operation contract in that.
When we hit the WSDL of web service, all methods get exposed.

Requirement : We want to expose selected methods client wise.

How can we do that.
0
Hi Team,

We would like to secure our API so that no body can hack the same.
We are working in .Net platform. Please provide some input to implement the same.

Reason to secure


1) Hacking
2) Data security

Please let me know
0
SRCarrierInfo.CarrierAgentActInfoServiceClient cgsClient = new SRCarrierInfo.CarrierAgentActInfoServiceClient();
cgsClient.GetCarrierWebsiteInformation(); //this is custom class library it will be returned. The name is likes: List<Domain.Carrier>


how can i expose my class library to the public? I use DNN 8 as client to call above object. and I can not reference my custom class library inside of DNN module project.
0
How can a WCF Service return a file (perhaps in stream?) based on its file type?

The idea is to let the end user calling the web method and then to get the file downloaded to end user.

Thank you.
0
Hello,

Can I use a published wcf from a  web services in order to do not duplicate a developed method
however, I could consume a WCF from windows project or  asp.net project
0
Hello Expert Team,

I am trying to develop a method in WCF service to dump data in an SQL tables
I asked the user to give us a json string with a specific format
if I test it for a small json , the method works correctly
but I tried to test for a long string it gives 'HTTP Error 414. The request URL is too long.'
 <WebGet> _
    Function GetHello(UserParam As String) As String
-----------------------
    Public Function GetHello(Json_Parameter As String) As String Implements IMobileservice.GetHello
        Dim ParameterInfoLength As String = ""

        Try
            ParameterInfoLength = Json_Parameter
        Catch ex As Exception
            ParameterInfoLength = ""
        End Try
        ParameterInfoLength = "This is the result of " & ParameterInfoLength
        Return ParameterInfoLength
    End Function

Do we have a solution?
Besides, I develop same method using a web services, it gives a window unresponsive to wait/kill, after a wait time ,  I get an answer, the method displays the string
 <WebMethod()> _
    Public Function GetHello(Json_Parameter As String) As String
        Dim ParameterInfoLength As String = ""

        Try
            ParameterInfoLength = Json_Parameter
        Catch ex As Exception
            ParameterInfoLength = ""
        End Try
        ParameterInfoLength = "This is the result of " & ParameterInfoLength
        Return ParameterInfoLength
    End Function

What do you suggest?
What is the best and …
0
We have an MVC application that consumes a third party WCF service.
We are calling a method in that service that takes base64encoded byte array as one of the parameters among other parameters.
We also have to specify the Username and Password in the ClientCredentials before calling the method

Below are the web. config settings
<system.serviceModel>
            <bindings>
                  <wsHttpBinding>
                        <binding name="WSHttpBinding_ISampleOrderSubmit">
                              <security mode="TransportWithMessageCredential">
                                    <transport clientCredentialType="None" />
                                    <message clientCredentialType="UserName" />
                              </security>
                        </binding>
                  </wsHttpBinding>
            </bindings>
            <client>
                  <endpoint address="https://abc.test.sample.com/SampleOrderSubmit.svc/SampleOrderSubmit.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISampleOrderSubmit" contract="SampleOrder.ISampleOrderSubmit" name="WSHttpBinding_ISampleOrderSubmit" />
            </client>
      </system.serviceModel>

Most of the time everything works fine.
But on certain occasions we get the following error:


System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. ---> System.ServiceModel.FaultException: An error occurred when verifying security for the message.


This is the only error that gets captured at our end and since majority of the times it works fine, we …
0
Hi,
I need to create a web service in vs 2015. This web service will connect to active directory and get all different kinds of information.
I need to call the same web service from asp.net application, asp.net mvc and classic asp applications. What kind of service is preferred WCF or Ajax enabled WCF? Which is more clean and more secure??  This service is going to host in cloud environment.

Which wcf service is more commonly used in this kind of situation?

thanks
0
On Demand Webinar: Networking for the Cloud Era
LVL 8
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Hi All,

I use InstallUtil to create WCF windows service.
Here is the code of installing :

Installing assembly 'D:\EMI NEW\APPLICATION WEB\testWCF\testWCFApp\bin\Debug\testWCFApp.exe'.
Affected parameters are:
   logtoconsole =
   logfile = D:\EMI NEW\APPLICATION WEB\testWCF\testWCFApp\bin\Debug\testWCFApp.InstallLog
   assemblypath = D:\EMI NEW\APPLICATION WEB\testWCF\testWCFApp\bin\Debug\testWCFApp.exe
Installing service testWCFApp.ApplicationServer...
Creating EventLog source testWCFApp.ApplicationServer in log Application...
Rolling back assembly 'D:\EMI NEW\APPLICATION WEB\testWCF\testWCFApp\bin\Debug\testWCFApp.exe'.
Affected parameters are:
   logtoconsole =
   logfile = D:\EMI NEW\APPLICATION WEB\testWCF\testWCFApp\bin\Debug\testWCFApp.InstallLog
   assemblypath = D:\EMI NEW\APPLICATION WEB\testWCF\testWCFApp\bin\Debug\testWCFApp.exe
Restoring event log to previous state for source testWCFApp.ApplicationServer.
An exception occurred during the Rollback phase of the System.Diagnostics.EventLogInstaller installer.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security.
An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback will continue. However, the machine might not fully revert to its initial state after the rollback is complete.

What's wrong ?

Thank you.
0
Hi;

My question is simple; i am gonna to call below service :

http://www.webservicex.com/globalweather.asmx?op=GetWeather

But; something is wrong, it is returning to me Data Not Found. How can i fire it? My c# code is :

  myService.GlobalWeatherSoapClient client = new myService.GlobalWeatherSoapClient();
            Console.WriteLine(client.GetWeather("Stockholm", "Sweden"));
            Console.WriteLine(client.GetWeather("Berlin", "Germany"));

Open in new window

0
Hello,
I need to update an existing WCF service to allow labels to be printed from locally attached DYMO Labelwriter 450 printers (attached by USB port to the client). In the client application I have installed the following from nuget packages.

DYMO SDK Library with default label V1.0.1
DYMO Label Framework TypeScript.Definitily.Typed V0.6.3

If I specify the code below I get a  Namespace error. I have checked the assemblies after the Nugut upload but there are no DYMO assemblies present.  What am I doing wrong. How can I get the client to recognise the DYMO Labelprinter. Appreciate any help or examples that anyone can give me.

regards
Pat
 
using DYMO;  
public void PrintLabel(string serial_num, string part_Num)
        {
            var label = DYMO.Label.Framework.Label.Open(AppDomain.CurrentDomain.BaseDirectory + "Barcode.label");
            label.SetObjectText("Bar_code", serial_num);
            label.SetObjectText("text_box", part_Num);
            label.Print("DYMO LabelWriter 450 Turbo");
        }
0
I've built the default Visual Studio 2015 C# WCF Service Application.  Runs fine with the included client using the default connection http://localhost:50127/Service1.svc

For further testing I'm using Terra Term with the same URL, with and without the service1.svc, http, :50127 etc. Always get an Invalid Host error!

When I publish to a server (with its own IP) I have the same problem

Might this be related to the 50127 port and if so how would I change that?
0
Dears, kindly note that I have to build  have to build the server which host the service as windows form application c#, and the client also is windows from application c#, so I tried to create new WCF Service Library, now how can I host it by the server and access it by the client?

the client have to connect to the server using http protocol as it is far from it,

so, is there a possible scenario for that?
0
I am having problems connecting to an Oracle database from my C# WCF service. In the WCF service I am already connecting to multiple DB2 and SQL databases successfully via the following ole connection string.


mySqlStmt =  "select * from myfile"
myConnectionString =  "Provider=sqloledb; Data Source=DEV\SQLEXPRESS;Initial Catalog=MyDataBase;User Id=user123; Password=pass123"

OleDBConnection conn = new OleDBConnection(myConnectionString);
conn.Close();
OleDbCommand cmd = new OleDbCommand(mySqlStmt, conn);
conn.Open();
cmd.Connection=conn
conn.Close();  

This has worked well for me. However I now need to connect to an Oracle database with the existing software. I have been given the connection details

Data Source=TestDB
User Id= User123
Password= Pass123

I downloaded Oracle XE to our Windows 2012 server and updated the TNSNAMES.ORA file with the connection details and then created a .UDL file to test the connection to the oracle database.  By keying in the above Data Source, User name and Password to the test connection properties I got "Test connection Succeeded"  The Oracle provider listed in the test connection is "Oracle Provider for OLE DB"

I then set up a new connection string in my application as follows:

Provider=OraOLEDB.Oracle;Data Source=TestDB;User Id=User123;Password=Pass123;

However when my application tries to connect to the database via my application I get an error message "
0

WCF

4K

Solutions

4

Articles & Videos

4K

Contributors

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
>