0
在SQL Server中,我調用Web服務,但無法在提琴手上看到。我如何跟蹤從小提琴手的SQL服務器的請求?Fiddler上的SQL Server Web服務請求
PS:我試過setProxy,但沒有改變。
這是我的代碼:
--DROP PROCEDURE [dbo].[WS_IsEInvoiceUser]
CREATE PROCEDURE [dbo].[WS_IsEInvoiceUser]
@vkn varchar(20),
@username VARCHAR(50)='FreseniusMedikal',
@password VARCHAR(50)='xxxx',
@ResponseText as Varchar(8000) OUTPUT
AS
BEGIN
SET NOCOUNT ON;
DECLARE @Request INT
Declare @Body as varchar(8000) = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:UsernameToken>
<o:Username>'[email protected]+'</o:Username>
<o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">'[email protected]+'</o:Password>
</o:UsernameToken>
</o:Security>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<IsEInvoiceUser xmlns="http://tempuri.org/">
<vknTckn>'[email protected]+'</vknTckn>
<alias/>
</IsEInvoiceUser>
</s:Body>
</s:Envelope>'
EXEC sp_OACreate 'MSXML2.ServerXMLHTTP', @Request OUT;
EXEC sp_OAMethod @Request, 'setProxy', NULL, '2', 'http://127.0.0.1:8888'
EXEC sp_OAMethod @Request, 'open', NULL, 'post','https://efatura.uyumsoft.com.tr/Services/Integration', 'false'
EXEC sp_OAMethod @Request, 'setRequestHeader', null, 'SOAPAction', 'http://tempuri.org/IIntegration/IsEInvoiceUser'
EXEC sp_OAMethod @Request, 'setRequestHeader', null, 'Content-Type', 'text/xml; charset=utf-8'
EXEC sp_OAMethod @Request, 'send', null, @body
EXEC sp_OAMethod @Request, 'responseText', @ResponseText OUTPUT
SELECT CHARINDEX('true', SUBSTRING(@ResponseText, CHARINDEX('IsSucceded="true" Value="', @ResponseText)+LEN('IsSucceded="true" Value="'), 5))
Exec sp_OADestroy @Request
END
Fiddler在您當前的登錄會話中工作,但SQL Server在不同的會話中作爲服務運行。有一些方法可以將Fiddler作爲系統運行(需要同樣的東西來攔截IIS內的請求)。 – Richard