H
Holly
Hi,
We have a web service that has mutliple levels; one for test, one for
QA and the other for production. With that, we also have one C#
component that accesses the web service depending on the level. What I
want to do is be able to compile the C# component once and have a
reference to all web services. There is code in the C# component to
indicate which web service to reference based on a registry setting.
However, the problem that I am having is that it fails to compile
because there are multiple instances to the same objects in the
different web references.
So, my question is: If I have the same web service setup in three
different locations knowing one is for testing, another for QA and
another for production how can I reference the ONE web reference I
need to use without having to compile it every time it moves to each
level?
Currently I have using statements setup to access each web reference.
Example Below:
using QAWebService;
using TestWebService;
using ProdWebService;
namespace Some.Namespace.Here
{
public class SomeClass
{
//
// Connect to the appropriate web service
//
switch (wsType)
{
case "TEST":
TestWebService webService = new TestWebService();
break;
case "QA":
QAWebService webService = new QAWebService();
break;
case "Prod":
ProdWebService webService = new ProdWebService();
break;
}
//
// Instantiate/Initialize a single request shared between
// each web service.
//
SomeRequest someReq = new SomeRequest();
someReq.Version = 1;
}
}
It fails compiling on the creation of "SomeRequest" because it is
ambiguous. Can anyone help?
Thanks,
Holly
We have a web service that has mutliple levels; one for test, one for
QA and the other for production. With that, we also have one C#
component that accesses the web service depending on the level. What I
want to do is be able to compile the C# component once and have a
reference to all web services. There is code in the C# component to
indicate which web service to reference based on a registry setting.
However, the problem that I am having is that it fails to compile
because there are multiple instances to the same objects in the
different web references.
So, my question is: If I have the same web service setup in three
different locations knowing one is for testing, another for QA and
another for production how can I reference the ONE web reference I
need to use without having to compile it every time it moves to each
level?
Currently I have using statements setup to access each web reference.
Example Below:
using QAWebService;
using TestWebService;
using ProdWebService;
namespace Some.Namespace.Here
{
public class SomeClass
{
//
// Connect to the appropriate web service
//
switch (wsType)
{
case "TEST":
TestWebService webService = new TestWebService();
break;
case "QA":
QAWebService webService = new QAWebService();
break;
case "Prod":
ProdWebService webService = new ProdWebService();
break;
}
//
// Instantiate/Initialize a single request shared between
// each web service.
//
SomeRequest someReq = new SomeRequest();
someReq.Version = 1;
}
}
It fails compiling on the creation of "SomeRequest" because it is
ambiguous. Can anyone help?
Thanks,
Holly