WCF Problem

B

blutner

Hello,

I have got a little test application, which provides an WCF service
and wants to consume it as well. The access does only succeed for the
case, that the consumption is done by another application instance,
but that's not really the thing I want. My question now is, if my
problem is gernerally solveable, and if so, in which way I have to
change my code.

Thank you for your help!

Robert


-> ITestService.vb

Public Interface ITestService

Function HelloWorld() As String

End Interface


-> TestService.vb

Public Class TestService
Implements ITestService

Public Function HelloWorld() As String Implements
ITestService.HelloWorld
Return "Hello World!"
End Function

End Class


-> FrmMain.vb

Public Class FrmMain

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' Provide the service!
Dim host As New ServiceModel.ServiceHost(GetType(TestService))
host.Open()
MsgBox("Service started.")
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
' Connect to the service!
Dim address As New ServiceModel.EndpointAddress("net.pipe://localhost/
TestHost")
Dim binding As New ServiceModel.NetNamedPipeBinding()

Dim service As ITestService = ServiceModel.ChannelFactory(Of
ITestService).CreateChannel(binding, address)
MessageBox.Show(service.HelloWorld())
End Sub

End Class

--> app.config

At: http://clipboard.volectra.de/index.php?page=show&contentid=41
 
S

sloan

Dude,

You need to read your posts, before submitting.

What?? (are you asking?)

I'm not trying to be a butt, just letting you know.

Please post another message, this one is hard to read and understand.

With that:

2 things:
I have a named piped example here:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry

and there is a named pipe example at
www.idesign.net in the downloads area.
(This is a good site ... and i recommend juval lowy's book on WCF as well)

...

If you're still stumped, please create another post.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top