473,413 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

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 NetworkCredential
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 2939
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, AssemblyDescription, 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.Reflection

#if STRONG
[assembly: System.Reflection.AssemblyVersion("1.0.0.0")]
[assembly: System.Reflection.AssemblyKeyFile("ourKey.snk")]
[assembly: AssemblyTitle("someName.dll")]
[assembly: AssemblyDescription("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
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...
1
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...
10
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...
5
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...
3
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...
1
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."...
5
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...
1
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...
1
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.