Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I created a custom web service in my sharepoint using CSKDev template. Everything looks good when I'm testing my service locally. But problems came up when I decided to test it on our sample farm with Internet access.

Assuming we have local domain named foo.local, and two load-balanced servers - web1 and web2. Our site can be accessed from outside via eg. sharepoint.foo.com. The problem is that when I try to access service metadata, I find that additional wsdl schemas are pointing locally, not externally, eg. accessing site http://sharepoint.foo.com/_vti_bin/IntegrationServices/PortalMessageService.svc/mex

results in wsdl with reference to:

<xsd:import schemaLocation="https://web1.foo.local/_vti_bin/IntegrationServices/PortalMessageService.svc/mex?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" /> 

web1.foo.local is not accessible from Internet, so how to fix this? What should I do to make additional schemas available by the external address of our portal?

EDIT 1:

When I open my service metadata with WcfTestClient and open Client.dll.config, I can see three bindings looking the same and three endpoints where only first has configured address.

share|improve this question
add comment

2 Answers 2

Please check the endpoint address and see if defining it to sharepoint.foo.com does the trick.

Also I ran into this where you have multiple suggestions, specifically instructions in how to configure the endpoint of the mex.

share|improve this answer
    
I don't have any XML configuration at all since sharepoint does all the configuration. I also can't change host header because I have and SSL binding with certificate without wildcard. –  jjczopek Jan 24 '12 at 12:29
add comment

This was the same problem with ASP.NET WSDL web services in SharePoint 2007, and why originally you had to create custom WSDL generation pages. This has been fixed in SharePoint 2010 by using SharePoint service factories.

If you are using the Microsoft SharePoint web service factories, the root domain should not be a problem as the WSDL generation for the endpoint is dynamic based on the URL when accessing the service. Check my blog post to see how to use the out-of-box service factories.

http://blog.sharepointbits.com/2010/04/custom-wcf-services-in-sharepoint-2010_17.html

share|improve this answer
    
I'm aware of these factories and since I created my on template provided by CKSDev, MultipleBaseAddressBasicHttpBindingServiceHostFactory is used and yet this issue is present... –  jjczopek Jan 23 '12 at 22:43
    
How are your zones configured? Do you have each Url associated with a zone on an extended web application, or are both zones on the same IIS virtual directory? –  Chris Beckett Jan 25 '12 at 9:00
    
I have one web application (no extended web application). My zones are: Default - sharepoint.foo.local, Intranet - 10.48.1.20 - load-balancer cluster address, Internet - sharpoint.foo.com, Ekstranet - XXX.XXX.XXX.XXX (public IP address) –  jjczopek Jan 26 '12 at 12:24
    
I think your approach of multiple zones mapped to the same virtual web application may be at the root of the problem. The Service Host factory is using the URL of the default zone within the context of the virtual web application. I would suggest extending the web application for a zone, instead of using alternate access mappings with the same default web application. –  Chris Beckett Jan 26 '12 at 18:22
    
I'll try this out and come back to share results with you. –  jjczopek Jan 26 '12 at 19:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.