I get this message while trying to run a webservice on the browser. Note that the source code is a windows file and can\'t be changed for my need.
Com
You can fully qualify the class name when you declare your variable.
Don't do
Message msg = new Message();
Do:
ThreeDSeekUtils.Message msg = new ThreeDSeekUtils.Message();
One simple solution is to write your methods with the full namespace like:
void WriteSoapMessage(MessageBinding messageBinding, ThreeDSeekUtils.Message message, bool soap12)
You need to adjust the signature to specify the explicit namespace of the Message
class:
void WriteSoapMessage(MessageBinding messageBinding,
ThreeDSeekUtils.Message message, bool soap12)
or
void WriteSoapMessage(MessageBinding messageBinding,
System.Web.Services.Description.Message message, bool soap12)
Whichever is appropriate. Another option is to alias your namespaces in the using
block at the top of the class:
using ThreeD = ThreeDSeekUtils;
using ServicesDesc = System.Web.Services.Description;
Then you could use the aliases in shorter form:
void WriteSoapMessage(MessageBinding messageBinding,
ThreeD.Message message, bool soap12)
or
void WriteSoapMessage(MessageBinding messageBinding,
ServicesDesc.Message message, bool soap12)