How to pass a dictionary in a method in WCf ...
I'm doing this
public void SendData(Dictionary<string, string > data)
{
foreach (KeyValuePair<string, string> item in data)
{
Console.WriteLine("{0} : {1}", item.Key, item.Value);
}
}
When I access it as 192.X.X.X//Akhil/service.svc/SendData?data={}
here What/How shou...
Hello,
as the title already states I am trying to call a self hosted WCF service (hosted in a windows service) from a silverlight 4.0 application which is hosted in sharepoint 2010. I use the basicHttpBinding and I already tried a lot of things as suggested here:
http://www.dotnetfunda.com/articles/article416.aspx
or here
http://blog...
I want to know how to safely call a WCF web service method. Are both of these methods acceptable/equivalent? Is there a better way?
1st way:
public Thing GetThing()
{
using (var client = new WebServicesClient())
{
var thing = client.GetThing();
return thing;
}
}
2nd way:
public Thing GetThing()
{
We...
I've developed a service using webHttpBinding and i'm having problems with getting the StatusDescription on the client. I'm able to set the StatusCode. I've tried some code i've found through google with no success.
This is the errorhandler i'm using:
public class ErrorHandlerEx : IErrorHandler
{
public bool HandleError(Excepti...
Hi
I have implemented NHibernate custom context (ICurrentSessionContext).
In this context I inject the NHibernate session so I have Session per call pattern setup.
Ok, now I have made an interceptor that takes userId of the current logged user.
Now I do this:
public ISession CurrentSession()
{
// Get the WCF InstanceContext:
var con...
I have a type MyParameter that i pass as a parameter to a wcf service
[Serializable]
public class MyParameter : IXmlSerializable
{
public string Name { get; set; }
public string Value { get; set; }
public string Mytype { get; set; }
#region IXmlSerializable Members
public System.Xml.Schema.XmlSchema GetSchema()
...
I have a type MyParameter that i pass as a parameter to a wcf service
[Serializable]
public class MyParameter : IXmlSerializable
{
public string Name { get; set; }
public string Value { get; set; }
public string Mytype { get; set; }
#region IXmlSerializable Members
public System.Xml.Schema.XmlSch...
hi,
I'm developing an EMR Application as my project. there Im using WCF to transfer all the data from the centralized server , WPF for the UI and PRISM to build modules.
I have 3 projects in my solution for WPF/PRISM application
The Main project(mainApplication) where the shell and bootsrapper are.
Class library(modulesLib) to hold ...
[ServiceContract]
public interface ISecurities<T> : IPolicyProvider where T: EntityObject
{
[OperationContract(Name="GetAllSecurities")]
IEnumerable<T> GetSecurities();
[OperationContract]
IEnumerable<T> GetSecurities<T1>(List<T1> lstIdentifiers) where T1 : FI_CusipMaster;
[OperationContract]
T GetSecurity<T1>(T1 lstIden...
Hi!
I have a WCF service that among other bindings also uses WebHttpBinding for JSON inputs/results.
I made a custom IErrorHandler implementation in order to be able to set the StatusCode to 400 when something goes wrong and also return a JSON understandable message. It´s the straight implementation that you can find everywhere (nice w...
At first brush, OData seems like it will only appeal to "open" databases, and would never be used in envrionments where security is needed, especially with financial or government clients.
Is this the correct perspective to have with the current version of OData/WCF? If not, can you share whatever I would need to change that perspectiv...
I almost regret that I even started programming.
How do I integrate those two enterprisey beasts? More specifically, I have a third-party ASMX service which uses WSE 3.0 (authentication & message signing). Now in following with "best" Microsoft practices and svcutil a WCF proxy to this service. For some obscure reason (I believe I even ...
I am able to consume the WCF Service in my front end ASP MVC application. I am now trying to configure a client side service for Jquery and this is where I am running in circles.
The first thing I tried was to put the service I consumed into the client side "svc" file like below, remove the codebehind and add the factory. Using this met...
I have a service contract with several operation contracts defined. I have added a new endpoint to expose my operations as a restful webservice. Moreover I've updated operation definitions so that they can be called in a RESTful way
[OperationContract]
[WebInvoke(
Method = "GET",
ResponseFormat = WebMessageFormat.Xml,
...
Suppose I'm entertaining a business model that offers free access to my propritary data if they visit my website. These users will have advertising subsidize the cost.
Then, for the paid users I want to offer direct raw WCF access to my data as an incentive. I don't want this available to the freebie users, but at the same time the si...
I have built a WCF Service that is being consumed by a Silverlight app. At first I created one method that was very simple:
public String SfTest()
{
return "SF Test";
}
No poblem. My silverlight app references my service and displays "SF Test" in a textbox.
Now I add a method to my wcf service like this:
...
Hi,
I'm using System.Xml.XmlElement as a parameter for sending XML data in WCF. Is this generally the interoperable way to send XML data in WCF, so that, for example, a PHP or Java Web Service will understand it if I'll send it from a WCF Client? I've read that I should never send XML directly as string in WCF.
In WSDL generated by W...
We have two distinct agile teams, each working on separate, but related, applications.
Each team has, until now, been able to work in an independent fashion (distinct code bases, persistence stores, sprints, backlogs etc). Recently, product management decided that these applications will become even more closely integrated. On a side n...
Error: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
I am trying to create a WCF service with Entity Framework (VS 2010, .NET 4). When I run it, I get the above error.
I read something about editing the T4 template, but it appears that it already has
[DataContractAttri...
I have a WCF service that I am calling to using jQuery 1.4.2 (polling it actually every second or so). Over time, the ajax calls slow. Initial request to a method are around ~30ms, but over about a half hour i can watch using Opera's DragonFly (and verified with chrome's tools too) my request times slowly increase. In about a half hou...