Using SQL CLR and Web Services

  • I've written a stand alone console app that happily communicates with the Web Service and am now trying to convert it to a table UDF. The code builds quite happily but fails on deployment.

    Msg 6503, Level 16, State 12, Line 1 Assembly 'microsoft.web.services3, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35.' was not found in the SQL catalog.

    Okay, thinks I, so I'll add

    CREATE ASSEMBLY MicrosoftWebServices3

    FROM 'C:\Program Files\Microsoft WSE\v3.0\Microsoft.Web.Services3.dll'

    WITH PERMISSION_SET = SAFE

    thinking that will sort it.

    and then get

    Assembly 'Microsoft.Web.Services3' references assembly 'system.configuration.install,.... which it can't find

    So, I'm wondering if I'm stuck, or if there's a better way of doing this - the Web Service insists on Microsoft.Services3

    I'll openly admit to being a novice at this level of complexity and would welcome pointers

    Regards

  • There is a tutorial you might find useful here:

    Consuming a Web Service from a SQL Server 2005 CLR Assembly[/url]

    A very similar one, with pictures:

    http://davidhayden.com/blog/dave/archive/2006/04/25/2924.aspx

    Finally, a Microsoft sample:

    http://msftengprodsamples.codeplex.com/wikipage?title=SS2005!Currency%20Web%20Service%20Sample&referringTitle=Home&ProjectName=msftengprodsamples

    Personally, I am not a huge fan of this design - it is a bit clunky, and UNSAFE assemblies make me edgy 😉

    I might look to an external component to implement the requirement, possibly communicating via Service Broker messages. YMMV 🙂

  • Thanks for this Paul

    Sorry about the delay in responding - but I took some time off over easter.

    What is YMMV?

    In the end, I managed to find some tips regarding WebService3 and suggestions for Using WCF - which I've managed to implement as a Console application. The only issue I still have is trying to implement it as an SQLCLR. I can build SQLClassLibary.dll, and generate a SQLClassLibrary.xml.serializer.dll - both of which I've added as assemblies, SQLClassLibrary and SQLClassLibraryXML (which I understand is the format) - unfortunatelyI get 'cannot load dynamically generated serialization assembly......

    so I'm gradually stumbling to a halt :ermm:

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply