|
Dear All,
We are using multiple WCF service in our silverlight project.
The problem is when we leave the service Idle for 3-4 minutes
we get problem. The exception is below::
{System.ServiceModel.CommunicationException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.
at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)
--- End of inner exception stack trace ---
at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
--- End of inner exception stack trace ---
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
at TS.HrmsPortalApp.ExpenseSVC.ExpenseSVCClient.ExpenseSVCClientChannel.EndGetExpensePolicyDetail(IAsyncResult result)
at TS.HrmsPortalApp.ExpenseSVC.ExpenseSVCClient.TS.HrmsPortalApp.ExpenseSVC.ExpenseSVC.EndGetExpensePolicyDetail(IAsyncResult result)
at TS.HrmsPortalApp.ExpenseSVC.ExpenseSVCClient.OnEndGetExpensePolicyDetail(IAsyncResult result)
at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)}
The service works fine and keeping service idle for only 2-3 minutes throws the above exception. We have set the timeout to 20 minutes. I don't know what exactly the problem is.
I would be very thankful to all of you if you could help me to get this problem resolved.
I have already increased the max sizes for various parameters.
Vinod Kumar Prajapati
Software Engineer
Tirsoft Systems Pvt Ltd
|
|
|
|
|
Hi Vinod,
Have you updated both the server web.config and the client Servicereference.Clientconfig, with the longer timeout settings?
Cheers,
Daniel
|
|
|
|
|
hi,
I need some help!!!
I have got two tables. Products and Producers. I receive both from my sql database and save them with dataadpter into two datatables and connect them by the datarelation. Both tables are in a dataset.
Product has the columns ID, productname and producerID. And some more, but they are not important for my question.
Producer has the columns ID and producername.
The relation should be clear by columnnames.
What i want:
i have a textblock and a dataset below. The dataset should contain all the products. In the textblock should be displayed the name of the producerscompany.
But this doesnt work, i cant bind the relation and then the name ( Binding producerrelation.producername)
On the other way, master/detail the binding to a relation is working, but i cant bind from detail to mastertable.
Does anybody know how??
Before i was trying this i used linqtosql, but it had such a bad performance that i decided to use ADO.net components.
With linq it was working fine.
Thanks a lot
|
|
|
|
|
In my Silverlight application, I occasionally need to send off async WCF requests to multiple WCF hosts. This works correctly, except when I get my responses back I find that I have no idea who sent them.
Instead of adding information about the caller to the response, I've added public object Tag to the XYZClient reference implementation generated by the Service Reference function. I can extract XYZClient from the sender and easily identify the connection, but it needs to be added every time the service reference is updated.
Is there an easier or preferred to tag a client with this kind of information?
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Aaron Stubbendieck wrote: This works correctly, except when I get my responses back I find that I have no idea who sent them.
I cannot understand your problem exactly. Silverlight uses async service calls, and each call has an async callback method, so the call has to come back to the async call back method right?
|
|
|
|
|
Maybe a code sample will help:
void MyFunction()
{
foreach(MyObject mo in MyObjectList)
{
XYZClient Client = new XYZClient(mo.Endpoint, ...);
Client.MyCallCompleted+=newMyCallHandler(CallCompleted);
Client.MyCallAsync(mo.ID);
}
}
void CallCompleted(object Sender, MyCallArgs e)
{
}
I need to call a different WCF based on a parameter in MyObject. MyCall is called for each of these services, but they all have the same event handler (CallCompleted). When I get the CallCompleted event, I don't know which MyObject is associated with the return, but I do get the same XYZClient back in the Sender parameter.
I add a Tag property to the XYZClient and tag it with Client.Tag=mo before making the async call, what way I know which mo is associated with the CallCompleted event.
My method works, but has to be re-added everytime I update the service reference. Is there a better way to do this?
modified 12-Jul-20 21:01pm.
|
|
|
|
|
I understand your issue now - have a look at the UserState object (returned in an async call).
See here[^] for more information.
|
|
|
|
|
Exactly what I needed, thank you!!
modified 12-Jul-20 21:01pm.
|
|
|
|
|
You are welcome.
|
|
|
|
|
Normally, to set style using C#, I write,
<br />
btn.Style = (Style)FindResource(_styleName);<br />
But what to do, if style is defined inside main 'ResourceDictionary', and button is inside some 'UserControl'. Also, we have to write script inside 'UserControl' only.
|
|
|
|
|
Hi all..
I ran into an issue while implementing BITS, the problem is while creating a job in BITS we have to send the local path (physical path like c:/doc/sample.txt) but Silverlight will not give us the physical path or fullpath. It says access denied.
How to get the physical path or fullpath of the file in silverlight?
Thanks
Nitin C.N
|
|
|
|
|
Silverlight doesn't allow access to client-side files. If you're talking about a server side file, look at the HtmlPage.Document object - you might be able to get it from that.
What is "BITS"?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
|
|
In addition to John's answer, if you are using WCF to communicate to BITS (Im not sure what that is), you can get the path via WCF.
|
|
|
|
|
Hi Nitin,
I think, I already answered your query through Twitter & my Blog.
You can't get the physical path in Silverlight (assume you want the client side path).
If you want server side path, it is easy to do in your server side code & return thru service call.
But, as it is Silverlight, I assume, you want the path of client PC. No, you can't. There are some security reason while the application is running inside the browser sandbox.
If you install it as fully trusted out-of-browser application, you can get it.
Read the Article for some reference: File Explorer using Silverlight 4 COM Interoperability[^]. It may help you.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
Hi everyone,
I've got a Listbox which its itemsSource is binded with a large amount of data.
The binding is very slow so I would like to show a waiting message while the listbox is binding the data.
I need to know when the databinding has finished, does anybody know how do I do it?
Thanks in advance, and forgive me for my broken english!
|
|
|
|
|
I wouldn't bind to a large amount of information in one go if I were you. Using virtualisation you bind to only the data you need at that time, which should make your UI much more responsive.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I HAVE TO do it.
If it was for me I would have paged the results, but I have to load all the data from a datasource.
Thatz why I need to show a 'waiting message' while binding the data.
|
|
|
|
|
I have no problem adding an image via code if I am adding the image to the canvas of a WPF window. However I am so far unable to get the image to show if I am adding the image to a custom control that contain a canvas inside.
My setup is like this:
1) WPF Window contains a canvas: WindowCanvas
2) On the WindowCanvas, I am adding several CustomControls
3) Inside a CustomControl, I am in the XML file specifying a canvas that I give a name "ControlCanvas"
4) In the code of my application I am able to add TextBox & Ellipse etc. to an instance of the CustomControl's ControlCanvas. However, adding a Image via code to a CustomControl's ControlCanvas does not work - nothing is shown.
Image myImage;
BitmapImage myBitmap = new BitmapImage();
myBitmap.BeginInit();
myBitmap.UriSource = new Uri("Resources/Test.JPG", UriKind.Relative);
myBitmap.EndInit();
myImage = new Image();
myImage.Source = myBitmap;
myImage.Stretch = Stretch.Uniform;
myImage.Margin = new Thickness(0);
myImage.Width = 400;
myImage.Height = 266;
myImage.Visibility = Visibility.Visible;
Ellipse myEllipse = new Ellipse();
myEllipse.Width = 10;
myEllipse.Height = 20;
myEllipse.Fill = new SolidColorBrush(Colors.Red);
Custom_userControl myUserControl = new Custom_userControl();
main.TopWindow.VirtualDesktopTopCanvas.Children.Add(myUserControl);
myUserControl.myCanvas.Children.Add(myEllipse); ;
myUserControl.myCanvas.Children.Add(myImage);
|
|
|
|
|
Hi,
I created ListView with 2 column -
and i want to add item with with 2 text ( each text will be in different column )
How can i do it on the xaml ?
Thanks.
P.S: Each time i try to add by writing
<listviewitem background="#FF00D3FF" content="TextCulumn1, TextCulumn2">
I get the same text on the both column. . . .
|
|
|
|
|
Post your code. May be that would help us to understand you problem.
In a high level, it seems you are binding same property to both columns.
|
|
|
|
|
The Xaml code
<br />
<br />
<ListView.View><br />
<GridView><br />
<GridViewColumn Width="160" Header=" Header 1 " /><br />
<GridViewColumn Width="160" Header=" Header 2 " /><br />
</GridView><br />
</ListView.View><br />
<ListViewItem Background="#FF00D3FF" Content="Col1_Text, Col2_Text" ToolTip="......" /><br />
<br />
|
|
|
|
|
Guys,
Someone can please help me with this question
|
|
|
|
|
I've been playing with some data bindings recently and I've noticed sometimes I mess something up. Whatever happens prevents the application from shutting down completely. It hangs on a native call to GetMessageW() after my main window has closed.
I'm looking for any help or ideas on how to figure out where my problem might be without removing all bindings and putting them in one by one. I've also been adding my own dependency properties and am not sure if those could be causing the problem.
Brad
Deja Moo - When you feel like you've heard the same bull before.
|
|
|
|