Search Results

Search found 22762 results on 911 pages for 'wcf client'.

Page 30/911 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • Client unable to authenticate when connecting to WCF service

    - by davecoulter
    I have a WCF service hosted in a Windows service. The application is an intranet app, and I have programmatically set the bindings on both the service and the client as: NetTcpBinding aBinding = new NetTcpBinding(SecurityMode.Transport); aBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows; aBinding.Security.Transport.ProtectionLevel = System.Net.Security.ProtectionLevel.EncryptAndSign; Both the service and client have endpoints configured with SPNs: EndpointAddress = new EndpointAddress(uri, EndpointIdentity.CreateSpnIdentity("Service1")); As far as I know, I have setup the bindings correctly-- and I am usually able to connect to the service just fine. I did however run into a case where on a server running Windows Server 2003 R2, x64, SP2 I get the following exception immediately when the client tries to connect: INNEREXCEPTION -- Exception Message: InvalidCredentialException: Either the target name is incorrect or the server has rejected the client credentials. Stack Trace: at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel) at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity) I get the exception when I try to connect to the service from another machine in the domain, but if I connect to the service on the same machine running the service it works fine. The hosting service itself is running as a domain user account-- but I have tried running the service as a Local System and Network Service to no avail. I have checked the Local Security Policies for the server and didn't see anything amiss (i.e. 'Access this computer from the network' includes 'Everyone'). Anyone have an idea of what could resolve this? I am wondering if I need to do something in Active Directory with respect to the service's SPN? I have read some about using setspn.exe to register or refresh SPNs, but I haven't needed to do this before. Why would this be working with other configurations but not the one above?

    Read the article

  • WCF over named pipes

    - by Christoph
    Hi I have a problem with following scenario: There is a windows service running which spawns several processes. These processes open a WCF service host over a named pipe binding. Now the parent windows service tries to ping (connect) to the child processes using the wcf proxy over the well known named pipe. This, however fails saying: "Endpoint not found" If I run the parent process as a console application it works fine. Any ideas? I was thinking about permissions but the child processes should inherit the permission of the service, besides they are in the same session as well. thanks, Christoph

    Read the article

  • WCF method that updates object passed in

    - by Georgia Brown
    Am I correct in thinking that if I have a WCF OperationContract takes in an object and needs to set a property on that object so the client gets the update, I need to declare it to return the object. e.g. given a datacontract: [DataContract] public class CompositeType { [DataMember] public int Key { get; set; } [DataMember] public string Something { get; set; } } this will not work with WCF: public void GetDataUsingDataContract(CompositeType composite) { composite.Key = 42; } this will work: public CompositeType GetDataUsingDataContract(CompositeType composite) { composite.Key = 42; return new CompositeType { Key = composite.Key, Something = composite.Something }; }

    Read the article

  • Posting from JQuery to WCF Service

    - by Villager
    Hello, I have a WCF Service (called "myservice.svc") that takes a message from a user and saves it to the database. It returns a response to the user in the form of a number. This operation looks like this: [OperationContract] [WebGet] public string SubmitMessage(string message) { try { // SAVE TO DATABASE return "1"; } catch (Exception ex) { return "0"; } } I want to call this operation from some JQuery. I'm using the approach shown here: $.getJSON( "/services/myService.svc", {message:"some text"}, function (data) { alert("success"); } ); Oddly, the "success" alert is never displayed. In addition, I have set a breakpoint in my WCF service and it is never being tripped. What am I doing wrong? Thank you

    Read the article

  • How to validate HTTP request headers before receiving request body using WCF

    - by anelson
    I'm implementing a REST service using WCF which will be used to upload very large files. The HTTP headers in this request will communicate information which will be validated prior to allowing the upload to proceed (things like permissions, available disk space, etc). It's possible this validation will fail resulting in an error response. I'd like to do this validation prior to the client sending the body of the request, so it has a chance to detect failure before uploading potentially gigabytes of data. RESTful web services use the HTTP 1.1 Expect: 100-continue in the request to implement this. For example Amazon S3's REST API can validate your key and ACLs in response to an object PUT operation, returning 100 Continue if all is well, indicating you may proceed to send your data. I've rummaged around the WCF documentation and I just can't see a way to accomplish this without doing some pretty low-level hooking into the HTTP request processing pipeline. How would you suggest I solve this problem?

    Read the article

  • Is NServiceBus suitable for general as well specific client notifications

    - by Pratik
    I am looking at various options for a WCF based publish subscribe framework. Say I have one WCF web service that will be the publisher and 1000 clients registered as subscriber. For some published messages all clients will be interested but at the same time I wish the ability to notify a single client with a specific message. On receiving notification the client will call other web service methods on the web service. Is NServiceBus suitable for this kind of scenario ? If I use MSMQ for transport does it mean that every PC where the client is installed requires a queue to be created ?

    Read the article

  • WCF - Beginners question on Address (of ABC)

    - by Lijo
    Hi Team, I am new to WCF. Following is a question on WCF. Suppose, I have a service defined as follows. The host has two addresses. I usually click on the base address http://.... to generate proxy. When the proxy is generated, will it have address of http alone? How can I generate a proxy with net.tcp. Is there any article that explains the use of net.tcp with local host and ASP.NET? service name="XXX.RRR.Common.ServiceLayer.MySL" behaviorConfiguration="returnFaults" endpoint contract="XXX.RRR.Common.ServiceLayer.IMySL" binding="netTcpBinding" bindingConfiguration="MessagingBinding" behaviorConfiguration="LargeEndpointBehavior"/ host baseAddresses add baseAddress="net.tcp://localhost:86/XXX/RRR/ManagerService" add baseAddress="http://localhost:76/XXX/RRR/ManagerService" baseAddresses host /service Thanks Lijo

    Read the article

  • ASP.net and WCF some clarification on "overriding"

    - by nettguy
    Recently I faced few interview questions.The interviewer asked the to give the detailed answer. 1)Can we override a WCF service (Its is not OOPS overriding) ?.Explain the reason on either end. (WCF Related). 2)Can we override Page events (Page_Load())?.Explain reason.(ASP.NET related). 3)What is the primary responsibility of Pre_Init( page) event ,apart from user preference setting,skinning? 4) Can we override Static methods.Explain the reason. can anyone help me to understand the reasons?

    Read the article

  • WCF (REST) multiple host headers with one endpoint

    - by Maan
    I have an issue with a WCF REST service (.NET 4) which has multiple host headers, but one end point. The host headers are for example: xxx.yyy.net xxx.yyy.com Both host headers are configured in IIS over HTTPS and redirect to the same WCF service endpoint. I have an Error Handling behavior which logs some extra information in case of an error. The problem is that the logging behavior only works for one of both URLs. When I first call the .net URL, the logging is only working for requests on the .net URL. When I first call the .com URL (after a Worker Process recycle), it’s only working on requests on the .com URL. The configuration looks like this: <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <services> <service name="XXX.RemoteHostService"> <endpoint address="" behaviorConfiguration="RemoteHostEndPointBehavior" binding="webHttpBinding" bindingConfiguration="HTTPSTransport" contract="XXX.IRemoteHostService" /> </service> </services> <extensions> <behaviorExtensions> <add name="errorHandling" type="XXX.ErrorHandling.ErrorHandlerBehavior, XXX.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> </behaviorExtensions> </extensions> <bindings> <webHttpBinding> <binding name="HTTPSTransport"> <security mode="Transport"> <transport clientCredentialType="None"/> </security> </binding> </webHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="RemoteHostEndPointBehavior"> <webHttp /> <errorHandling /> </behavior> </endpointBehaviors> </behaviors> …. Should I configure multiple endpoints? Or in which way could I configure the WCF Service so the logging behavior is working for both URLs? I tried several things, also solutions mentioned earlier on StackOverflow. But no luck until now...

    Read the article

  • How to introduce custom primitive key types to WCF Data Services (Astoria)

    - by Artem Tikhomirov
    Hello. We use custom type to represent Identifiers in our project. It has TypeConvertor attached and it always helped with serialization. I've tried to use WCF Data Services to expose some data from our system, but faced a problem. Astoria framework do not recognize class as an entity even though I've decorated it with [DataServiceKey("Id")] attribute. If I change type of property to Guid - it totally works :(. How could teach WCF Data Services to understand this simple class?

    Read the article

  • CommunicationException in WCF

    - by user343159
    Hi I have a problem with a WCF Service I've just created. This was working yesterday but for some reason it's just stopped working. One of my WCF methods returns an array of an Entity Framework entity, like this: public BranchContactDetail[] GetClosestBranches(string postcode, int howManyBranches) { GeoLocation geoLocation = GetLocationFromPostcode(postcode); Location location = new Location(geoLocation.Latitude, geoLocation.Longitude); using (BranchDirectoryEntities entities = new BranchDirectoryEntities()) { var branchesInOrder = entities.BranchContactDetails .Where(b => b.latitude.HasValue && b.longitude.HasValue ) .OrderBy(b => location.DistanceFrom(b.latitude, b.longitude)) .Take(howManyBranches) .ToArray(); return branchesInOrder; } } ...and, as I say, this was working fine yesterday. Now I'm getting a "The underlying connection was closed: The connection was closed unexpectedly." I've hunted all over the web but no-one seems to know the answer. Anyone shed any light on this issue? Regards, Mark

    Read the article

  • Add Reference to a WCF Service Executable

    - by Sphynx
    I have 3 projects in my solution. 1 - client, 2 - server, 3 - WCF service library. Server executable exposes the service provided in the library. I need to add a reference to it, rather than to the library directly. When I open "Add Service Reference" and click "Discover", it only lists the library data, and doesn't list the executable server option. How do I reference a WCF executable service, so the client code would be generated automatically? I use VS 2010. Thanks for your help.

    Read the article

  • WCF DataContract with readonly properties

    - by Asaf R
    I'm trying to return a complex type from a service method in WCF. I'm using C# and .NET 4. This complex type is meant to be invariant (the same way .net strings are). Furthermore, the service only returns it and never recieves it as an argument. If I try to define only getters on properties I get a run time error. I guess this is because no setters causes serialization to fail. Still, I think this type should be invariant. Example: [DataContract] class A { [DataMember] int ReadOnlyProperty {get; private set;} } The service fails to load due to a problem with serialization. Is there a way to make readonly properties on a WCF DataContract? Perhaps by replacing the serializer? If so, how? If not, what would you suggest for this problem? Thanks, Asaf

    Read the article

  • Reading HttpRequest Body in REST WCF

    - by madness800
    Hi All, I got a REST WCF Service running in .net 4 and I've tested the web service it is working and accepting HttpRequest I make to it. But I ran into a problem trying to access the HttpRequest body within the web service. I've tried sending random sizes of data appended on the HttpRequest using both Fiddler and my WinForm app and I can't seem to find any objects in runtime where I can find my request body is located. My initial instinct was to look in the HttpContext.Current.Request.InputStream but the length of that property is 0, so I tried looking in IncomingWebRequestContext that object doesn't even have a method nor properties to get the body of the HttpRequest. So my question is, is there actually a way to access the HttpRequest request body in WCF? PS: The data inside the request body is JSON strings and for response it would return the data inside response body as JSON string too.

    Read the article

  • WCF service with PHP client - complex type as parameter not working

    - by Matt F
    Hi, I have a WCF service with three methods. Two of the methods return custom types (these work as expected), and the third method takes a custom type as a parameter and returns a boolean. When calling the third method via a PHP soap client it returns an 'Object reference not set to an instance of an object' exception. Example Custom Type: _ Public Class MyClass Private _propertyA As Double <DataMember()> _ Public Property PropertyA() As Double Get Return _propertyA End Get Set(ByVal value As Double) _propertyA = value End Set End Property Private _propertyB As Double <DataMember()> _ Public Property PropertyB() As Double Get Return _propertyB End Get Set(ByVal value As Double) _propertyB = value End Set End Property Private _propertyC As Date <DataMember()> _ Public Property PropertyC() As Date Get Return _propertyC End Get Set(ByVal value As Date) _propertyC = value End Set End Property End Class Method: Public Function Add(ByVal param As MyClass) As Boolean Implements IService1.Add ' ... End Function PHP client call: $client-Add(array('param'=array( 'PropertyA' = 1, 'PropertyB' = 2, 'PropertyC' = "2009-01-01" ))); The WCF service works fine with a .Net client but I'm new to PHP and can't get this to work. Is it possible to create an instance of 'MyClass' in PHP. Any help would be appreciated. Note: I'm using PHP 5 (XAMPP 1.7.0 for Windows). Thanks Matt

    Read the article

  • Cyclic References and WCF

    - by Kunal
    I have generated my POCO entities using POCO Generator, I have more than 150+ tables in my database. I am sharing POCO entities all across the application layers including the client. I have disabled both LazyLoading and ProxyCreation in my context.I am using WCF on top of my data access and business layer. Now, When I return a poco entity to my client, I get an error saying "Underlying connection was closed" I enabled WCF tracing and found the exact error : Contains cycles and cannot be serialized if reference tracking is disabled. I Looked at MSDN and found solutions like setting IsReference=true in the DataContract method atttribute but I am not decorating my POCO classes with DataContracts and I assume there is no need of it as well. I won't be calling that as a POCO if I decorate a class with DataContract attribute Then, I found solutions like applying custom attribute [CyclicReferenceAware] over my ServiceContracts.That did work but I wanted to throw this question to community to see how other people managed this and also why Microsoft didn't give built in support for figuring out cyclic references while serializing POCO classes

    Read the article

  • Client App with WCF to consume ASMX

    - by BDotA
    I have a webservice with .NET 1.1 (old school ASMX) and I am creating a client app to connect to it and use its services. From what I remember from the last time I had used Visual studio -which was 2003 version!- I can add a WebReference to it and easily use it. Tried it . it still works. but it looks like things have changed in 2008 and now we also have WCF. so I can add it as a Service Reference. but with this new method I could not find a way to create an Instance object to the ASMX service and call its methods... how do we accomplish the same thing with WCF?

    Read the article

  • Troubleshooting Multiple Endpoints Problem in WCF

    - by omatase
    I have been using WCF for a few years now and am fairly comfortable with it, however there is one simple WCF concept that I have yet to employ and am having difficulties with it. Following this article about WCF addressing as it specifically relates to multiple endpoints in IIS I see these two excerpts: "Suppose you have a file named calc.svc and you place it in a virtual directory that corresponds to (http://localhost:8080/calcservice). The base address for this service will be (http://localhost:8080/calcservice/calc.svc)." and "Now, consider the endpoint configuration found in the virtual directory’s web.config file (in Figure 3). In this case, the address of the first endpoint becomes the same as the base address (http://localhost:8080/calcservice/calc.svc) since I left the endpoint address empty. The address of the second endpoint becomes the combination of the base address appended with "secure", like this: (http://localhost:8080/calcservice/calc.svc/secure)." Now in my application I'm trying to create two endpoints for the same service (shown below). The service name is MainService.svc. For endpoint one I have address="" and endpoint two has address="Soap11". Bringing the site up in IIS I can successfully hit this URL: (https://localhost:444/MainService.svc). This is the base address for the service according to all the documentation I can find. According to this article and others I have seen that confirm its information I should have the second endpoint at (https://localhost:444/MainService.svc/Soap11) but if I navigate to that URL I get a .Net exception indicating the resource is not found. Is there a tool I can use to see where my different endpoints will be available? Maybe some IIS or aspnet_isapi.dll logging I can turn on? My web.config section defining my endpoints follows. Thanks in advance for your help <service behaviorConfiguration="MyService.MainServiceBehavior" name="MyService.MainService"> <endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSBindingConfig" contract="MyService.IMainService"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="Soap11" binding="basicHttpBinding" bindingConfiguration="BasicBindingWithCredentials" contract="MyService.IMainService"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service>

    Read the article

  • wcf generated classes and validation application block attributes

    - by Shaboboo
    Hi, I'm new to the validation application block and trying to use it with wcf... I have a wcf service that has data objects with validation rules defined with attributes, using the validation application block . On my client side (WPF), I have a service reference. When I update the service reference the generated classes do not have the validation rules attributes in them. How can I get the rules from the service? Am I missing some step, or is it not possible?

    Read the article

  • WCF hosted in a Web application and compatibility mode

    - by DotnetDude
    I have a WCF service hosted in a web application (IIS). I need to expose 1 end point over wsHttp and the other over netTcp. I am on a IIS7 environment that makes it possible for me to host non HTTP based services. Anyways, when I browse the .svc file using a browser, I get the error: The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application By googling, I realized that WCF runs in two modes - Mixed and ASP.NET compatible. When I apply the attribute [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] However, it appears that once I apply this attribute to the Service Contract implementation, I cannot use a non HTTP binding. How do I set it up so that: I can support non HTTP endpoints I can host the service on a Web app I don't create multiple services one with aspnet compatibility turned on and the other turned off

    Read the article

  • Multiple Service Address Configs in WCF Silverlight App

    - by CraigS
    My team is building our first significant Silverlight application, using a 3 layered architecture and WCF. We have developed about 10 separate WCF services in the middle layer so far, and this number is only going to grow. Generally, the presentation layer (ie. the Silverlight app) is pointing to the services as hosted on our dev server. However, there are times when I want it to access the services from localhost - ie. the developers machine. Is there an easy way to change where the presentation layer is looking for the services? Is there some way of easily switching between options here?

    Read the article

  • JQuery and WCF - GET Method passes null

    - by user70192
    Hello, I have a WCF service that accepts requests from JQuery. Currently, I can access this service. However, the parameter value is always null. Here is my WCF Service definition: [OperationContract] [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] public string ExecuteQuery(string query) { // NOTE: I get here, but the query parameter is always null string results = Engine.ExecuteQuery(query); return results; } Here is my JQuery call: var searchUrl = "/services/myService.svc/ExecuteQuery"; var json = { "query": eval("\"test query\"") }; alert(json2string(json)); // Everything is correct here if (json != null) { $.ajax({ type: "GET", url: searchUrl, contentType: "application/json; charset=utf-8", data: json2string(json), dataType: "json" }); } What am I doing wrong? It seems odd that I can call the service but the parameter is always null. Thank you

    Read the article

  • How can I translate my programmatic WCF configuration into app.config

    - by ofer
    Hi, I have an self hosted WCF server with hard coded configurations. the server worked fine until I tried to implement some new functionality. the new setting did not work (urrr.... ) and I find it hard to locate where are the problems in my code. instead of digging inside the code, I thought about different approach: Is there any way to dump those hard coded WCF configuration (the entire ) into app.config like text file after all configurations are loaded? this will enable me to have a easy global view of the entire settings .. mmm .. .by the way, does anyone know a way that will do the translation to the opposite direction? config to code. Any advice will be welcomed! ofer

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >