Results 1 to 2 of 2

Thread: [RESOLVED] ServiceContract only returning 1 of 2 functions

  1. #1
    New Member
    Join Date
    Aug 12
    Posts
    6

    Resolved [RESOLVED] ServiceContract only returning 1 of 2 functions

    Hi there. This is my second week working with WCFs, servers, web services, and VB.net so I'm a little unsure of how im describing everything(bear with me).

    I've been given a WSDL from a client to set up a web service/WCF server so that they can communicate a response sms to us. I've set up a server in visual studios 2012 as a console application in visual basic. I added the wsdl from the url they're hosting it on was have the all good stuff available to me to use(really only 2 functions, receive and test). I have a service contract that declares a public interface

    Code:
    <ServiceContract()>
    Public Interface racoSMS
        <OperationContract()>
        Function ReceiveSMS(ByVal securityKey As String, ByVal from As String, ByVal message As String) As RacoReceive.ServiceResult
        Function Test(ByVal securityKey As String) As RacoReceive.ServiceResult
    End Interface
    
    Public Class RacoSMSWCF
        Implements racoSMS
    
        Dim objFile As String = "C:\Users\lstenoj\Documents\Visual Studio 2012\Projects\RacoConsoleServer\easyA.txt"
        Dim sK As String
        Dim fM As String
        Dim msg As String
    
        Public Function ReceiveSMS(securityKey As String, from As String, message As String) As ServiceResult Implements racoSMS.ReceiveSMS
            Console.WriteLine(message.ToString)
            Return ServiceResult.ACCEPTED
        End Function
    
        Public Function Test(securityKey As String) As ServiceResult Implements racoSMS.Test
            Return ServiceResult.ACCEPTED
        End Function
    End Class
    I have a test client to see how I'm progressing and after a mix-up in instantiating the wrong class I was able to get 1 of the 2 functions in my ServiceContract.

    I'm not really sure what's holding the other function from being seen by the client.

  2. #2
    New Member
    Join Date
    Aug 12
    Posts
    6

    Re: ServiceContract only returning 1 of 2 functions

    Newby oversight.

    I didn't know I had to include <OperationContract()> for every function.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •