Click here to Skip to main content
15,894,540 members

The remote name could not be resolved: 'staging.www.wwalliance.com'

Shrilata Ellaboina asked:

Open original thread
I am using one rest service in my application. when I run the solution everything working fine
but when I publish the solution and browse it throwing the below error.

What all I tried ,

1. added below code in web.config
XML
<system.net>
      <defaultProxy enabled="true" useDefaultCredentials="true">
      <proxy usesystemdefault="True"/>  
    </defaultProxy>
  </system.net>

2. on internet tool added into trusted site the url http://staging.www.wwalliance.com
3. whet to proxy at internet tools and bypassed it with
http://staging.www.wwalliance.com\*
still no use, could you please help.

code which is used in application is below,

C#
string   CallOriginMethod()  
           {                       
                string uri = "http://staging.www.wwalliance.com/webservice/rest/globalrateorigin/origin.xml?";
          
                string Method = "POST";
            HttpWebRequest req = WebRequest.Create(uri) as HttpWebRequest;
            req.KeepAlive = false;
            req.Method = Method.ToUpper();

            if (("POST,PUT").Split(',').Contains(Method.ToUpper()))
            {

                string stringxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
   " <GlobalrateoriginRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"WWA_Rate_Lookup_origins_request_version_2.0.1.xsd\">" +
  "<GlobalrateoriginEnvelope><SenderID>test_agility</SenderID><ReceiverID>restapi</ReceiverID><Password>01870fa4b08a1</Password><Type>Globalrate_Origin_Request</Type> " +
     "<Version>2.0.1</Version><EnvelopeID>123</EnvelopeID></GlobalrateoriginEnvelope><GlobalrateoriginRequestDetails><Date>2013-04-25</Date><Customeralias>AGILITY</Customeralias>" +
   "</GlobalrateoriginRequestDetails></GlobalrateoriginRequest>"; 
             
                byte[] buffer = Encoding.ASCII.GetBytes(stringxml);
                
                req.ContentLength = buffer.Length;
                req.ContentType = "text/xml";
                Stream PostData = req.GetRequestStream();
                PostData.Write(buffer, 0, buffer.Length);
                PostData.Close();
              
            }
               // declare & read response from service
            HttpWebResponse resp = req.GetResponse() as HttpWebResponse;
               // set utf8 encoding       
               Encoding enc = System.Text.Encoding.GetEncoding(1252);     
                   // read response stream from response object    
               StreamReader loResponseStream = new StreamReader
                   (resp.GetResponseStream(), enc);
               String strResult = string.Empty;
               // read string from stream data    
               strResult = loResponseStream.ReadToEnd();      
               // close the stream object    
               loResponseStream.Close();     
               // close the response object   
               resp.Close();
               return strResult;
           }

that method we are calling on page load as below

C#
var docs = XElement.Parse(CallOriginMethod());
Tags: C#, ASP.NET4.0

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900