 |
|
 |
AFAIK, this has nothing to do with WCF. It should work the same way as in any other kind of .Net application.
Are you sure you heard the question correct and it was not Operation Contract overloading?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
 |
|
 |
Yeah.Ok Thanks for answer....
So what could be the answer for Diff way of achieving operation overloading in WCF...One I said is using opration overloading name parameter..is there any other way,like using new keyword....?
Thanks,
Srinivas Mateti
|
|
|
|
 |
|
 |
None AFAIK. Although you can avoid different names for overloaded contracts by manually editing the method names in the proxy class (provided you are using one).
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
 |
|
 |
Hi,
I am using the collectionview customSort with an IComparer for very large sets of data. I would like to sort on a background thread and give the user the option to cancel the sort. Can this be achieved using the collectionView? If not then what is the best alternative?
Many Thanks
Dan
|
|
|
|
 |
|
 |
I have a FlowDocument within a resource dictionary. I'd like to place a Hyperlink within a Paragraph within the FlowDocument, and then add a Click event to the Hyperlink element. First problem: I'm able to give a Name attribute to the Hyperlink but I don't know how to address it in code-behind. Second problem: if I include a Click event in the Hyperlink, the compiler tells me I have to include a x:Class in the root element of the FlowDocument resource. I don't know what that means or how to express it in XAML.
I would like to have the FlowDocument in an application-level ResourceDictionary because I'd like to be able to access it in multiple places in my application and respond to clicks on the Hyperlink without having to duplicate the FlowDocument in these multiple places. That's ultimately the problem I want to solve. Right now I have duplicated the FlowDocument in multiple places and that is an embarrassing kludge.
|
|
|
|
 |
|
 |
If I understood what you want correctly, you just want a local event handler to that object (you don't want to access the event from the Window or Control that will host the document). Add a a partial class for the dictionary. Write your event handler in that class. Link to that class from the dictionary XAML using x:Class
Here is a sample code,
<ResourceDictionary x:Class="ResourcesDemo.Dictionary1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<FlowDocument x:Key="doc">
<FlowDocument.Blocks>
<Paragraph>
<Hyperlink Click="Hyperlink_click">Say hello</Hyperlink>
</Paragraph>
</FlowDocument.Blocks>
</FlowDocument>
</ResourceDictionary>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
namespace ResourcesDemo
{
public partial class Dictionary1
{
private void Hyperlink_click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Hello, world!");
}
}
}
Eslam Afifi
modified on Thursday, November 19, 2009 5:47 PM
|
|
|
|
 |
|
 |
That worked beautifully! Thanks! The reason duplicating the FlowDocument in two different places was a kludge was because the FlowDocument was huge and under constant revision. Imagine the pain of trying to keep the two copies in sync!
|
|
|
|
 |
|
 |
You're welcome. And yeah, hacking around to keep stuff in sync is a pain to code and maintain.
Eslam Afifi
|
|
|
|
 |
|
 |
