Tema: Re: Kaip is MSSQL2000 Stored procedure iskviesti WebService
Autorius: Giedrius II
Data: 2009-10-10 20:27:12
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1257" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18812">
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT size=2 face=Arial>Sorry, patikslinu:</FONT></DIV>
<DIV><FONT size=2 face=Arial>i pradi bandiau naudoti HTTP POST 
metod...</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face="Courier New">DECLARE @object int<BR>DECLARE @hr 
int<BR>DECLARE @sUrl varchar(1000)<BR>DECLARE @Rezult varchar(255)<BR>DECLARE 
@src varchar(255), @desc varchar(255)</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face="Courier New">SET @sUrl = 
'http://www.saitas.lt/Servisai/Utils/soapFormavimas/soap.asmx/Siuntimas'</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face="Courier New">exec @hr = sp_OACreate 
'MSXML2.ServerXMLHttp', @object OUT<BR>exec @hr = sp_OAMethod @object, 'open', 
NULL, 'POST', @sUrl, false<BR>exec @hr = sp_OAMethod @object, 
'setRequestHeader("Content-Type", "application/x-www-form-urlencoded")', 
null<BR>exec @hr = sp_OAMethod @object, 'send', null, 
'siuntejasid=833&amp;gavejasid=3053&amp;txt=testas&amp;kada='</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face="Courier New">SELECT @hr</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face="Courier New">IF @hr &lt;&gt; 0<BR>BEGIN<BR>&nbsp;EXEC 
sp_OAGetErrorInfo @object, @src OUT, @desc OUT<BR>&nbsp;SELECT @src+' : 
</FONT><A href="mailto:'+@desc"><FONT size=2 
face="Courier New">'+@desc</FONT></A><BR><FONT size=2 
face="Courier New">END<BR></FONT><FONT size=2 face="Courier New"></DIV></FONT>
<DIV><FONT size=2 face=Arial>iaip, tai galiu pasakyti bajer - neinau 
kaip,<STRONG> taiau dabar metodas suveik teisingai!</STRONG> anksiau jis lyg 
ir nemesdavo klaidos (@hr=0), taiau WebServisas neveikdavo...</FONT></DIV>
<DIV><FONT size=2 face=Arial>iandien dar kart paleidau - veikia!</FONT></DIV>
<DIV><FONT size=2 face=Arial>Kai kada utenka parayti  newsgroupsus ir 
problema pati isisprendia! :)</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Kitas klausimas:</FONT></DIV>
<DIV><FONT size=2 face=Arial><STRONG>kaip gauti WebServiso atsakym?</STRONG> 
t.y. @hr po vykdymo gauna vykdymo&nbsp;rezultat, t.y. ar jis skmingas ar ne 
(tada @hr turi klaidos kod), taiau kaip gauti WebServiso 
atsakym?</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>"Giedrius II" &lt;</FONT><A 
href="mailto:giedrius2@nonameonline.lt"><FONT size=2 
face=Arial>giedrius2@nonameonline.lt</FONT></A><FONT size=2 face=Arial>&gt; 
wrote in message </FONT><A href="news:haqeoh$pav$1@trimpas.omnitel.net"><FONT 
size=2 face=Arial>news:haqeoh$pav$1@trimpas.omnitel.net</FONT></A><FONT size=2 
face=Arial>...</FONT></DIV><FONT size=2 face=Arial>&gt; Sveiki,<BR>&gt; <BR>&gt; 
Prisireik i MS SQLServer 2000 stored procedure iaukti Web Service.<BR>&gt; 
Radau kelet pavyzdi, kuriuose naudojamas MSXML2.ServerXMLHTTP 
objektas.<BR>&gt; Pabandymui pasidariau ASP puslap ir jis ikvieia WebServis 
normaliai.<BR>&gt; Perklus algoritm  SP meta klaid - atseit neteisinga 
uklausa...<BR>&gt; Gal kas susidrs su panaia problema?<BR>&gt; <BR>&gt; G2 
<BR>&gt; <BR>&gt;</FONT></BODY></HTML>