I have to connect to a 3rd party XML Web Service outside our LAN by
adding a WCF Service Reference to a web application
When attempting to invoke any of the generated client class methods,
I recieve the following error: System.Net.WebException: The remote name could not be resolved
Iam able to run this Web application from Non Proxy Area.
However unable to run it only in Proxy area.
My Coding
XmlDocument requestXml = new XmlDocument();
string ReqXML = "My XML String";
requestXml.LoadXml(ReqXML);
string webserviceUrl = "my webservice url";
string webserviceAction = "my webservice Action";
CustomBinding customBinding = new CustomBinding();
customBinding = new CustomBinding("HttpSoap11Binding");
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>(customBinding, webserviceUrl);
IRequestChannel channel = factory.CreateChannel();
Message requestMessage = Message.CreateMessage(customBinding.MessageVersion , webserviceAction, new XmlNodeReader(requestXml));
Message responseMessage = channel.Request(requestMessage);
Response.Write(responseMessage.ToString());
My Configuration file
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="true"/>
<authentication mode="Windows"/>
</system.web>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="HttpSoap11Binding">
<textMessageEncoding messageVersion="Soap11"/>
<httpTransport useDefaultWebProxy="true" transferMode="Buffered"/>
</binding>
</customBinding>
</bindings>
</system.serviceModel>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\Traces.svclog"/>
</listeners>
</source>
</sources>
</system.diagnostics>
<system.net>
<defaultProxy useDefaultCredentials="true">
</defaultProxy>
</system.net>
</configuration>
Any help is highly appreciated.