473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

Sep 14 '07 #1
2 8384
Nick Chan (zz*******@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, es****@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
Sep 14 '07 #2
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.sewrote:
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

Sep 17 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: designsimply | last post by:
I am trying to http post some xml to to a remote server using php. When I try to submit xml using PEAR's HTTP_Client::post() to the remote server, I get back the following "Invalid Document Format"...
1
by: John Smith | last post by:
I'm writing a service which accepts a POST call, updates a database and returns raw HTTP headers as specified below: HTTP/1.1 200 OK Content-type:text/plain Content-length:3 OK The code...
6
by: A.M-SG | last post by:
Hi, I have an aspx page at the web server that provides PDF documents for smart client applications. Here is the code in aspx page that defines content type: Response.ContentType =...
13
by: RHPT | last post by:
I am wanting to capture the XML posted by an InfoPath form with .NET, but I cannot figure out how to capture the XML stream sent back by the InfoPath form. With Classic ASP, I could just create an...
0
by: WIWA | last post by:
Hi, I want to login to a password protected website and fetch the content of the page behind. I have based my code on http://weblogs.asp.net/jdennany/archive/2005/04/23/403971.aspx. When I use...
3
by: Christian Lutz | last post by:
Hy there I have a Web Services written in Java, running on Tomcat. The Client is written in C#. When i monitor the request/Response with TCPMon (included in Tomcat) i can observer the following...
3
by: bill | last post by:
Is there a way to log the actual outgoing http post message on a Web Services client? I am calling a Java Web Services. I have to use HTTP POST in my native C++ code. What I can do is writing a C#...
2
by: Praveen | last post by:
Hi All, I have made a webservice in C# and it works fine in my machine. I ran into a crazy problem when I wanted to deploy it in windows 2003 server. I have run "aspnet_regiis.exe -i" to make...
6
by: majik92 | last post by:
Hello, I'm in the process of rewriting a program I wrote in LUA to VB.NET. So, I am still learning the language (VB). I just have a question... I have a windows form called "mainPage". I want...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.