Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > pl.comp.lang.vbasic > #1

WCF Service Library - dlaczego tylko Async?

Newsgroups pl.comp.lang.vbasic
Date 2015-11-09 05:34 -0800
Message-ID <e7a27e99-7a23-4df5-bb70-374f1934a15a@googlegroups.com> (permalink)
Subject WCF Service Library - dlaczego tylko Async?
From Grzegorz Piziak <gpiziak@gmail.com>

Show all headers | View raw


Witam serdecznie,
utworzyłem WCF Service Library i podpiąłem jako referencje do projektu w tym samym Solution.

Mam dostęp do funkcji, ale tylko jako Async.

Kod WCF mam niezmieniony - wygenerowany przez VS2013.

Tylko taki mam dostęp do funkcji:

Dim sd As ServiceReference1.Service1Client = New ServiceReference1.Service1Client

        Dim r = Await sd.GetDataAsync(345)

Natomiast gdy uruchamiam z poziomy VS poniższy kod, to w "testerze" WCF mam również widoczną funkcję GetData() bez Async. Z czego to wynika? Czy nie przejmować się tym i pisać używając Async?

Dziękuję i pozdrawiam, Grzegorz.

---- KOD ----

Public Class Service1
    Implements IService1

    Public Sub New()
    End Sub

    Public Function GetData(ByVal value As Integer) As String Implements IService1.GetData
        Return String.Format("You entered: {0}", value)
    End Function

    Public Function GetDataUsingDataContract(ByVal composite As CompositeType) As CompositeType Implements IService1.GetDataUsingDataContract
        If composite Is Nothing Then
            Throw New ArgumentNullException("composite")
        End If
        If composite.BoolValue Then
            composite.StringValue &= "Suffix"
        End If
        Return composite
    End Function

End Class

----KOD Interfejsu ----

<ServiceContract()>
Public Interface IService1

    <OperationContract()>
    Function GetData(ByVal value As Integer) As String

    <OperationContract()>
    Function GetDataUsingDataContract(ByVal composite As CompositeType) As CompositeType

    ' TODO: Add your service operations here

End Interface

' Use a data contract as illustrated in the sample below to add composite types to service operations.

<DataContract()>
Public Class CompositeType

    <DataMember()>
    Public Property BoolValue() As Boolean

    <DataMember()>
    Public Property StringValue() As String

End Class

Back to pl.comp.lang.vbasic | Next | Find similar


Thread

WCF Service Library - dlaczego tylko Async? Grzegorz Piziak <gpiziak@gmail.com> - 2015-11-09 05:34 -0800

csiph-web