Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is there a way to deploy a WCF service as part of a WSS V3 site?

18 views
Skip to first unread message

Stephen Walch

unread,
Jun 27, 2007, 12:59:08 PM6/27/07
to
Hi. We have not been able to create a Windows Communication Foundation
service that operates as part of a Windows SharePoint Services V3 (2007)
site. Ideally I would like it to work like a _layouts page in that (a) it
inherits the security of the site and (b) the service code can call into the
WSS apis and get context information about the "current site". Doing this
type of thing with "classic" ASMX web services is a common practice, but we
have not yet figured out a way to get SharePoint to forward requests for a
.svc URL to our service. Is this type of thing possible in the current
versions of WCF and WSS? Hacks welcome!

-Steve

Wei Lu [MSFT]

unread,
Jun 28, 2007, 3:33:24 AM6/28/07
to
Hello Steve,

First, you need to host the WCF services in IIS.

How to: Host a WCF Service in IIS
http://msdn2.microsoft.com/en-us/library/ms733766.aspx

Then, the IIS will host the WCF and it will pass the request for .svc to
WCF.

And you need to check onething in WCF that WCF in .NET 3.0 does not support
partial trust and SharePoint is setup to run in Partial Trust, so WCF .NET
3.0 code running under SharePoint needs to be bumped to full trust

After that, your WCF will running under Sharepoint.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Wei Lu [MSFT]

unread,
Jul 2, 2007, 3:05:54 AM7/2/07
to
Hi ,

How is everything going? Please feel free to let me know if you need any
assistance.

Vij

unread,
Jul 2, 2007, 6:02:01 AM7/2/07
to
Hi Wei Lu,

On a machine without SharePoint, I deployed my WCF service at
"C:\Inetpub\wwwroot\ServiceModelSamples" and able to see it in the browser
(on the same machine) at http://localhost/ServiceModelSamples/service.svc and
on the remote machine at
http://hosted-machine-name/ServiceModelSamples/service.svc

How can I deploy the same service on sharepoint server? I tried to deploy it
at "C:\Inetpub\wwwroot\wss\VirtualDirectories\80\ServiceModelSamples", but no
luck... I am unable to access it. what is the correct way of deploying a wcf
service on sharepoint server?

In reply to Steve, you said "you need to check onething in WCF that WCF in

.NET 3.0 does not support
partial trust and SharePoint is setup to run in Partial Trust, so WCF .NET

3.0 code running under SharePoint needs to be bumped to full trust".
Can you please elaborate on this!!

Any resouces/links will be highly appreciated.

Thanks
Vij

Wei Lu [MSFT]

unread,
Jul 3, 2007, 2:18:27 AM7/3/07
to
Hello Vij,

You need to deploy the WCF to the /_layouts folder which is c:\Program
Files\Common Files\Microsoft Shared\web server
extensions\12\TEMPLATE\LAYOUTS

Hpe this helps.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Vij

unread,
Jul 3, 2007, 4:14:03 AM7/3/07
to

Hi Wei Lu,
After deploying the WCF service, how can I make sure that the service is
properly deployed? Because I deployed the service to /_layouts folder and
when I checked it in the browser at
http://localhost/_layouts/ServiceModelSamples/service.svc, I am getting the
below given error message
-----------------------------------------------------
Error
virtualPath
Troubleshoot issues with Windows SharePoint Services.
------------------------------------------------------

Is there is any document which describes the WCF service deployment in WSS ?
I have couple of questions related to this;
1) Should I deploy precompiled WCF service DLL to /_layouts folder? OR
2) should I deploy un compiled service?

thanks
Vij

I tried to deploy

Stephen Walch

unread,
Jul 3, 2007, 11:51:13 AM7/3/07
to
No, things are not going well. I am getting the exact same error that Vij
reported. Here are some more details:

I created a WSS V3 site named http://pelican:1962. I copied my .SVC file to
the LAYOUTS directory and put the associated DLLs in my sites' BIN
directory. I edited the sites' web.config file to allow Full trust. I also
turned on debugging and display of call stacks so I got a more detailed
error message. Now when I call
http://pelican:1962/_layouts/ImportSession.svc I get the following error:

virtualPath at
Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.IsExcludedPath(String
virtualPath)
at
Microsoft.SharePoint.ApplicationRuntime.SPVirtualPathProvider.FileExists(String
virtualPath)
at
System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String
normalizedVirtualPath)
at
System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String
relativeVirtualPath)
at
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
at
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
at System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext
context)
at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)

As you can see in thye call stack, SharePoint.ServiceModel is being called,
but it is getting a problem when it tries to inteact with SharePoint's
implementation of a virtual path provider.


----- Original Message -----
From: "Wei Lu [MSFT]" <we...@online.microsoft.com>
Newsgroups: microsoft.public.sharepoint.windowsservices.development
Sent: Monday, July 02, 2007 3:05 AM
Subject: RE: Is there a way to deploy a WCF service as part of a WSS V3
site?


> Hi ,
>
> How is everything going? Please feel free to let me know if you need any
> assistance.
>

> Sincerely,
>
> Wei Lu
> Microsoft Online Community Support
>
> ==================================================
>
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
>
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no
> rights.

"Wei Lu [MSFT]" <we...@online.microsoft.com> wrote in message
news:fyyLtaVu...@TK2MSFTNGHUB02.phx.gbl...

Wei Lu [MSFT]

unread,
Jul 4, 2007, 4:03:06 AM7/4/07
to
Hello Stephen,

I am not a WCF expert. I will consulting some internal member to check this
issue. I appreciate your patience.

Stephen Walch

unread,
Jul 8, 2007, 11:05:09 AM7/8/07
to
Hi Wei Lu,

Has there been any updates on this? Since you reassured me in your 6/28
post that this was possible, we have been starting to depend on that fact.

Thanks!

"Wei Lu [MSFT]" <we...@online.microsoft.com> wrote in message

news:rvQkGHhv...@TK2MSFTNGHUB02.phx.gbl...

Wei Lu [MSFT]

unread,
Jul 9, 2007, 4:31:43 AM7/9/07
to
Hello Stephen,

I have consulted some internal team member and they have deploy the WCF on
Sharepoint. But they still not response the detailed steps and how to
troubleshoot and resolve your issue.

Wei Lu [MSFT]

unread,
Aug 3, 2007, 2:01:06 AM8/3/07
to
Hello Stephen,

Sorry for the delay response.

Some internal team member suggest to modify the trust level. You could
remove the following setting in the web.config file for the sharepoint site:

<securityPolicy>

<trustLevel name="WSS_Medium" policyFile="C:\Program Files\Common
Files\Microsoft Shared\Web Server
Extensions\12\config\wss_mediumtrust.config" />

<trustLevel name="WSS_Minimal" policyFile="C:\Program Files\Common
Files\Microsoft Shared\Web Server
Extensions\12\config\wss_minimaltrust.config" />

</securityPolicy>

<trust level="WSS_Minimal" originUrl="" />


Please let me know whether this could be help.

0 new messages