web-reference

Consume WCF service using add web reference and add a soap header

你说的曾经没有我的故事 提交于 2019-12-07 19:32:50
问题 I have a WCF 4 web service that checks for a soap header. This works fine with a WCF client but I have a customer that needs to use the old web reference from their app. How do you consume a WCF service using Add Web Reference and the add a SOAP header in the client? Lets keep it simple and say I want to pass a country in a header, so the header name will be country. Thanks, Paul 回答1: You need to expose your endpoint across the basicHttpBinding in order to interoperate with pre .net 3.0

Consume WCF service using add web reference and add a soap header

不想你离开。 提交于 2019-12-06 11:11:29
I have a WCF 4 web service that checks for a soap header. This works fine with a WCF client but I have a customer that needs to use the old web reference from their app. How do you consume a WCF service using Add Web Reference and the add a SOAP header in the client? Lets keep it simple and say I want to pass a country in a header, so the header name will be country. Thanks, Paul You need to expose your endpoint across the basicHttpBinding in order to interoperate with pre .net 3.0 clients. UPDATE Does this help? http://msmvps.com/blogs/paulomorgado/archive/2007/04/27/wcf-building-an-http-user

.NET DLL Settings and Config when there's a Web Reference - whats going on?

﹥>﹥吖頭↗ 提交于 2019-12-04 12:02:31
问题 My understanding is, that .NET doesn't really 'do' config files for DLLs - only the main Executable or Web App gets a config file, and all DLLs referenced by the Executable/Web App read from that. But in VS2008, if you add a Web Reference to a Class Library (DLL) project, it adds a Settings.Settings file and an app.config file to the project. They contain the main URL for the Web Reference. So what are these files for? There's no way for the DLL to read them unassisted, right? edit: the

Adding Authorization Header to Web Reference

别来无恙 提交于 2019-12-04 10:22:07
问题 I'm attempting to make requests to a client's web service (I don't know the underlying platform at the client). I've consumed the client's WSDL in Visual Studio 2010 using "Add Web Reference" and generated my proxy class (called "ContactService"). I now need to add an authorization header like the one below to my service request. Header=Authorization & Value=Basic 12345678901234567890 (the "123456..." value above is just placeholder) ContactService service = new ContactService(); //not sure

SGEN failure: An attempt was made to load an assembly with an incorrect format in VS2008

雨燕双飞 提交于 2019-12-03 06:12:43
I was able to find several similar questions asked and answered, but none of the answers or exact conditions applied to my situation. I have a .NET 3.5 project being built for x64. I also have an x64 mixed mode reference (also targeting .NET 3.5). In Visual Studio 2008, I created a Web Reference which causes SGEN to execute during a Release build to create the helper DLL. If I don't reference the mixed-mode DLL , this works fine. If I do reference the mixed mode DLL, I get this error (xxx is just a placeholder): SGEN : error : An attempt was made to load an assembly with an incorrect format: C

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

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 13:40:56
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-clicking and selecting "Update Web Reference") side-note: What I am trying to ultimately accomplish is

Add WSSE SOAP Header to Web Reference

荒凉一梦 提交于 2019-11-30 19:38:29
I'm trying to add a WSSE SOAP Header to my service call, but most of the examples focusses on WCF. I'm not making using of WCF. I have added a Web Reference (WSDL). I have tried various methods without success, like - overriding the GetWebRequest method: protected override System.Net.WebRequest GetWebRequest(Uri uri) { string user = "username"; string pwd = "password"; System.Net.WebRequest request = base.GetWebRequest(uri); string auth = string.Format("Basic {0}", Convert.ToBase64String(System.Text.Encoding.Default.GetBytes(string.Format("{0}:{1}", user, pwd)))); request.PreAuthenticate =

Add WSSE SOAP Header to Web Reference

大兔子大兔子 提交于 2019-11-30 04:18:22
问题 I'm trying to add a WSSE SOAP Header to my service call, but most of the examples focusses on WCF. I'm not making using of WCF. I have added a Web Reference (WSDL). I have tried various methods without success, like - overriding the GetWebRequest method: protected override System.Net.WebRequest GetWebRequest(Uri uri) { string user = "username"; string pwd = "password"; System.Net.WebRequest request = base.GetWebRequest(uri); string auth = string.Format("Basic {0}", Convert.ToBase64String

How to add a Web reference Visual Studio 2012

我怕爱的太早我们不能终老 提交于 2019-11-28 06:16:01
Is it possible to add a web reference to my project in Visual Studio 2012? In Visual Studio 2010 it was possible by clicking the "Advanced" button in the "Add Service Reference" dialog, as it is written on this page : Add Web Reference in Visual Studio 2010 But in Visual Studio 2012 there is no section "Compatibility" in the "Service Reference Settings" and no "Add Web Reference" button in this dialog. I want to use SOAP web-service, but it works correctly only when I add it as Web Reference (in .NET Framework 2.0 compatibility mode. If I Add it as usual service reference I have an exception

How to add a Web reference Visual Studio 2012

爱⌒轻易说出口 提交于 2019-11-27 01:14:45
问题 Is it possible to add a web reference to my project in Visual Studio 2012? In Visual Studio 2010 it was possible by clicking the "Advanced" button in the "Add Service Reference" dialog, as it is written on this page : Add Web Reference in Visual Studio 2010 But in Visual Studio 2012 there is no section "Compatibility" in the "Service Reference Settings" and no "Add Web Reference" button in this dialog. I want to use SOAP web-service, but it works correctly only when I add it as Web Reference