Showing posts with label consume. Show all posts
Showing posts with label consume. Show all posts

Friday, March 30, 2012

How can I consume webservices on SQL 2005

Hi,
I'd like know if can I build ( and how can do ) a store procedore on MS
SQL 2005 to access a remote webservices, process it and return the result to
my client ?
Thanks,
Solli M. Honório
Hello Solli,

> I'd like know if can I build ( and how can do ) a store procedore on
> MS SQL 2005 to access a remote webservices, process it and return the
> result to my client ?
Yes.
The real trick is that you need to add build step that generates a static
proxy class. Do that by adding this as a Post-build Event Step in your SqlClr
project:
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sgen.exe" /force
"$(TargetPath)"
Note that you cannot use Visual Studio to deploy all of the needed assemblies.
You'll need to fire up SSMS or like and issue these commands:
use ...whatever database you like...
go
create assembly ...what you want to call your assembly...
from ...where the DLL is on your disk...
with permission_set = external_access
go
create assembly [...whatever your project name is... .XmlSerializers]
from '...where the DLL is on your disk...\SqlServerProject1.XmlSerializers.dll'
go
create procedure ...whatever you want to call the procedure...(...list of
parameters, if any...)
as external name Assembly Name.[fully qualified class name]. ...name of method...
go
exec ...whatever you called the procedure...
go
The guts of my stored procedure looks like:
[Microsoft.SqlServer.Server.SqlProcedure]
public static void WebMath(SqlInt32 x,SqlInt32 y)
{
SqlMetaData[] cols = new SqlMetaData[1];
cols[0] = new SqlMetaData("Result", SqlDbType.Int);
SqlDataRecord rec = new SqlDataRecord(cols);
using (SqlServerProject1.ws1proxy.ws1 proxy = new SqlServerProject1.ws1proxy.ws1())
{
rec.SetInt32(0, proxy.AddTwo(x.Value, y.Value));
SqlContext.Pipe.Send(rec);
}
}
The Web Service in question looks like:
public int AddTwo(int x,int y) {
return(x+y);
}
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/

How can I consume webservices on SQL 2005

Hi,
I'd like know if can I build ( and how can do ) a store procedore on MS
SQL 2005 to access a remote webservices, process it and return the result to
my client ?
Thanks,
Solli M. HonórioHello Solli,

> I'd like know if can I build ( and how can do ) a store procedore on
> MS SQL 2005 to access a remote webservices, process it and return the
> result to my client ?
Yes.
The real trick is that you need to add build step that generates a static
proxy class. Do that by adding this as a Post-build Event Step in your SqlCl
r
project:
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sgen.exe" /force
"$(TargetPath)"
Note that you cannot use Visual Studio to deploy all of the needed assemblie
s.
You'll need to fire up SSMS or like and issue these commands:
use ...whatever database you like...
go
create assembly ...what you want to call your assembly...
from ...where the DLL is on your disk...
with permission_set = external_access
go
create assembly [...whatever your project name is... .XmlSerializers]
from '...where the DLL is on your disk...\SqlServerProject1.XmlSerializers.d
ll'
go
create procedure ...whatever you want to call the procedure...(...list of
parameters, if any...)
as external name Assembly Name.[fully qualified class name]. ...name of meth
od...
go
exec ...whatever you called the procedure...
go
The guts of my stored procedure looks like:
[Microsoft.SqlServer.Server.SqlProcedure]
public static void WebMath(SqlInt32 x,SqlInt32 y)
{
SqlMetaData[] cols = new SqlMetaData[1];
cols[0] = new SqlMetaData("Result", SqlDbType.Int);
SqlDataRecord rec = new SqlDataRecord(cols);
using (SqlServerProject1.ws1proxy.ws1 proxy = new SqlServerProject1.ws1proxy
.ws1())
{
rec.SetInt32(0, proxy.AddTwo(x.Value, y.Value));
SqlContext.Pipe.Send(rec);
}
}
The Web Service in question looks like:
public int AddTwo(int x,int y) {
return(x+y);
}
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/sql

Monday, March 19, 2012

how can a sql server consume a web service

