web-reference

How to change Location(Url) of a Web Service and Update Web Reference programmatically?

℡╲_俬逩灬. 提交于 2019-12-19 11:44:27
问题 I have web service: http://127.0.0.1/something/someWS.asmx I am adding this as a Web Reference to my app but wont always be Localhost... it might change to http://www.something.com/something/someWS.asmx. How do I change the URL programmatically of my Web Reference? is it as simple as: using (var service = new MyApi.MyApi()) { //txtUrl is the site service.Url = "http://" + txtUrl + "something/someWS.asmx"; } ALSO, once I change it, how do I update it programmatically? (equivalent to right

Add a web reference to a project but make the auto-generated proxy classes internal (i.e. not public)

岁酱吖の 提交于 2019-12-12 13:16:16
问题 I'm building a class library that uses a web reference in its data access layer, but much to my dismay, there doesn't seem to be an acceptable way to set the access for the auto-generated proxy classes. By default, they're public , but I don't want to expose the proxy classes outside the library. I've found this on MSDN, but all the answers indicate manually altering the proxy classes to set the access modifiers. Not surprisingly, the proxy classes all have this at the top: //----------------

C# Getting XML SOAP response from autogenerated Reference.cs in Visual Studio

泄露秘密 提交于 2019-12-12 11:18:57
问题 In visual studio 2008 using .net 3.5 i have consumed a WSDL which has automatically generated a Reference.cs. This was done by right clicking on References in my project and selecting "Add Web Reference" Using this i can post to the web service and get valid responses through my ref and out objects. postValues() is a void method. webService.postValues(ref value1, ref value2, out value3); Using WireShark i can see the the request and full soap response on my network. What im trying to figure

Add Service Reference to WCF Service within Same Project

自闭症网瘾萝莉.ら 提交于 2019-12-12 04:24:15
问题 Is it an acceptable programming practice to add a Service Reference to a Project where the Service being referenced is defined within the same VS Project? (Service and Service Reference are in the same Project) example: MyWebAppProj -Services --MyService -Service References --MyServiceServiceReference.MyServiceClient -Default.aspx.cs uses MyServiceServiceReference.MyServiceClient The rational behind this is that a Silverlight App may be added to the Project. If it is, we would have to expose

Web Reference works, but A Service Reference complains about Soap version

风格不统一 提交于 2019-12-12 00:08:37
问题 I have to connect to a legacy web service. In visual studio, if I do a Add Service Reference, then enter the url of the WSDL file on server. My service shows up, and I write the code against it. But when I run the code I get this error: System.ServiceModel.CommunicationException: The envelope version of the incoming message (Soap12 (http://www.w3.org/2003/05/soap-envelope)) does not match that of the encoder (Soap11 (http://schemas.xmlsoap.org/soap/envelope/)). Make sure the binding is

How to Add Web Reference for UWP in VS 2015?

我怕爱的太早我们不能终老 提交于 2019-12-11 10:06:01
问题 I am trying to migrate my code from normal wpf application to Universal Windows Platform. Previously I have used VS 2012 for Developing my WPF application And its working fine. Now I want to use the same application for mobile also.I found UWP as a solution for it. Now I am using vs 2015 . But here in vs 2015 I am unable to find Web Reference Option I am able to see only Service Reference. Actually My situation is I am Dynamically taking Ip Address and port number from User Based on the

Unable to add a secure web reference in VS.Net 2010

老子叫甜甜 提交于 2019-12-11 06:43:22
问题 Background: I've been tasked with creating a single sign on solution which will redirect our internal users to a vendor's web application. I've set it up as an ASP.Net project which will call a web service provided by the vendor. This service will return a URL and a token to be used to sign in to the vendor's site. All this is to be done securely. Problem: When using Visual Studio's Add Web Reference dialog to download the WSDL and generate the required proxy class, I get the following error:

How do you add a web reference through a proxy/firewall?

北城以北 提交于 2019-12-10 18:08:00
问题 I'm behind a firewall at work at the moment and I was testing something that I had deployed to my website, and the work proxy seems to be blocking it somewhat. Basically I am getting a message of: Operation is not valid due to the current state of the object I've got it down to my proxy interferring, but I can't see any advanced settings or anything I can set up to go through my proxy to get to my service. I did a quick google for it, but no joy. Anyone found a quick way to get around it? 回答1

Changing the namespace for a Web Reference in a Project to be Made Into a VS Project Template

拈花ヽ惹草 提交于 2019-12-10 13:36:01
问题 When I add a web reference to a project, it comes up with a default namespace of: com.wpdevs.myservice. This is the namespace I'd have expected it to use in the application. When I add the using statement to the project, I have to add: using MyProject.com.wpdevs.myservice; I'd like to find a way to eliminate having to reference the project name in the using statement. The project I'm putting together now is destined to be converted into a VS Project template and having that rather strange

Where do I set the CookieContainer on a Service Reference?

落爺英雄遲暮 提交于 2019-12-08 14:48:47
问题 When adding WebService Reference to an ASMX Service on a .NET 2.0 project for example, var objService = new NameSpace.groupservices(); there exists, objService.CookieContainer = new System.Net.CookieContainer(); When adding ServiceReference to an ASMX Service on a .NET 4.0 project for example, var objService = new NameSpace.groupservicesSoapClient(); there isn't any CookieContainer property for objService A similar question was asked here with no positive solution. Could someone please guide