|
-
Feb 10th, 2011, 07:27 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] WCF Dynamic URL?
Hey all,
I have a windows app that is being introduced to a new WCF service. I have it all working but I would like to make the client side code pull the URL to the service from the appconfig file. Not sure what I need to do here and where it needs to be done. Any links or ideas?
Thanks!
-
Feb 10th, 2011, 10:24 AM
#2
Thread Starter
Frenzied Member
Re: WCF Dynamic URL?
Trying to use this code to that I stumbled upon... eventually I'd like to throw a variable into the endpointaddress:
VB Code:
Public Shared Function GetUnprocessedPushFiles(ByVal stRegion As String) As DataTable
Dim myBinding As New WSHttpBinding
Dim myEndpoint As New EndpointAddress("http://localhost:4117/BizTalkWCFServices.svc")
Dim dtResult As New DataTable
Dim myChannelFactory As ChannelFactory(Of IService1) = _
New ChannelFactory(Of IService1)(myBinding, myEndpoint)
'Create a channel.
Dim wcfClient1 As IService1 = myChannelFactory.CreateChannel()
dtResult = wcfClient1.GetUnprocessedPushFiles(stRegion)
Dim clientChannel As IClientChannel = CType(wcfClient1, IClientChannel)
clientChannel.Close()
myChannelFactory.Close()
End Function
However when I run it, I'm getting a index out of range error. Any ideas?
-
Feb 10th, 2011, 10:28 AM
#3
Thread Starter
Frenzied Member
Re: [RESOLVED] WCF Dynamic URL?
yeah I am a dummy... should probably return something in the function... works now... thanks me! :P
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|