Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET4.0
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
<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,
 
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
 
var docs = XElement.Parse(CallOriginMethod());
Posted 5-May-13 23:30pm
Comments
Prasad Khandekar at 6-May-13 6:21am
   
Does running ping http://staging.www.wwalliance.com from command prompt returns response similar to one shown below.
 
Pinging staging.www.wwalliance.com [70.47.199.158] with 32 bytes of data:
 
Reply from 70.47.199.158: bytes=32 time=817ms TTL=51
Reply from 70.47.199.158: bytes=32 time=256ms TTL=51
Reply from 70.47.199.158: bytes=32 time=256ms TTL=51
Reply from 70.47.199.158: bytes=32 time=256ms TTL=51
 
Ping statistics for 70.47.199.158:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 256ms, Maximum = 817ms, Average = 396ms
 
It's seems to be a problem with NAME resolution. Contact your IT team and check with them.
 
Regards,
ryanb31 at 6-May-13 10:25am
   
That's a weird way, in my opinion, to have a url. Shouldn't it just be staging.wwalliance.com? Why the extra www and in the middle of the url?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Dear All, Thank you for your reply. I got the solution.
 
The issue was, when i deployed on IIS , I could have pass my account details, which i haven't done and that was not allowing me to browse the url.
 
Please reach me anytime for detailed info, if not clear.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 275
1 DamithSL 265
2 CPallini 235
3 Maciej Los 185
4 George Jonsson 170
0 OriginalGriff 5,305
1 DamithSL 4,382
2 Maciej Los 3,760
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,901


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 9 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100