WEBSERVICE path changes in the deployment phase

There are two ways I know about using WebService in .NET:

First, proxy mode
The proxy mode is to first reference the WebService in the project to generate a proxy, Then operate this proxy to achieve the purpose of calling WebService.

However, in the development phase, because the WebService is referenced and the proxy is created, the WebService has a path. Then after the actual deployment, the path is different from the development phase. What should I do?

Handle it like this:

string servicepath = ConfigurationManager.AppSettings["ServicePath"];//Read the WebService path from the configuration fileBinding httpBinding = new  BasicHttpBinding();EndpointAddress httpAddress = new EndpointAddress(servicepath);SmsServiceClient proxy = n

Second, direct access
direct Access service address

using (WebClient webClient = new WebClient ()){ webClient.Encoding = Encoding.GetEncoding("utf-8"); string url = ConfigurationManager.AppSettings["ServicePath"];//Read the WebService path from the configuration file; string re = webClient.DownloadString(url);}

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3517 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.