I am trying to figure out how I can have SQL server consume a web
service.Hello Simone,
See [0] and [1].
[0]: http://msdn2.microsoft.com/en-us/library/ms365190.aspx
[1]: http://blogs.msdn.com/sqlclr/archiv.../25/Vineet.aspx
Thanks,
Kent Tegels
http://staff.develop.com/ktegels/

how can a sql server consume a web service

I am trying to figure out how I can have SQL server consume a web
service.
Thanks for your help.
SimoneHi Simone
SQL Server 2005 can provide you with a XML Web Service, this is documented
in Books Online see http://msdn2.microsoft.com/en-us/library/ms345123.aspx or
http://msdn2.microsoft.com/en-us/library/ms191274.aspx
If you want to store information from an RSS feed in your database you may
want to check out
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/exchsqlxml.asp.
With SQL 2005 the CLR could be used to do this and there is an example in
"Pro SQL Server 2005" by Thomas Rizzo et al.
ISBN 1-59059-477-0
John
"Simone" wrote:
> I am trying to figure out how I can have SQL server consume a web
> service.
> Thanks for your help.
> Simone
>|||Hello Thanks for your reply.
We need this for SQL server 2000 and I tried to search at the Microsoft
website but I couldn't find.
Can you help me finding information for this but for SQL server 2000?
Thanks
Simone
John Bell wrote:
> Hi Simone
> SQL Server 2005 can provide you with a XML Web Service, this is documented
> in Books Online see http://msdn2.microsoft.com/en-us/library/ms345123.aspx or
> http://msdn2.microsoft.com/en-us/library/ms191274.aspx
> If you want to store information from an RSS feed in your database you may
> want to check out
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/exchsqlxml.asp.
> With SQL 2005 the CLR could be used to do this and there is an example in
> "Pro SQL Server 2005" by Thomas Rizzo et al.
> ISBN 1-59059-477-0
> John
> "Simone" wrote:
> > I am trying to figure out how I can have SQL server consume a web
> > service.
> >
> > Thanks for your help.
> > Simone
> >
> >|||Hi Simone
The ability to provide a HTTP endpoint directly in SQL Server is only
available in SQL 2005, with SQL 2000 you would need to use something like
IIS. The XML to SQL example
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/exchsqlxml.asp will work for SQL 2000 if you download SQLXML SP2 or higher.
John
"Simone" wrote:
> Hello Thanks for your reply.
> We need this for SQL server 2000 and I tried to search at the Microsoft
> website but I couldn't find.
> Can you help me finding information for this but for SQL server 2000?
> Thanks
> Simone
> John Bell wrote:
> > Hi Simone
> >
> > SQL Server 2005 can provide you with a XML Web Service, this is documented
> > in Books Online see http://msdn2.microsoft.com/en-us/library/ms345123.aspx or
> > http://msdn2.microsoft.com/en-us/library/ms191274.aspx
> >
> > If you want to store information from an RSS feed in your database you may
> > want to check out
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/exchsqlxml.asp.
> > With SQL 2005 the CLR could be used to do this and there is an example in
> > "Pro SQL Server 2005" by Thomas Rizzo et al.
> > ISBN 1-59059-477-0
> >
> > John
> >
> > "Simone" wrote:
> >
> > > I am trying to figure out how I can have SQL server consume a web
> > > service.
> > >
> > > Thanks for your help.
> > > Simone
> > >
> > >
>

how can a sql server consume a web service

I am trying to figure out how I can have SQL server consume a web
service.
Hello Simone,
See [0] and [1].
[0]: http://msdn2.microsoft.com/en-us/library/ms365190.aspx
[1]: http://blogs.msdn.com/sqlclr/archive...25/Vineet.aspx
Thanks,
Kent Tegels
http://staff.develop.com/ktegels/

how can a sql server consume a web service

I am trying to figure out how I can have SQL server consume a web
service.
Thanks for your help.
Simone
Hi Simone
SQL Server 2005 can provide you with a XML Web Service, this is documented
in Books Online see http://msdn2.microsoft.com/en-us/library/ms345123.aspx or
http://msdn2.microsoft.com/en-us/library/ms191274.aspx
If you want to store information from an RSS feed in your database you may
want to check out
http://msdn.microsoft.com/library/de...xchsqlxml.asp.
With SQL 2005 the CLR could be used to do this and there is an example in
"Pro SQL Server 2005" by Thomas Rizzo et al.
ISBN 1-59059-477-0
John
"Simone" wrote:

