473,606 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VS.NET: "Add Web Reference" w/ certifcate & login?

hello,

i am working w/ a partner company's webservice, which they wrote in
java.

using a provided webservice.wsdl file, i am able to compile it into a
proxy class, webservice.dll. i can add this assembly reference to my
test ASP.NET C# test project and use it no problem.

problem -- our production ASP.NET project uses strongly-named
assemblies. this .dll will not compile.

there are two solutions, i figure:

1) figure out how to strongly name my new proxy's .dll w/ the .snk
we're using.

2) reference the webservice via Visual Studio's "Add Web Reference" and
see if that works around the problem.

my lead is pushing towards #2. normally this should be easy.... but
this webservice is secure. it uses:

- https
- a certificate login
- a username & password NetworkCredenti al
my question: how can one make a web reference in VS.NET to something
like this? when i enter the URL to its WSDL in IE like so:

https://someurl.com/theService?wsdl

...IE prompts for the certifcate, then prompts for the login creds, then
lets me see the wsdl info. cool. however, in VS.NET, that doesnt
happen! i only have a URL bar, and it doesnt prompt for anything. doh..

do i tried entering my login creds inline ala:

https://username:pa******@someurl.com/theService?wsdl

....but it doesnt work.
any suggestions!?
thanks,
matt

Nov 23 '05 #1
5 2948
My opinion is styonrgly name the assembly. It is better to be strongly
named then not strongly names. So how difficult is it? Well its
actually very very easy. IN your web service proxy project add a file
called AssembyInfo.cs. in fact you ASP.Net Soultion should already
have a file with that name and you can just copy the file. Then change
the AssemblyTitle, AssemblyDescrip tion, and AssemblyVersion attributes
to appropriate defintions ofr you web service proxy. at the bottom the
file should be the snk in the AssemblyKeyFile attribute just insure the
snk file that your are going to use is in the correct realtive path to
make it easy just dump it in the main project folder. and thats it it
should take less then a minute to do and all your problems are then
solved. I am storngly against having weak named assemblies especially
something that culd be used across more than one application such as a
web service proxy.

Nov 23 '05 #2
i do not have a web proxy project for this webservice. i thought it
simpler to manually convert the .wsdl into a .cs w/ wsdl.exe, then
compile it w/ csc.exe.

i have strongly named the proxy assembly. however, i found an article
for doing it differently. to strongly name it, all i had to do was open
the proxy .cs, and add:

using System.Reflecti on

#if STRONG
[assembly: System.Reflecti on.AssemblyVers ion("1.0.0.0")]
[assembly: System.Reflecti on.AssemblyKeyF ile("ourKey.snk ")]
[assembly: AssemblyTitle(" someName.dll")]
[assembly: AssemblyDescrip tion("some desc.")]
#endif

then re-compile it w/ this switch:

/define:STRONG

....that did the trick, it plays nice with others now.

so it works. but, there is one other reason why i would prever to try
"Add Web Reference" -- i work for a major financial institution, with a
very complex production environment. they are very weary of new
contractors adding 3rd party assemblies, and would rather i find a way
to incorporate it into our project's main .dll. i was under the
impression that doing "Add Web Reference" would achieve this. am i
wrong?
thanks,
matt

Nov 23 '05 #3
Well yes youc an do that it. I won't not setup an environment where
all of my code for my entire organization builds into one assembly
though. That is why I suggested the seperate assembly, so as long as
the Main.dll can be strong named all is fine in the world. Again i
would not suggest it as a best practice

Nov 23 '05 #4
most definately all of our code is not compiled into one assembly. many
-- but theyre shared and reusable, thus the compartmental organization
makes sense. in this case, this code is only for one purpose: to allow
a specific page & class to run a webservice to our partner. so
considering the complexity of our rollouts w/ servers across the
country, etc, it makes the most sense to try to keep this code
inclusive.

to this end, what ive done is something so simple i never thought of it
-- simply drop the proxy class .cs into my project folder. it gets
compiled into the project's main .dll. sweet.

thanks,
matt

Nov 23 '05 #5
Whatever works for you

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
11842
by: cgbusch | last post by:
"Character reference "&#c" is an invalid XML character" With JDOM and Xerces in Java, I get the above error with sequences. I need to be able to encode arbitrary char sequences in xml. any suggestions? -- CB
1
2940
by: normd | last post by:
I have a text file which contains VB.NET code. The VB.NET code is actually a Class that can contain code, which simply displays a message box or does something more complicated (i.e Excel/Word Automation, communicate with the DB and/or WebServices, talk to other classes). To achieve a complicated task, this class would need reference to other custom assemblies (not part of .net framework) that are possibly not installed to the GAC. In my...
10
5071
by: msnews.microsoft.com | last post by:
Hi, How do I add a reference in VC++.NET? In VB.NET and VC#.NET, there's an option in "Project" menu called "Add Reference". This will add a .NET DLL reference to the current project. After I add a reference, I can start using the class in the DLL as follows: Imports <TheNamespace>
5
2191
by: Trevor Andrew | last post by:
Hi There I am having some difficulty referencing Web Services. I am using Visual Studio .NET 2003, with the .NET Framework 1.1, and trying to write a VB.NET Windows Application that consumes an external Web Service When I endeavour to use the "Add Web Reference" and select a URL which I know returns a WSDL file, I get prompted with the "Open, Save, Cancel or More Info" dialog box that I am familiar with in IE. If I select Open, it opens it...
3
1727
by: Samuel R. Neff | last post by:
I just started having a problem with the Add Reference dialog not displaying in VS.NET 2003. Whenever I click Add Reference the dialog doesn't display. I've tried several different projects and solutions and rebooted the computer. No error message, just no dialog. Add Web Reference brings up a dialog, just Add Reference doesn't. If I add references manually by editing the project file in notepad
1
2162
by: SrDhUS | last post by:
I get the following error when I try to add a web reference using Web Reference Dialog (VS .Net 2003) Error "The proxy settings on this computer are not configured correctly for web discovery." MSDN says: "The proxy settings on this computer are not configured correctly for Web discovery.
5
10320
by: Mike Logan | last post by:
I used WSDL.exe to generate a client side web proxy for a web service, called the web service, got the results but an array returned by the web service is not in the results. However if I use "Add Web Reference" for the same service the same function works appropriately. Here is the client proxy generated from WSDL.exe <System.Web.Services.Protocols.SoapDocumentMethodAttribute("capeconnect:AppSec:AppSecPortType#getApplicationUsers",
1
1246
by: mulham.haffar | last post by:
Hi, im writing an application that uses tcpclient to connect. I have a class which makes the whole network stuff.. As below: Public Class Connections Private Client as tcpclient Private Stream as network stream Public Sub Connect() Client.Connect(..)
1
5113
by: abtandon | last post by:
Hi, I am using VS 2008 Team Suite for my ATL application, at one point I needed to "Add web reference", but I found it disbaled. I used the same application in VS 2005, but that was not the case in VS 2005. When I am creating web application (ASP.NET), Add web reference is enabled in the context menu, when you right click on the project. Please tell me what needs to be done to enable this option? Thanks in advance. Regards,
0
8009
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7939
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8078
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8299
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6753
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5962
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3964
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2442
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1548
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.