Solved

slow wcf calls

Posted on 2010-08-20
3
536 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now