> I am trying to figure out how I can have SQL server consume a web
> service.
> Thanks for your help.
> Simone
>
|||Hello Thanks for your reply.
We need this for SQL server 2000 and I tried to search at the Microsoft
website but I couldn't find.
Can you help me finding information for this but for SQL server 2000?
Thanks
Simone
John Bell wrote:[vbcol=seagreen]
> Hi Simone
> SQL Server 2005 can provide you with a XML Web Service, this is documented
> in Books Online see http://msdn2.microsoft.com/en-us/library/ms345123.aspx or
> http://msdn2.microsoft.com/en-us/library/ms191274.aspx
> If you want to store information from an RSS feed in your database you may
> want to check out
> http://msdn.microsoft.com/library/de...xchsqlxml.asp.
> With SQL 2005 the CLR could be used to do this and there is an example in
> "Pro SQL Server 2005" by Thomas Rizzo et al.
> ISBN 1-59059-477-0
> John
> "Simone" wrote:
|||Hi Simone
The ability to provide a HTTP endpoint directly in SQL Server is only
available in SQL 2005, with SQL 2000 you would need to use something like
IIS. The XML to SQL example
http://msdn.microsoft.com/library/de...exchsqlxml.asp will work for SQL 2000 if you download SQLXML SP2 or higher.
John
"Simone" wrote:

> Hello Thanks for your reply.
> We need this for SQL server 2000 and I tried to search at the Microsoft
> website but I couldn't find.
> Can you help me finding information for this but for SQL server 2000?
> Thanks
> Simone
> John Bell wrote:
>

how can a sql server consume a web service

I am trying to figure out how I can have SQL server consume a web
service.
Thanks for your help.
SimoneHi Simone
SQL Server 2005 can provide you with a XML Web Service, this is documented
in Books Online see http://msdn2.microsoft.com/en-us/library/ms345123.aspx o
r
http://msdn2.microsoft.com/en-us/library/ms191274.aspx
If you want to store information from an RSS feed in your database you may
want to check out
http://msdn.microsoft.com/library/d.../>
sqlxml.asp.
With SQL 2005 the CLR could be used to do this and there is an example in
"Pro SQL Server 2005" by Thomas Rizzo et al.
ISBN 1-59059-477-0
John
"Simone" wrote:

> I am trying to figure out how I can have SQL server consume a web
> service.
> Thanks for your help.
> Simone
>|||Hello Thanks for your reply.
We need this for SQL server 2000 and I tried to search at the Microsoft
website but I couldn't find.
Can you help me finding information for this but for SQL server 2000?
Thanks
Simone
John Bell wrote:[vbcol=seagreen]
> Hi Simone
> SQL Server 2005 can provide you with a XML Web Service, this is documented
> in Books Online see http://msdn2.microsoft.com/en-us/library/ms345123.aspx
or
> http://msdn2.microsoft.com/en-us/library/ms191274.aspx
> If you want to store information from an RSS feed in your database you may
> want to check out
> http://msdn.microsoft.com/library/d...
chsqlxml.asp.
> With SQL 2005 the CLR could be used to do this and there is an example in
> "Pro SQL Server 2005" by Thomas Rizzo et al.
> ISBN 1-59059-477-0
> John
> "Simone" wrote:
>|||Hi Simone
The ability to provide a HTTP endpoint directly in SQL Server is only
available in SQL 2005, with SQL 2000 you would need to use something like
IIS. The XML to SQL example
http://msdn.microsoft.com/library/d... />
sqlxml.asp will work for SQL 2000 if you download SQLXML SP2 or higher.
John
"Simone" wrote:

> Hello Thanks for your reply.
> We need this for SQL server 2000 and I tried to search at the Microsoft
> website but I couldn't find.
> Can you help me finding information for this but for SQL server 2000?
> Thanks
> Simone
> John Bell wrote:
>