Hi,
I have a WCF service and client. I have no issues in creating the WCF proxy and calling all the operation contract but to one operation which returns a DataSet. The dataset is fairly large object, initially it gave Bad Response error and i resolved it by changing the maxBufferPoolSize to "50000000" instead of the default value( i changed all the stuff related to size to "50000000"). But now when i call this particular method it gives the following error
System.ServiceModel.Security.MessageSecurityException: The signature verification failed. Please see inner exception for fault details. ---> System.Security.Cryptography.CryptographicException: Digest verification failed for Reference '#_0'.
at System.IdentityModel.Reference.EnsureDigestValidityIfIdMatches(String id, Object resolvedXmlSource)
at System.IdentityModel.StandardSignedInfo.EnsureDigestValidityIfIdMatches(String id, Object resolvedXmlSource)
at System.ServiceModel.Security.WSSecurityOneDotZeroReceiveSecurityHeader.EnsureDigestValidityIfIdMatches(SignedInfo signedInfo, String id, XmlDictionaryReader reader, Boolean doSoapAttributeChecks, MessagePartSpecification signatureParts, MessageHeaderInfo info, Boolean checkForTokensAtHeaders)
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Security.WSSecurityOneDotZeroReceiveSecurityHeader.EnsureDigestValidityIfIdMatches(SignedInfo signedInfo, String id, XmlDictionaryReader reader, Boolean doSoapAttributeChecks, MessagePartSpecification signatureParts, MessageHeaderInfo info, Boolean checkForTokensAtHeaders)
at System.ServiceModel.Security.WSSecurityOneDotZeroReceiveSecurityHeader.ExecuteMessageProtectionPass(Boolean hasAtLeastOneSupportingTokenExpectedToBeSigned)
at System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan timeout)
at System.ServiceModel.Security.MessageSecurityProtocol.ProcessSecurityHeader(ReceiveSecurityHeader securityHeader, Message& message, SecurityToken requiredSigningToken, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
at System.ServiceModel.Security.InitiatorSessionSymmetricMessageSecurityProtocol.VerifyIncomingMessageCore(Message& message, String actor, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
at System.ServiceModel.Security.MessageSecurityProtocol.VerifyIncomingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.VerifyIncomingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.ProcessIncomingMessage(Message message, TimeSpan timeout, SecurityProtocolCorrelationState correlationState, MessageFault& protocolFault)
at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.ProcessReply(Message reply, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Honeywell.PSOS.Data.Provider.WCFPSOSDAService.IDAService.GetUpdatedData(Object& specialMessage, String serverName, String hostName)
at Honeywell.PSOS.Data.Provider.WCFPSOSDAService.DAServiceClient.GetUpdatedData(Object& specialMessage, String serverName, String hostName) in D:\cc_view\E311367_Remote_view_R400\Prod_URT\ProfitSuite Operator Station\DataAccess\Honeywell.PSOS.Data.Provider\Service References\WCFPSOSDAService\Reference.cs:line 128
at Honeywell.PSOS.Data.Provider.WebSubscriptionManager.GetData(Boolean bFullData)
I could not able to find, any solution in google or any where. Please let me know how to resolve this. Thanks in advance
This is my web.config file
<system.serviceModel>
<services>
<service behaviorConfiguration="Honeywell.PSOS.Data.WCFDAService.Service1Behavior"
name="Honeywell.PSOS.Data.WCFDAService.DAService">
<endpoint address="" binding="wsHttpBinding" contract="Honeywell.PSOS.Data.WCFDAService.IDAService" bindingConfiguration="endPointBehave" >
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Honeywell.PSOS.Data.WCFDAService.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="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="endPointBehave" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="50000000" maxStringContentLength="50000000" maxArrayLength="50000000"
maxBytesPerRead="50000000" maxNameTableCharCount="50000000" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" />
<message clientCredentialType="Windows" />
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
This is my app.config file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IDAService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="50000000" maxStringContentLength="50000000" maxArrayLength="50000000"
maxBytesPerRead="50000000" maxNameTableCharCount="50000000" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" />
<message clientCredentialType="Windows" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://ie11ltj2sts1s.global.ds.honeywell.com/PSOSWCFDA/DAService.svc" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IDAService" contract="WCFPSOSDAService.IDAService"
name="WSHttpBinding_IDAService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
|
|
|
|
 |
|
 |
Returning a dataset via WCF? That's kinda crapping in the face of SOA a bit, yah? Consider restructuring your data to represent business objects and implement a good SOA and I think you'll find silly problems like this don't occur.
|
|
|
|
 |
|
 |
Hi All,
Can any one tell why the DataMember attribute is applying on class fields rather than Properties in WCF, I am using the Serialization.
Service Code:
[System.Runtime.Serialization.DataContract(Namespace = "http://QuickReturns")]
public partial class OTA_HotelAvailGetRQHotelAvailRequestDateRange
{
private string startField;
[System.Runtime.Serialization.DataMember(Name = "Start")]
public string Start
{
get{}
set{}
}
}
Client Side :
OTA_HotelAvailGetRQHotelAvailRequestDateRange dataRange= new OTA_HotelAvailGetRQHotelAvailRequestDateRange();
dataRange.startField= "10";
Thanks and Regards
|
|
|
|
 |
|
 |
The attribute is applied to the Start property, not the startField field. Attributes are placed above the method, class... they describe.
But having the DataMember attribute for a field is not wrong. Since you'd be telling WCF that the value of the field is to be serialized. But in your code, the only DataMember attribute is applied to the property.
Eslam Afifi
|
|
|
|
 |
|
 |
kalyan_vb wrote: why the DataMember attribute is applying on class fields rather than Properties in WCF
I'm not quite sure what you're asking here, but keep in mind
the serializer you use will also determine if the data contract
attributes are honored or not.
For example, the BinaryFormatter "serializes public and private fields
of a type".
You haven't shown what serializer you are using.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
 |
|
 |
What are the differences between Blend 2 and Blend 3? I know 3 has the SketchFlow, but I haven't played with it yet. I like the layout better in 3.
The most obvious difference I've seen so far is Blend 3 can't open any projects targeting .NET 4.0. Blend 2 gives you an error saying there's compatibility problems, but then opens it just fine.
Are there any other improvements in it, or any of the other Expression products for that matter, that justify upgrading from Expression Studio 2 to 3?
Brad
Deja Moo - When you feel like you've heard the same bull before.
|
|
|
|
 |
|
|
 |
|
 |
Hello,
I have made some helper classes to completely remove our config files. One problem I'm facing is, how do I set the performance counters in the code?
I'm having two classes:
public class ClaimsBasedServiceHostFactory : ServiceHostFactory
This is used when we host in WAS, and it returns an instance of this:
public class ClaimsBasedServiceHost : ServiceHost
As you can see we inherit ServiceHost, and this is where we do the configuration of our services.
We use Federated Security (Geneva framework), and all config works like a charm. So I guess I'm just missing some property to set the performancecounters.
Thanks for your answers.
|
|
|
|
 |
|
 |
Hi,
I am developing an application that calls a WCF service which connects to a remote server and downloads a file. The remote server returns a Stream object for each download request. Is it possible to return the stream from the WCF service to the client? Pls advice.
Thanks,
ramz_g
|
|
|
|
 |
|
|
 |
|
 |
Hi MREcoolio,
Thanks for your reply... I was able to transfer a stream to my client without any trouble when the file size is less than 64kb ("maxReceivedMessageSize" property of the "binding" element)... I understand that this is the default size limit and that we can change it to suit our requirements... But my problem is that no matter how large a number I specify for the "maxReceivedMessageSize" property, I get a communication fault exception. The following are the server and client config files for your reference.. The configuration as I said, works perfectly fine for files whose sizes are lesser than 64kb.. Am I missing something here?
Server Side App.config:
<system.serviceModel>
<bindings>
<netNamedPipeBinding>
<binding name="MyNetNamedPipeBinding" closeTimeout="01:01:00" openTimeout="01:01:00" receiveTimeout="00:10:00" sendTimeout="01:10:00" transactionFlow="false" transferMode="Streamed" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxBufferSize="10333" maxConnections="10" maxReceivedMessageSize="9223372036854775807">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport protectionLevel="EncryptAndSign" />
</security>
</binding>
</netNamedPipeBinding>
</bindings>
<services>
<service name="MyService" behaviorConfiguration="metadataSupport">
<host>
<baseAddresses>
<add baseAddress="net.pipe://localhost/MyService" />
</baseAddresses>
</host>
<endpoint address="" binding="netNamedPipeBinding" bindingName="MyNetNamedPipeBinding" contract="MyContract" />
<endpoint address="mex" binding="mexNamedPipeBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="metadataSupport">
<serviceMetadata />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Client Side App.config:
<system.serviceModel>
<bindings>
<netNamedPipeBinding>
<binding name="MyNetNamedPipeBinding" closeTimeout="01:01:00" openTimeout="01:01:00" receiveTimeout="00:10:00" sendTimeout="01:10:00" transactionFlow="false" transferMode="Streamed" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxBufferSize="131072" maxConnections="10" maxReceivedMessageSize="9223372036854775807">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport protectionLevel="EncryptAndSign" />
</security>
</binding>
</netNamedPipeBinding>
</bindings>
<client>
<endpoint address="net.pipe://localhost/MyService" binding="netNamedPipeBinding" bindingConfiguration="MyNetNamedPipeBinding" contract="MyContract" name="MyNetNamedPipeBinding">
</endpoint>
</client>
</system.serviceModel>
Thanks,
ramz_g
|
|
|
|
 |
|
|
 |
|
|
 |
|
 |
I am having trouble converting this section of code from c# to vb also not all that versed in threading. This code came from an example I found on Code project http://www.codeproject.com/KB/webservices/wcftransfer.aspx?msg=3269789
Any help would be appreciated
thanks in advance
ThreadStart start = delegate
{
form = new TProgress(null, port);
form.sport = sport;
form.Show();
form.GetThread = new Thread(new ParameterizedThreadStart(form.GetInvoke));
form.GetThread.Start(transfer);
};
HelpClass.Form.BeginInvoke(start);
Worked on my Machine!
|
|
|
|
 |
|
 |
Converting from C# to VB? Why would you want to ruin perfectly good code?
I know the language. I've read a book. - _Madmatt
|
|
|
|
 |
|
 |
Not looking for a my language is better than your language debate, just a little help that's all
Worked on my Machine!
|
|
|
|
 |
|
 |
Lighten up, no debate was called for, notice the joke icon.
However, you seem very defensive in your choice. Guilty feelings, or feelings of inadequency perhaps?
I know the language. I've read a book. - _Madmatt
|
|
|
|
 |