Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6098317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:08:40+00:00 2026-05-23T13:08:40+00:00

I have two classes in two files in a class library project, they are:

  • 0

I have two classes in two files in a class library project, they are:

Public Class Logins
    Public CurrentUser As Login
    Public Function Authenticate(ByVal id As String, ByVal pw As String)
        Dim adpt As New WorkMateDataSetTableAdapters.LoginsTableAdapter
        For Each k As WorkMateDataSet.LoginsRow In adpt.GetDataByUserName(id)
            If String.Equals(k.UserPW, pw) Then
                CurrentUser = New Login(k.UserName, k.UserPW, k.UserType)
                Return CurrentUser
                Exit Function
            End If
        Next
        CurrentUser = Nothing
        Return Nothing
    End Function
End Class

Public Class Login
    Private _UserName As String
    Private _UserPW As String
    Private _UserType As String

    Property UserName
        Get
            Return _UserName
        End Get
        Set(value)
            _UserName = value
        End Set
    End Property
    Property UserPW
        Get
            Return _UserPW
        End Get
        Set(value)
            _UserPW = value
        End Set
    End Property
    Property UserType
        Get
            Return _UserType
        End Get
        Set(value)
            _UserType = value
        End Set
    End Property
    Public Sub New()
        UserName = ""
        UserPW = ""
        UserType = ""
    End Sub
    Public Sub New(ByVal Namee As String, ByVal pw As String, ByVal typee As String)
        UserName = Namee
        UserPW = pw
        UserType = typee
    End Sub

End Class

the other class is:

public Class Courses
    Public CoursesOffered As List(Of Course)
End Class

Public Class Course
    'Cource name, Exams, Papers
    Private _CourseCategory As String
    Private _CourseID As String
    Public _Sems As New List(Of Sem)
End Class

I used a WCF service using net.tcp connection, however, the issue is that I am able to use the login original classes directly like ( Public Logins As New ServiceLogins.Logins), but I am not able to the course class like that.

Following is the code for the two WCF services:

Imports System.ServiceModel
<ServiceContract()>
Public Interface IService1

    <OperationContract()>
    Function Test(ByVal value As Integer) As WorkMateLib.Course

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

    ' TODO: Add your service operations here

End Interface

and the other file is:


Imports System.ServiceModel

' NOTE: You can use the "Rename" command on the context menu to change the interface name "ILoginsRelated" in both code and config file together.
<ServiceContract()>
Public Interface ILoginsRelated

    <OperationContract()>
    Function Authentication(ByVal login As WorkMateLib.Login) As WorkMateLib.Login

End Interface

Your help in this issue is appreciated. Thank you.

Edit:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>
    <services>
      <service name="WorkMateWCF.WorkMateWCFService1">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
          contract="WorkMateWCF.IService1">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
          contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:8523/WorkMateWCFServiceHost" />
          </baseAddresses>
        </host>
      </service>
      <service name="WorkMateWCF.LoginsRelated">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
          contract="WorkMateWCF.ILoginsRelated">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
          contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:8732/WCFLoginsHost" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

</configuration>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:08:40+00:00Added an answer on May 23, 2026 at 1:08 pm

    It’s not entirely clear what you are trying to achieve but the Course class only exposes one public property named _sem that WCF will serialize as an array of Sem type objects. You should have no problems using the Courses type in the service code but since it is not part of the service contract, it is not available to clients consuming that service contract.

    EDIT:

    To make Courses available to the clients, you could do something along the lines of this:

     '''''''Rest of contract snipped
    
     <OperationContract()>
     Function GetCourses() As WorkMateLib.Courses
    
     '''''''Rest of contract snipped
    

    The key is to add any class in the service you want exposed to clients part of the service contract by referencing it as either an input parameter or an output value of a service operation (function).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two classes: MyApplication Library The Library has already been compiled into Library.class
I have two classes, and want to include a static instance of one class
I have two classes, Foo and Bar, that have constructors like this: class Foo
I have two classes that each need an instance of each other to function.
I have two classes declared like this: class Object1 { protected ulong guid; protected
I have two classes: Action and MyAction . The latter is declared as: class
I have created a RIA services class library project and things are not going
I have two classes: Media and Container. I have two lists List<Media> and List<Container>
I have two classes A and B in two different .NET assemblies: AssemblyA and
Suppose I have two classes with the same interface: interface ISomeInterface { int foo{get;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.