Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

calling different servers

Update your Vista Drivers Update Your Drivers Now!!
 
 
Thread Tools Display Modes
Old 05-17-2007   #1 (permalink)
dshemesh
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 SpecsSystem Spec
Old 05-17-2007   #2 (permalink)
Arkady Frenkel
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 SpecsSystem Spec
Old 05-17-2007   #3 (permalink)
dshemesh
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 SpecsSystem Spec
Old 05-17-2007   #4 (permalink)
Marc Gravell
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 SpecsSystem Spec
Old 05-17-2007   #5 (permalink)
dshemesh
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 SpecsSystem Spec
Old 05-17-2007   #6 (permalink)
dshemesh
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 SpecsSystem Spec
Old 05-17-2007   #7 (permalink)
Marc Gravell
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 SpecsSystem Spec
Old 05-21-2007   #8 (permalink)
Marc Gravell
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 SpecsSystem Spec
Old 06-14-2007   #9 (permalink)
-=B3N=-
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 SpecsSystem Spec
Old 06-14-2007   #10 (permalink)
Marc Gravell
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 SpecsSystem Spec
 

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


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51