Solved

slow wcf calls

Posted on 2010-08-20
3
545 Views
Last Modified: 2013-11-12
I am using silverlight and WCF calls

My code works but it is slow. I am updating a field in a database table then i make another call to display the currect data to reflect the updated changes. The issue is on my PC there is about 1-2 for the update and new data to display.

 Public Sub webservice_updatedataPlus2Completed(ByVal sender As Object, ByVal e As ServiceReference1.updatedataPlus2CompletedEventArgs)
        If e.Result = True Then
            displayData()
        End If
    End Sub


<OperationContract()> _
        Public Function selectdata(ByVal getID As String) As List(Of sumResult)
        ' Public Function selectdata() As List(Of StudentInfo)
        Dim db2 As New trigB.Web.DataClasses1DataContext
        Dim mylist As New List(Of sumResult)
        'in the path it still says mathsTrainer1




        'what this does is get data from the database in results which is a list undeclared 'variant
        'with this list I populate each record into an existing class.


        Dim myresults = (From p In db2.sumResults _
                         Where p.id = getID _
                      Select p)

        If myresults.Count = 0 Then 'only bother if the user name exists which it will
            Dim temp As New sumResult
            temp.id = "wrong"
            mylist.Add(temp)

            Return mylist

        End If


        Return myresults.ToList



    End Function
    <OperationContract()> _
 Public Function updatedataPlus2(ByVal myid As String, ByVal sec As Integer) As Boolean
        Dim db2 As New trigB.Web.DataClasses1DataContext
        Dim temp As sumResult
        Dim mylist As New List(Of sumResult)


        'what this does is get data from the database in results which is a list undeclared 'variant
        'with this list I populate each record into an existing class.


        Dim myresults = (From p In db2.sumResults _
                        Where p.id = myid _
                        Select p)

        If myresults.Count > 0 Then 'only bother if the user name exists which it will
            For Each p As sumResult In myresults
                p.plus = p.plus + 1
                p.plusTime = p.plusTime + sec

            Next
            db2.SubmitChanges()

            Return True
        End If

        Return False

    End Function

Open in new window

0
Comment
Question by:jagguy
  • 2
3 Comments
 
LVL 1

Expert Comment

by:stuti16
ID: 33487081
Please follow the link.

http://msdn.microsoft.com/en-us/library/aa751883.aspx

also you can

-- set useDefaultWebProxy=false on binding
-- disable wcf security if not required

Hope it will help.
0
 

Author Comment

by:jagguy
ID: 33489792
not big on reading WCF in MSDN for clairty.

where do i do the below
-- set useDefaultWebProxy=false on binding
-- disable wcf security if not required
0
 
LVL 1

Accepted Solution

by:
stuti16 earned 500 total points
ID: 33503673
within web.config
set useDefaultWebProxy like this way

<bindings>
<basicHttpBinding>
<binding name="binding1" useDefaultWebProxy="true">
</basicHttpBinding>
</bindings>

And
define security as :

<bindings>
    <wsHttpBinding>
        <binding name="binding1">
            <security mode="None">
</wsHttpBinding>
</bindings>
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question