Solved

slow wcf calls

Posted on 2010-08-20
3
553 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

632 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