![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | calling different servers Hello, I want to write a WCF client which each time calls a different url (or server). I know by sure that all the urls which will be called implement the same predefined wsdl (probably using WCF as well). I am new to WCF, so I tried going over the basics, and created a WCF server and client using the examples in msdn. Now, I want to change the auto generated client code (auto generated by svcutil.exe) so that I will be able to call each time a different URL and method (again, the list of possible methods are predefined by a wsdl created using a C# interface). Thank you! -- dshemesh |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: calling different servers Just merge client code received from svcutil for different services Arkady "dshemesh" <dshemesh@discussions.microsoft.com> wrote in message news:34DBA49B-7CDE-46B6-ABFE-0963B4FB0F42@microsoft.com... > Hello, > I want to write a WCF client which each time calls a different url (or > server). I know by sure that all the urls which will be called implement > the > same predefined wsdl (probably using WCF as well). > I am new to WCF, so I tried going over the basics, and created a WCF > server > and client using the examples in msdn. Now, I want to change the auto > generated client code (auto generated by svcutil.exe) so that I will be > able > to call each time a different URL and method (again, the list of possible > methods are predefined by a wsdl created using a C# interface). > > Thank you! > -- > dshemesh |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: calling different servers I don't really understand what this means. I do not know currently which urls I will call. They will be given to me when the program is already running. -- dshemesh "Arkady Frenkel" wrote: > Just merge client code received from svcutil for different services > Arkady > > "dshemesh" <dshemesh@discussions.microsoft.com> wrote in message > news:34DBA49B-7CDE-46B6-ABFE-0963B4FB0F42@microsoft.com... > > Hello, > > I want to write a WCF client which each time calls a different url (or > > server). I know by sure that all the urls which will be called implement > > the > > same predefined wsdl (probably using WCF as well). > > I am new to WCF, so I tried going over the basics, and created a WCF > > server > > and client using the examples in msdn. Now, I want to change the auto > > generated client code (auto generated by svcutil.exe) so that I will be > > able > > to call each time a different URL and method (again, the list of possible > > methods are predefined by a wsdl created using a C# interface). > > > > Thank you! > > -- > > dshemesh > > > |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: calling different servers You are you currently using your services? If you are using a ClientBase<T> derivative (where T is your service contract interface), then note that one of the ctor overloads accepts the remote address. I can't remember what svcutil spits out (for various reasons I use ClientBase<T> directly), but this might help? Marc |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: calling different servers I have the following ctors: public Service1Client() { } public Service1Client(string endpointConfigurationName) : base(endpointConfigurationName) { } public Service1Client(string endpointConfigurationName, string remoteAddress) : base(endpointConfigurationName, remoteAddress) { } public Service1Client(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : base(endpointConfigurationName, remoteAddress) { } public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : base(binding, remoteAddress) { } As you can see, none of them accepts only the remote address. I need to add a endpointConfigurationName or a Binding. I don't know which parameters I should give there because I don't know what's an endpointConfigurationName or how to create a Binding. -- dshemesh "Marc Gravell" wrote: > You are you currently using your services? If you are using a > ClientBase<T> derivative (where T is your service contract interface), > then note that one of the ctor overloads accepts the remote address. > > I can't remember what svcutil spits out (for various reasons I use > ClientBase<T> directly), but this might help? > > Marc > > > |
My System Specs![]() |
| | #6 (permalink) |
| Guest | Re: calling different servers And besides, I already have a remote address and binding defined in the config file. Wouldn't this be a problem when trying to give a different remote address? -- dshemesh "Marc Gravell" wrote: > You are you currently using your services? If you are using a > ClientBase<T> derivative (where T is your service contract interface), > then note that one of the ctor overloads accepts the remote address. > > I can't remember what svcutil spits out (for various reasons I use > ClientBase<T> directly), but this might help? > > Marc > > > |
My System Specs![]() |
| | #7 (permalink) |
| Guest | Re: calling different servers (string, string) is the one; have you tried "Default", the contract name, and or any other random strings from the config file? Don't have my code to hand, so can't check at mo - but will look tomorrow. Marc |
My System Specs![]() |
| | #8 (permalink) |
| Guest | Re: calling different servers Aah... remembered how I did it... ask WCF itself ;-p - specifically, create an instance using the default ctor, and ask what end-point it is using. Subsequently, I can link to any address by using this name along with my bespoke URL. static SimpleClient() { try { DefaultBindingName = new SimpleClient<T>.Endpoint.Name; } catch { DefaultBindingName = "Default"; } } Marc |
My System Specs![]() |
| | #9 (permalink) |
| Guest | Re: calling different servers I too am having this problem. Anyone know? "dshemesh" wrote: > And besides, I already have a remote address and binding defined in the > config file. Wouldn't this be a problem when trying to give a different > remote address? > -- > dshemesh > > > "Marc Gravell" wrote: > > > You are you currently using your services? If you are using a > > ClientBase<T> derivative (where T is your service contract interface), > > then note that one of the ctor overloads accepts the remote address. > > > > I can't remember what svcutil spits out (for various reasons I use > > ClientBase<T> directly), but this might help? > > > > Marc > > > > > > |
My System Specs![]() |
| | #10 (permalink) |
| Guest | Re: calling different servers What have you tried? And are you using svcutil proxies or a custom ClientBase<T> subclass? You need to call the ctor that includes the remote address; I posted a way to obtain the default binding name (so that you can use the simple "string,string" ctor). ? Marc |
My System Specs![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling Dr House! | Peter Phillips | Vista performance & maintenance | 0 | 08-07-2008 02:41 PM |
| calling value from CSV file... | Ben Christian | PowerShell | 4 | 02-11-2008 05:04 PM |
| Calling ID | Mary Anne | Vista mail | 3 | 02-09-2008 09:04 PM |
| calling from contacts | NetFishing | Vista mail | 3 | 06-10-2007 07:54 AM |
| Bug calling [gc]::collect() | Keith Hill [MVP] | PowerShell | 8 | 05-20-2007 03:13 AM |