Results 1 to 3 of 3

Thread: [RESOLVED] WCF Dynamic URL?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Resolved [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!

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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:
    1. Public Shared Function GetUnprocessedPushFiles(ByVal stRegion As String) As DataTable
    2.             Dim myBinding As New WSHttpBinding
    3.             Dim myEndpoint As New EndpointAddress("http://localhost:4117/BizTalkWCFServices.svc")
    4.             Dim dtResult As New DataTable
    5.  
    6.             Dim myChannelFactory As ChannelFactory(Of IService1) = _
    7.             New ChannelFactory(Of IService1)(myBinding, myEndpoint)
    8.  
    9.             'Create a channel.
    10.             Dim wcfClient1 As IService1 = myChannelFactory.CreateChannel()
    11.  
    12.             dtResult = wcfClient1.GetUnprocessedPushFiles(stRegion)
    13.  
    14.             Dim clientChannel As IClientChannel = CType(wcfClient1, IClientChannel)
    15.             clientChannel.Close()
    16.  
    17.             myChannelFactory.Close()
    18.         End Function

    However when I run it, I'm getting a index out of range error. Any ideas?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    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
  •  



Click Here to Expand Forum to Full Width