Hi Param,
From your description, you're encountering a "Unable to cast COM object of
type 'System.__ComObject' to interface type ..." error when try add a
webreference against a webservice which is protected by authentication,
correct?
According to processing steps you mentioned, I've perfomed some local tests
and did reproduct the same problem behavior, here is my test steps and
results:
1. Set up a webservice project which require authentication(basic or
integrated windows) and disable anonymous. When adding reference to one
asmx endpoint in this project in a client VS 2005 project, it prompt for
username/password credential, after enter the credentials, the proxy is
generated correctly.
2. After #1, try adding web reference against another asmx endpoint in the
same project, this time the service description panel in the right side of
the dialog didn't provide webservice information, but report the following
error:
====================
Unable to cast COM object of type 'System.__ComObject' to interface type
'EnvDTE.IVsExtensibility'. This operation failed because the QueryInterface
call on the COM component for the interface with IID
'{3C536122-57B1-46DE-AB34-ACC524140093}' failed due to the following error:
No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE
====================
Is this the exact behavior you met?
Also, I've tried some other tests and found that:
1. The problem is specific to Visual Studio 2005's design-time IDE
components since I can use the "wsdl.exe" utility to create the webservice
proxy externally correctly in command line.
2. The problem is specific to the webservice which require client user to
provide credentials , and will prompt credentials input dialog when visit
the WSDL document page through web browser. If we enable "anonymous
access" in the IIS server, the problems also goes away.
Regarding on this behavior, I've checked our internal product database and
did found some records describing the same issue on this and an internal
bug entry has been reported(by some other engineers). Here is some
available workarounds of this issue:
1. Instead of directly navigate to the webservice's WSDL page
(xxx.asxm?WSDL), we first view the document page in a webbrowser and save
the WSDL document into a local xml file (xxx.wsdl) on file disk. Then, we
can add web reference against that local xml file in Visual studio 2005
2. Instead of using Visual Studio 2005 "add web reference" menu, we can use
the .net framework's wsdl.exe utility to generate the proxy from
commandline and there is options that for supplying credentials when the
service require client authentication. e.g:
wsdl.exe /d:servername /u:administrator /p:password01
/out:myProxyClass.cs
http://localhost/ASPNET/WebServices/WindowsAuthService/NEWService.asmx?WSDL
#Web Services Description Language Tool (Wsdl.exe)
http://msdn2.microsoft.com/en-us/library/7h3ystb6.aspx
In addition, I will help reforward this issue to our product team.
Meanwhile, I found that there is still no record in the public product
feedback bug database below:
#Visual Studio and .NET Framework Feedback
http://connect.microsoft.com/feedback/default.aspx?SiteID=210
I would recommend you also file a bug report in the above site(with the
above information) so that our product team can also hear this from the
community and make it at a higher priority issue.
If there is any other information you wonder, please feel free to let me
know.
Thanks for your understanding!
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
param@community.nospam - 17 Aug 2006 04:46 GMT
Steve, everything you have below is correct. I will file the bug report
soon.
TIA!
> Hi Param,
>
[quoted text clipped - 110 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Steven Cheng[MSFT] - 17 Aug 2006 08:17 GMT
Thanks for your reply Param,
You can also provide the public bug report link here so that any other
community members can refer to them.
In addition, here is a brief summary of this issue:
========PROBLEM DESCRIPTION===================
When try using the "Add Web Reference" function in Visual Studio 2005 to
create webservice client proxy against multiple webservice endpoints (asmx
files) in the same webservice application. And if the webservice
application is protected by client authentication which will prompt for
client to input credentials, the IDE will report the following exception:
<<<<<<<<<<<<<<<<<
Unable to cast COM object of type 'System.__ComObject' to interface type
'EnvDTE.IVsExtensibility'. This operation failed because the QueryInterface
call on the COM component for the interface with IID
'{3C536122-57B1-46DE-AB34-ACC524140093}' failed due to the following error:
No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE
========= CAUSE==========================
This is a pure Visual Studio 2005 specific issue, the interal design-time
COM object has problem when dealing with service endpoint that will prompt
for inputting client credentials.
==========CURRENT WORK AROUND =====================
1. Visit the service description/WSDL document in external webbrowser and
save the WSDL document to local file system. And add web reference
against the local saved WSDL document in Visual Studio 2005.
2. Use the WSDL.exe command utility in .net framework to create webservice
client proxy externally.
========================================================
Thanks again for your posting and the information you provided.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.