Search Results

Search found 1221 results on 49 pages for 'contract'.

Page 15/49 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • how to enable WCF Session with wsHttpBidning with Transport only Security

    - by Mubashar Ahmad
    Dear Devs I have a WCF Service currently deployed with basicHttpBindings and SSL enabled. But now i need to enable wcf sessions(not asp sessions) so i moved service to wsHttpBidnings but sessions are not enabled I have set [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] But when i set SessionMode=SessionMode.Required on service contract it says Contract requires Session, but Binding 'WSHttpBinding' doesn't support it or isn't configured properly to support it. following is the definition of WSHttpBinding <wsHttpBinding> <binding name="wsHttpBinding"> <readerQuotas maxStringContentLength="10240" /> <reliableSession enabled="false" /> <security mode="Transport"> <transport clientCredentialType="None"> <extendedProtectionPolicy policyEnforcement="Never" /> </transport> </security> </binding> </wsHttpBinding> please help me with this

    Read the article

  • Unable to set maxReceivedMessageSize through web.config

    - by Michael Mortensen
    Hello there, I have now investigated the 400 - BadRequest code for the last two hours. A lot of sugestions goes towards ensuring the bindingConfiguration attribute is set correctly, and in my case, it is. Now, I need YOUR help before destroying the building i am in :-) I run a WCF RestFull service (very lightweight, using this resource for inspiration: http://msdn.microsoft.com/en-us/magazine/dd315413.aspx) which (for now) accepts an XmlElement (POX) provided through the POST verb. I am currently ONLY using Fiddler's request builder before implementing a true client (as this is mixed environments). When I do this for XML smaller than 65K, it works fine - larger, it throws this exception: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element. Here is my web.config file (which I even included the client-tag for (desperate times!)): <system.web> <httpRuntime maxRequestLength="1500000" executionTimeout="180"/> </system.web> <system.serviceModel> <diagnostics> <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" /> </diagnostics> <bindings> <webHttpBinding> <binding name="WebHttpBinding" maxReceivedMessageSize="1500000" maxBufferPoolSize="1500000" maxBufferSize="1500000" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:03:00"> <readerQuotas maxStringContentLength="1500000" maxArrayLength="1500000" maxBytesPerRead="1500000" /> <security mode="None"/> </binding> </webHttpBinding> </bindings> <client> <endpoint address="" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" contract="Commerce.ICatalogue"/> </client> <services> <service behaviorConfiguration="ServiceBehavior" name="Catalogue"> <endpoint address="" behaviorConfiguration="RestFull" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" contract="Commerce.ICatalogue" /> <!-- endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" / --> </service> </services> <behaviors> <endpointBehaviors> <behavior name="RestFull"> <webHttp/> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name="ServiceBehavior"> <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true"/> <serviceMetadata httpGetEnabled="true"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> Thanks in advance for any help leading to succesfull call with 65K XML ;-)

    Read the article

  • CommunicationException with 'not recognized sequence' message in WCF.

    - by brain_pusher
    Hello, I get a CommunicationException while using WCF service. The message is: The remote endpoint no longer recognizes this sequence. This is most likely due to an abort on the remote endpoint. The value of wsrm:Identifier is not a known Sequence identifier. The reliable session was faulted. The exception is thrown in a moment after a contract method was called. Before calling contract method the channel state is Opened. I restore my service client after catching this exception and for some time it works fine. But then this error occures again. It seems like some timeout is exceeded, but I can't understand which one exactly. I use wsHttpBinding with reliableSession enabled. The InactivityTimeout is set to half an hour and I'm sure it's not exceeded, because exception is thrown earlier.

    Read the article

  • VS2010: Warning on add project reference to Silverlight project from .NET project

    - by nlawalker
    In VS2010, Silverlight 4, .NET 4, I've got a WCF service and a Silverlight app, and Silverlight is accessing the class not with Add Service Reference but by sharing the contract. Naturally, this means I have the contract in a Silverlight class library, and the service has a project reference to that library. Strangely, this results in a /!\ icon on the reference, and a warning: The project 'SilverlightClassLibrary1' cannot be referenced. The referenced project is targeted to a different framework family (Silverlight) However, the reference works fine (I can use the interface in my Silverlight app) and builds fine. Is this a bug? My guess is yes, since the warning is lying and also goes away if you add an assembly reference instead of a project reference. I filed a bug and there's more info here as well.

    Read the article

  • 405 Method Not Allowed Error in WCF

    - by DotnetDude
    Can someone spot the problem with this implementation? I can open it up in the browser and it works, but a call from client side (using both jquery and asp.net ajax fails) Service Contract [OperationContract(Name = "GetTestString")] [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json )] string GetTestString(); In Web.config among other bindings, I have a webHttp binding <endpoint address="ajax" binding="webHttpBinding" contract="TestService" behaviorConfiguration="AjaxBehavior" /> EndPoint Behavior <endpointBehaviors> <behavior name="AjaxBehavior"> <enableWebScript/> </behavior> </endpointBehaviors> </behaviors> Svc file <%@ ServiceHost Service="TestService" %> Client var serviceUrl = "http://127.0.0.1/Test.svc/ajax/"; var proxy = new ServiceProxy(serviceUrl); I am then using the approach in http://www.west-wind.com/weblog/posts/324917.aspx to call the service

    Read the article

  • DataContractSerializer KnownType attribute not being respected?

    - by e28Makaveli
    I have a class that is decorated with a KnownType attribute with a type of the class. Is this not allowed? [KnownType(typeof(Occ600UIConfig))] public class Occ600UIConfig { } If so, why is the DCS throwing the following exception? {"Error in line 1 position 387. Element 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:Value' contains data of the 'http://schemas.datacontract.org/2004/07/OCC600.Infrastructure.Dictionary.BusinessEntities:Occ600UIConfig' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'Occ600UIConfig' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer."}

    Read the article

  • How to (pre)start xamlx workflow service

    - by rwwilden
    Related to this question. I have a xamlx workflow service that loads part of its definition from a database when it runs (using ActivityXamlServices.Load). Reason for this is that I need versioning, see the related question. I'll use WCF routing to direct calls to the right service. The part that I load dynamically contains a Receive activity. However, this activity is 'invisible' as long as the workflow doesn't start because the part of the workflow I load from the database is only loaded when the workflow starts. So from the outside it appears as if there is no Receive activity in the workflow. Apart from not being able to generate a contract for the workflow service, I can't call the service either. My first attempt was to do a soap call with the right contract on the workflow service. However, the runtime doesn't automagically activate my workflow in that case. So the question is, how do I start a workflow that is hosted inside IIS? Regards, Ronald

    Read the article

  • When adding WCF service reference, configuration details are not added to web.config

    - by Mikey Cee
    Hi, I am trying to add a WCF service reference to my web application using VS2010. It seems to add OK, but the web.config is not updated, meaning I get a runtime exception: Could not find default endpoint element that references contract 'CoolService.CoolService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element. Obviously, because the service is not defined in my web.config. Steps to reproduce: Right click solution Add New Project ASP.NET Empty Web Application. Right click Service References in the new web app Add Service Reference. Enter address of my service and click Go. My service is visible in the left-hand Services section, and I can see all its operations. Type a namespace for my service. Click OK. The service reference is generated correctly, and I can open the Reference.cs file, and it all looks OK. Open the web.config file. It is still empty! <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <bindings /> <client /> </system.serviceModel> Why is this happening? It also happens with a console application, or any other project type I try. Any help? Here is the app.config from my WCF service: <?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" /> </system.web> <!-- When deploying the service library project, the content of the config file must be added to the host's app.config file. System.Configuration does not support config files for libraries. --> <system.serviceModel> <services> <service name="CoolSQL.Server.WCF.CoolService"> <endpoint address="" binding="webHttpBinding" contract="CoolSQL.Server.WCF.CoolService" behaviorConfiguration="SilverlightFaultBehavior"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://localhost:8732/Design_Time_Addresses/CoolSQL.Server.WCF/CoolService/" /> </baseAddresses> </host> </service> </services> <behaviors> <endpointBehaviors> <behavior name="webBehavior"> <webHttp /> </behavior> <behavior name="SilverlightFaultBehavior"> <silverlightFaults /> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <bindings> <webHttpBinding> <binding name="DefaultBinding" bypassProxyOnLocal="true" useDefaultWebProxy="false" hostNameComparisonMode="WeakWildcard" sendTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:00:10" maxReceivedMessageSize="2147483647" transferMode="Streamed"> <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" /> </binding> </webHttpBinding> </bindings> <extensions> <behaviorExtensions> <add name="silverlightFaults" type="CoolSQL.Server.WCF.SilverlightFaultBehavior, CoolSQL.Server.WCF" /> </behaviorExtensions> </extensions> <diagnostics> <messageLogging logEntireMessage="true" logMalformedMessages="false" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="false" maxMessagesToLog="3000" maxSizeOfMessageToLog="2000" /> </diagnostics> </system.serviceModel> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> </startup> <system.diagnostics> <sources> <source name="System.ServiceModel.MessageLogging" switchValue="Information, ActivityTracing"> <listeners> <add name="messages" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\messages.e2e" /> </listeners> </source> </sources> </system.diagnostics> </configuration>

    Read the article

  • channel factory null on debug?

    - by Garrith
    When I try to invoke a GetData contract using wcf rest in wcf test client mode I get this message: The Address property on ChannelFactory.Endpoint was null. The ChannelFactory's Endpoint must have a valid Address specified. at System.ServiceModel.ChannelFactory.CreateEndpointAddress(ServiceEndpoint endpoint) at System.ServiceModel.ChannelFactory`1.CreateChannel() at System.ServiceModel.ClientBase`1.CreateChannel() at System.ServiceModel.ClientBase`1.CreateChannelInternal() at System.ServiceModel.ClientBase`1.get_Channel() at Service1Client.GetData(String value) This is the config file for the host: <system.serviceModel> <services> <service name="WcfService1.Service1" behaviorConfiguration="WcfService1.Service1Behavior"> <!-- Service Endpoints --> <endpoint address="http://localhost:26535/Service1.svc" binding="webHttpBinding" contract="WcfService1.IService1" behaviorConfiguration="webHttp" > <!-- Upon deployment, the following identity element should be removed or replaced to reflect the identity under which the deployed service runs. If removed, WCF will infer an appropriate identity automatically. --> <identity> <dns value="localhost"/> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior name="WcfService1.Service1Behavior"> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="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="false"/> </behavior> </serviceBehaviors> <endpointBehaviors> <behavior name="webHttp"> <webHttp/> </behavior> </endpointBehaviors> </behaviors> </system.serviceModel> </configuration> Code: [ServiceContract(Namespace = "")] public interface IService1 { //[WebInvoke(Method = "POST", UriTemplate = "Data?value={value}")] [OperationContract] [WebGet(UriTemplate = "/{value}")] string GetData(string value); [OperationContract] CompositeType GetDataUsingDataContract(CompositeType composite); // TODO: Add your service operations here } public class Service1 : IService1 { public string GetData(string value) { return string.Format("You entered: {0}", value); }

    Read the article

  • WCF - Multiple schema HTTP and HTTPS in the same service

    - by Ender
    I am trying to set up WCF service in production. The service has two bindings with two different interfaces. One endpoint (basicHttpBinding) is set up at HTTP and the other endpoint (wsHttpBinding) is set up securely over SSL. I can't get this scenario to work. Everything works with no problem if both endpoints are set up over HTTP. Before I even get into the specifics of errors I get, is is possible to run secure and insecure endpoint over the same service ? Here is a brief description of my configuration: <serviceBehaviors> <behavior name="MyServiceBehavior"> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> <serviceCredentials> <serviceCertificate findValue="123312123123123123123399451b178" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" /> <issuedTokenAuthentication allowUntrustedRsaIssuers="true"/> </serviceCredentials> </behavior> </serviceBehaviors> <bindings> <basicHttpBinding> <binding name="basicHttpBinding" maxReceivedMessageSize="2147483647"> </binding> </basicHttpBinding> <wsHttpBinding> <binding name="wsHttpBinding" maxReceivedMessageSize="2147483647"> <security mode="TransportWithMessageCredential"> <message clientCredentialType="UserName" establishSecurityContext="False"/> </security> </binding> </wsHttpBinding> </bindings> <services> <service behaviorConfiguration="MyServiceBehavior" name="MyService"> <endpoint binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="IMyService1"> </endpoint> <endpoint address="mms" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding" contract="IMyService2"> </endpoint> <endpoint address="mex" listenUri="" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> Thanks !

    Read the article

  • WPF Visual Studio Package gives error: Could not find endpoint element with name 'WCFname' and contr

    - by Andrei
    Hi everybody. This error has been covered before in other questions, however not for a Visual Studio package. Could not find endpoint element with name 'WCFname' and contract 'WCFcontract' in the ServiceModel client configuration section. I have a VS package project that needs to connect to a WCF service that provides some functionality. I add a reference to the WCF service and Visual Studio automatically creates the content for the configuration file. config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IWCFSearchService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://localhost:8732/Design_Time_Addresses/WCFSearchServiceLibrary/Service1/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IWCFSearchService" contract="WCFSearchServiceReference.IWCFSearchService" name="WSHttpBinding_IWCFSearchService"> <identity> <dns value="localhost" /> </identity> </endpoint> </client> </system.serviceModel> </configuration> However, when I run the application (in VS experimental mode) it doesn't seem to take the provided configuration file (app.config). Everytime it just throws this error: Could not find endpoint element with name 'WSHttpBinding_IWCFSearchService' and contract 'WCFSearchServiceReference.IWCFSearchService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element. My guess is that it's taking the configuration file for Visual Studio (since it is running VS experimental mode). So yeah...why isn't it recognizing the app.config file and how could I make the application to recognize it? Any help would be very welcomed as I have already tried to fix this for some time. Thanks.

    Read the article

  • WCF help, how can I expose a service over http, that calls another service over net.tcp?

    - by Hcabnettek
    Hi All, I have a WCF .svc file hosted in IIS. I want to use basicHTTP binding. This services job is to actually call another service over net.tcp. Everything works fine locally, but when I deployed, I'm getting this error. The provided URI scheme 'http' is invalid; expected 'net.tcp'. Parameter name: via Here is the server config <client> <endpoint address="net.tcp://localhost:9300/InternalInterfaceService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IInternalInterfaceService" contract="IInternalInterfaceService" name="NetTcpBinding_IInternalInterfaceService"> <identity> <servicePrincipalName value="localhost" /> </identity> </endpoint> </client> <services> <service name="MyExternalService"> <endpoint address="" binding="basicHttpBinding" contract="IMyExternalService" /> </service> </services> And here is the config that svcutil generates <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IMyExternalService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://myserver.somesdomain.com/Services/MyExternalService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyExternalService" contract="IMyInternalService" name="BasicHttpBinding_IMyExternalService" /> </client> </system.serviceModel> What do I need to do to wire this up correctly. I do not want to expose InternalInterfaceService over http. What am I doing incorrectly here? Any tips or suggestions are certainly appreciated. Thanks, ~ck

    Read the article

  • WCF Proxy generation

    - by dragonfly
    Hi, I'm generating proxy using svcutil tool. My contract methods return objects of particular type. However generated proxy client interface has return value of type object. What is more I get exception with message: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail] : The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:name. The InnerException message was 'XML 'Element' 'http://tempuri.org/:name' does not contain expected attribute 'http://schemas.microsoft.com/2003/10/Serialization/:Type'. The deserializer has no knowledge of which type to deserialize. Check that the type being serialized has the same contract as the type being deserialized.'. Please see InnerException for more details. Any ideas what's going on?

    Read the article

  • Is it a bad idea if equals(null) throws NullPointerException instead?

    - by polygenelubricants
    The contract of equals with regards to null, is as follows: For any non-null reference value x, x.equals(null) should return false. This is rather peculiar, because if o1 != null and o2 == null, then we have: o1.equals(o2) // returns false o2.equals(o1) // throws NullPointerException The fact that o2.equals(o1) throws NullPointerException is a good thing, because it alerts us of programmer error. And yet, that error would not be catched if for various reasons we just switched it around to o1.equals(o2), which would just "silently fail" instead. So the questions are: Why is it a good idea that o1.equals(o2) should return false instead of throwing NullPointerException? Would it be a bad idea if wherever possible we rewrite the contract so that anyObject.equals(null) always throw NullPointerException instead?

    Read the article

  • linq sort many 2 many question

    - by user169867
    My main entity is called [Contract]. Contract has a many 2 many relationship w/ [Service]. When I query for a list of Contracts I grab the 1st Service available like this: q.Select(c => new ContractSearchResult() { ContractID = c.ContractID, FirstService = c.Contract2Service.FirstOrDefault().Service.Name, ServiceCount = c.Contract2Service.Count, } ).ToList(); q is an IQueryable that has some filtering & paging already applied. (When I display this list I show the FirstService if there's only 1. If 1 I show "My1stService (3)" to show I'm seeing the 1st of 3 services) This works fine. My question is this: Is there any way to sort by FirstService? Or is this impossible? I haven't found a way of expressing this in linq. Any help would be appreciated.

    Read the article

  • WCF DataContracts and underlying data structures

    - by Xerx
    I am wondering what makes sense in relation to what objects to expose through a WCF service - should I add WCF Serialization specifications to my business entities or should I implement a converter that maps my business entities to the DataContracts that I want to expose through my WCF service? Right now I have entities on different levels: DataAccess, Business and Contract. I have converters in place that can map entities from DataAccess to Business and from Business to Contract and vice versa. Implementing and Maintaining those is time consuming and pretty tedious. What are best practices in relation to this? If I were using an OR/M such as NHibernate or Entity Framework should I be exposing the entities from the ORM directly or should I abstract them the same way I am doing now? Thanks in advance.

    Read the article

  • NetDataContractSerialization throwing deserialization error

    - by htanias
    hi, I have methods which return interface and some methods which accepts interface as parameters. I am trying to use Net DataContractSerializer but I am getting following error... The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:id. The InnerException message was 'Error in line 1 position 120. XML 'Element' 'http://tempuri.org/:id' does not contain expected attribute 'http://schemas.microsoft.com/2003/10/Serialization/:Type'. The deserializer has no knowledge of which type to deserialize. Check that the type being serialized has the same contract as the type being deserialized.'. Please see InnerException for more details. Please help me how to resolve this error.... If I use Netdatacontract attribute on Operation Contract, can i use DataContract and Datamember attribute on serializable class??? Thanks in advance...

    Read the article

  • Sorting a nodeset before passing to xsl:for-each

    - by Zack Mulgrew
    I have a situation where loop through a sorted nodeset and apply a template on each of the nodes: <div id="contractscontainer"> <xsl:for-each select="document"> <xsl:sort select="content[@name='ClientName']/text()" /> <xsl:apply-templates select="." mode="client-contract" /> </xsl:for-each> </div> I want to do something special with the "first" 5 nodes in the node set and render them nested element. The problem is that they need to be in the same order as if they were sorted (as they are in the loop). I had planned on doing this by using two xsl:for-each elements, each with the correct nodes selected from the set. I can't do this, however, because they need to be sorted before I can select the "first" 5. Example: <div id="contractscontainer"> <div class="first-five"> <xsl:for-each select="document[position() < 6]"> <xsl:sort select="content[@name='ClientName']/text()" /> <xsl:apply-templates select="." mode="client-contract" /> </xsl:for-each> </div> <div class="rest-of-them"> <xsl:for-each select="document[position() > 5]"> <xsl:sort select="content[@name='ClientName']/text()" /> <xsl:apply-templates select="." mode="client-contract" /> </xsl:for-each> </div> </div> I don't think this will work because I'm selecting the nodes by position before sorting them, but I can't use xsl:sort outside of the xsl:for-each. Am I approaching this incorrectly?

    Read the article

  • Hosting a WCF Service Lib through a Windows service get a System.InvalidOperationException: attempti

    - by JohnL
    I have a WCF Service Library containing five service contracts. The library is hosted through a Windows Service. Most if not all my configuration for the WCF Library is declaritive. The only thing I am doing in code for configuration is to pass the type of the class implementing the service contracts into ServiceHost. I then call Open on each of the services during the Windows Service OnStart event. Here is the error message I get: Service cannot be started. System.InvalidOperationException: Service '[Fubu.Conversion.Service1' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element. at System.ServiceModel.Description.DispatcherBuilder.EnsureThereAreNonMexEndpoints(ServiceDescription description) at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) at System.ServiceModel.ServiceHostBase.InitializeRuntime() at System.ServiceModel.ServiceHostBase.OnBeginOpen() at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open() at Fubu.RemotingHost.RemotingHost.StartServ... protected override void OnStart(string[] args) { // Uncomment to debug this properly //System.Diagnostics.Debugger.Break(); StartService1(); StartService2(); StartService3(); StartService4(); StartService5(); } Each of the above simply do the following: private void StartSecurityService() { host = new ServiceHost(typeof(Service1)); host.Open(); } Service Lib app.congfig summary <services> <service behaviorConfiguration="DefaultServiceBehavior" name="Fubu.Conversion.Service1"> <endpoint address="" binding="netTcpBinding" bindingConfiguration="TCPBindingConfig" name="Service1" bindingName="TCPEndPoint" contract="Fubu.Conversion.IService1"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="mexSecurity" bindingName="TcpMetaData" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="net.tcp://localhost:8025/Fubu/Conversion/Service1/" /> </baseAddresses> </host> </service> ... Contract is set up as follows: namespace Fubu.Conversion.Service1 { [ServiceContract(Namespace = "net.tcp://localhost:8025/Fubu")] public interface IService1 { I have looked "high and low" for a solution without any luck. Is the answer obvious? The solution to this does not appear to be. Thanks

    Read the article

  • Cannot complete a JSONP call from jQuery to WCF

    - by Dusda
    Okay, I am trying (poorly) to successfully make a JSONP call from jQuery on a test page to a WCF web service running locally, as a cross-domain call. I have, at one point or another, either gotten a 1012 URI denied error, gotten a response but in Xml, or just had no response at all. Currently, the way I have it configured it spits back a 1012. I did not write this web service, so it is entirely possible that I am just missing a configuration setting somewhere, but I've become so frustrated with it that I think just asking on here will be more productive. Thanks guys. Details below. I have a WCF web service with the following method: [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public decimal GetOrderStatusJson(int jobId) I am trying to call this method from a jQuery test page, via a cross-domain JSONP call. <script type="text/javascript"> getJsonAjaxObject( "http://localhost:3960/ProcessRequests.svc/json/GetOrderStatusJson", { "jobId": 232 }); function getJsonAjaxObject(webServiceUrl, jsonData) { var request = { type: "POST", contentType: "application/json; charset=utf-8", url: webServiceUrl, data: jsonData, dataType: "jsonp", success: function(msg) { //success! alert("blah"); }, error: function() { //oh nos alert("bad blah"); } }; $.ajax(request); } </script> Below are the chunks of the web.config I configure for this purpose: <services> <service behaviorConfiguration="MWProcessRequestWCF.ProcessRequestsBehavior" name="MWProcessRequestWCF.ProcessRequests"> <endpoint address="json" behaviorConfiguration="AspNetAjaxBehavior" binding="webHttpBinding" contract="MWProcessRequestWCF.IProcessRequests" /> <endpoint address="" binding="wsHttpBinding" contract="MWProcessRequestWCF.IProcessRequests"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="MWProcessRequestWCF.ProcessRequestsBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> <endpointBehaviors> <behavior name="AspNetAjaxBehavior"> <enableWebScript/> </behavior> </endpointBehaviors> </behaviors>

    Read the article

  • Is this a correct way to host a WCF service?

    - by mafutrct
    For some testing code, I'd like to be able to host a WCF service in only a few lines. I figured I'd write a simple hosting class: public class WcfHost : IDisposable where Implementation : class where Contract : class { public readonly string Address = "net.tcp://localhost:8000/"; private ServiceHost _Host; public WcfHost () { _Host = new ServiceHost (typeof (Implementation)); var binding = new NetTcpBinding (); var address = new Uri (Address); _Host.AddServiceEndpoint ( typeof (Contract), binding, address); _Host.Open (); } public void Dispose () { ((IDisposable) _Host).Dispose (); } } That can be used like this: using (var host = new WcfHost<ImplementationClass, ContractClass> ()) { Is there anything wrong with this approach? Is there a flaw in the code (esp. about the disposing)?

    Read the article

  • CodeContracts: ccrewrite fails with Object reference not set to an instance of an object

    - by Vyas Bharghava
    The below code makes ccrewrite blow up! Ideas? BTW, If you comment out the ActualClass, ccrewrite succeeds... [ContractClass(typeof(TestContracts))] interface ITestInterface { bool IsStarted { get; set; } void Begin(); } class ActualClass : ITestInterface { public bool IsStarted { get; set; } public void Begin() { this.IsStarted = true; } } [ContractClassFor(typeof(ITestInterface))] class TestContracts : ITestInterface { ITestInterface Current { get; set; } private TestContracts() { Current = this; } #region ITestInterface Members bool ITestInterface.IsStarted { get; set; } void ITestInterface.Begin() { Contract.Requires(!Current.IsStarted); Contract.Ensures(Current.IsStarted); } Thanks in advance!

    Read the article

  • WCF Service Library - make calls from Console App

    - by inutan
    Hello there, I have a WCF Service Library with netTcpBinding. Its app.config as follows: <configuration> <system.serviceModel> <bindings> <netTcpBinding> <binding name="netTcp" maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000"> <readerQuotas maxDepth="500" maxStringContentLength="50000000" maxArrayLength="50000000" maxBytesPerRead="50000000" maxNameTableCharCount="50000000" /> <security mode="None"></security> </binding> </netTcpBinding> </bindings> <services> <service behaviorConfiguration="ReportingComponentLibrary.TemplateServiceBehavior" name="ReportingComponentLibrary.TemplateReportService"> <endpoint address="TemplateService" binding="netTcpBinding" bindingConfiguration="netTcp" contract="ReportingComponentLibrary.ITemplateService"></endpoint> <endpoint address="ReportService" binding="netTcpBinding" bindingConfiguration="netTcp" contract="ReportingComponentLibrary.IReportService"/> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" ></endpoint> <host> <baseAddresses> <add baseAddress="net.tcp://localhost:8001/TemplateReportService" /> <add baseAddress ="http://localhost:8080/TemplateReportService" /> </baseAddresses> </host> </service> </services> <behaviors> <serviceBehaviors> <behavior name="ReportingComponentLibrary.TemplateServiceBehavior"> <serviceMetadata httpGetEnabled="True"/> <serviceDebug includeExceptionDetailInFaults="True" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration> I want to call it from a console application for testing purpose. I understand that I can call by adding Service Reference or by adding proxy using svcutil. But in both these cases, my service needs to be up and running (I used WCF Test Client) Is there any other way I can call and test service method from console application?

    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 Business logic handling

    - by Raj
    I have a WCF service that supports about 10 contracts, we have been supporting a client with all the business rules specific to this client now we have another client who will be using the exact same contracts (so we cannot change that) they will be calling the service exactly the same way the previous client called now the only way we can differentiate between the two clients is by one of the input parameters. Based on this input parameter we have to use a slightly different business logic – the logic for both the Client will be same 50% of the time the remainder will have different logic (across Business / DAL layers) . I don’t want to use if else statement in each of contract implementation to differentiate and reroute the logic also what if another client comes in. Is there a clean way of handling a situation like this. I am using framework 3.5. Like I said I cannot change any of the contracts (service / data contract ) or the current service calling infrastructure for the new client. Thanks

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >