IVsAddWebReferenceDlg2.AddWebReferenceDlg Method
Similar to AddWebReferenceDlg Method, but allows you to enter a default name for the Web Service, as well as use the Discovery Process to get a Discovery Session.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'宣告
Function AddWebReferenceDlg ( _
pDiscoverySession As IDiscoverySession, _
<OutAttribute> ByRef pbstrWebReferenceUrl As String, _
<OutAttribute> ByRef pbstrWebReferenceName As String, _
<OutAttribute> ByRef ppIDiscoveryResult As IDiscoveryResult, _
<OutAttribute> ByRef pfCancelled As Integer _
) As Integer
'用途
Dim instance As IVsAddWebReferenceDlg2
Dim pDiscoverySession As IDiscoverySession
Dim pbstrWebReferenceUrl As String
Dim pbstrWebReferenceName As String
Dim ppIDiscoveryResult As IDiscoveryResult
Dim pfCancelled As Integer
Dim returnValue As Integer
returnValue = instance.AddWebReferenceDlg(pDiscoverySession, _
pbstrWebReferenceUrl, pbstrWebReferenceName, _
ppIDiscoveryResult, pfCancelled)
int AddWebReferenceDlg(
IDiscoverySession pDiscoverySession,
out string pbstrWebReferenceUrl,
out string pbstrWebReferenceName,
out IDiscoveryResult ppIDiscoveryResult,
out int pfCancelled
)
int AddWebReferenceDlg(
[InAttribute] IDiscoverySession^ pDiscoverySession,
[OutAttribute] String^% pbstrWebReferenceUrl,
[OutAttribute] String^% pbstrWebReferenceName,
[OutAttribute] IDiscoveryResult^% ppIDiscoveryResult,
[OutAttribute] int% pfCancelled
)
abstract AddWebReferenceDlg :
pDiscoverySession:IDiscoverySession *
pbstrWebReferenceUrl:string byref *
pbstrWebReferenceName:string byref *
ppIDiscoveryResult:IDiscoveryResult byref *
pfCancelled:int byref -> int
function AddWebReferenceDlg(
pDiscoverySession : IDiscoverySession,
pbstrWebReferenceUrl : String,
pbstrWebReferenceName : String,
ppIDiscoveryResult : IDiscoveryResult,
pfCancelled : int
) : int
Parameters
- pDiscoverySession
Type: Microsoft.VisualStudio.Shell.Interop.IDiscoverySession
[in] Session to use to add the Web service. Can be nulla null reference (Nothing in Visual Basic).
- pbstrWebReferenceUrl
Type: System.String%
[out] Pointer to a string containing the Web reference URL.
- pbstrWebReferenceName
Type: System.String%
[out] Pointer to a string containing the Web reference name.
- ppIDiscoveryResult
Type: Microsoft.VisualStudio.Shell.Interop.IDiscoveryResult%
[out] pointer to IDiscoveryResult from which you can call the .AddWebReference Method. You can pass nulla null reference (Nothing in Visual Basic) if you don't need this pointer.
- pfCancelled
Type: System.Int32%
[out] Pointer to a flag, true indicating cancelled.
Return Value
Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
From compsvcspkg.idl:
HRESULT IVsAddWebReferenceDlg2::AddWebReferenceDlg(
[in] IDiscoverySession* pDiscoverySession,
[out] BSTR* pbstrWebReferenceUrl,
[out] BSTR* pbstrWebReferenceName,
[out] IDiscoveryResult** ppIDiscoveryResult,
[out] BOOL* pfCancelled
);
If you set pDiscoverySession to nulla null reference (Nothing in Visual Basic), the environment will create a discovery session for you. For more information, see the IDiscoverySession Interface.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
IVsAddWebReferenceDlg2 Interface