PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.db.ms-sqlserver > HTTP POST in SQL Server 2005
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
HTTP POST in SQL Server 2005

Réponse
 
LinkBack Outils de la discussion
Vieux 14/09/2007, 10h48   #1
Nick Chan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut HTTP POST in SQL Server 2005

hello, i have this summarized stored proc. Problem is, when using
'Send', my aspx page reads (asp.net)Request.Form as empty

However, when I use a simple html file to post, it works. Does anyone
know what's wrong?

EXEC @iHr = sp_oaCreate 'Msxml2.ServerXMLHTTP.3.0',@iObject OUTPUT

declare @data as nvarchar(max)
set @data = 'boo=yeah'

EXEC @iHr = sp_OAMethod @iObject, 'Open', null,
'POST',@smtpWebService, 0

EXEC @iHr = sp_OAMethod @iObject, 'setRequestHeader', null, 'Content-
Type', 'application/x-www-form-urlencoded'

EXEC @iHr = sp_OAMethod @iObject, 'send',null,@data

while @State<>4
begin
exec sp_oagetproperty @iObject, 'readyState', @State output
end

EXEC @iHr = sp_OAGetProperty @iObject, 'responseText',@retVal OUT

print @retVal

EXEC sp_OADestroy @iObject

  Réponse avec citation
Vieux 14/09/2007, 23h42   #2
Erland Sommarskog
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: HTTP POST in SQL Server 2005

Nick Chan (zzzxtreme@yahoo.com) writes:
> hello, i have this summarized stored proc. Problem is, when using
> 'Send', my aspx page reads (asp.net)Request.Form as empty
>
> However, when I use a simple html file to post, it works. Does anyone
> know what's wrong?


I don't understand what you mean with "html file to post" or "send",
but then I am completely ignorant about web servers and ASP.

However, whatever you are doing, you should not use the sp_OAcreate
routines in SQL 2005. Write a stored procedure in .Net instead. If
you still have to call this Msxml2.ServerXMLHTTP object you will have
to make the assembly unsafe, but I think it's still better than
having to enable sp_OAmethod and granting privileges to it, as this
is a big security risk.




--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
  Réponse avec citation
Vieux 17/09/2007, 04h30   #3
Nick Chan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: HTTP POST in SQL Server 2005

hi thanks a lot for the reply
sorry i meant, when i create a html file to submit a http post thru a
browser, it works.
but i have taken ur advice and did a .net library. was much simpler
with system.net.webclient. thanks!
On Sep 15, 5:42 am, Erland Sommarskog <esq...@sommarskog.se> wrote:
> Nick Chan (zzzxtr...@yahoo.com) writes:
> > hello, i have this summarized stored proc. Problem is, when using
> > 'Send', my aspx page reads (asp.net)Request.Form as empty

>
> > However, when I use a simple html file to post, it works. Does anyone
> > know what's wrong?

>
> I don't understand what you mean with "html file to post" or "send",
> but then I am completely ignorant about web servers and ASP.
>
> However, whatever you are doing, you should not use the sp_OAcreate
> routines in SQL 2005. Write a stored procedure in .Net instead. If
> you still have to call this Msxml2.ServerXMLHTTP object you will have
> to make the assembly unsafe, but I think it's still better than
> having to enable sp_OAmethod and granting privileges to it, as this
> is a big security risk.
>
> --
> Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
>
> Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
> Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h49.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10229 seconds with 11 queries