all!
I am trying to use DynamicMappingsRetriever to get publication mappings. I have a publication with ID 2 mapped to a web application http://localhost:82.
When I run this for example:
mappingsRetriever.GetPublicationUrls(2)
I get
2016-03-03 13:57:55 TRACE [Sdl.Web.Delivery.Service.AbstractServiceClient<RegisterService>b__13] - v4 service : GET http://mymachine:8083/client/v4/content.svc/GetPublicationUrlsFunctionImport(PublicationId='2')
Count = 0
In the log of my session enabled content service I find this:
INFO DynamicContentProvider - Publication with id '2' not found in Web application with path '/'
4 times.
I checked both the topology and delivery side.
http://localhost:81/ttm201501/Mappings
{
"@odata.context":"http://localhost:81/ttm201501/$metadata#Mappings","value":[
{
"Id":"visitorswebmapping","ExtensionProperties":[
],"CmEnvironmentId":"Tridioncm_local","PublicationId":"tcm:0-2-1","EnvironmentPurpose":"Staging","WebApplicationId":"visitorsweb_RootWebApp","RelativeUrl":"/","PrimaryMappedUrl":"http://localhost:82/","IsOffline":false
}
]
}
and http://mymachine:8082/discovery.svc/WebApplications('visitorsweb_RootWebApp')
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns:metadata="http://docs.oasis-open.org/odata/ns/metadata" xmlns:data="http://docs.oasis-open.org/odata/ns/data" xmlns="http://www.w3.org/2005/Atom" metadata:context="http://mymachine:8082/discovery.svc/$metadata#WebApplications" xml:base="http://mymachine:8082/discovery.svc">
<id>http://mymachine:8082/discovery.svc/WebApplications</id>
<title></title>
<updated>2016-03-03T12:02:35.965Z</updated>
<link rel="self" title="WebApplications" href="WebApplications"></link>
<entry>
<id>http://mymachine:8082/discovery.svc/WebApplications('visitorsweb_RootWebApp')</id>
<title></title>
<summary></summary>
<updated>2016-03-03T12:02:35.965Z</updated>
<author>
<name>SDL OData v4 framework</name>
</author>
<link rel="edit" title="WebApplication" href="WebApplications('visitorsweb_RootWebApp')"></link>
<link rel="http://docs.oasis-open.org/odata/ns/related/WebCapability" type="application/atom+xml;type=entry" title="WebCapability" href="WebApplications('visitorsweb_RootWebApp')/WebCapability"></link>
<link rel="http://docs.oasis-open.org/odata/ns/relatedlinks/WebCapability" type="application/xml" title="WebCapability" href="WebApplications('visitorsweb_RootWebApp')/WebCapability/$ref"></link>
<link rel="http://docs.oasis-open.org/odata/ns/related/PublicationMappings" type="application/atom+xml;type=feed" title="PublicationMappings" href="WebApplications('visitorsweb_RootWebApp')/PublicationMappings"></link>
<link rel="http://docs.oasis-open.org/odata/ns/relatedlinks/PublicationMappings" type="application/xml" title="PublicationMappings" href="WebApplications('visitorsweb_RootWebApp')/PublicationMappings/$ref"></link>
<category scheme="http://docs.oasis-open.org/odata/ns/scheme" term="#Tridion.WebDelivery.Platform.WebApplication"></category>
<content type="application/xml">
<metadata:properties>
<data:id>visitorsweb_RootWebApp</data:id>
<data:ContextURL>/</data:ContextURL>
<data:BaseURLs metadata:type="#Collection(Tridion.WebDelivery.Platform.BaseURL)">
<metadata:element>
<data:Protocol>http</data:Protocol>
<data:Host>localhost</data:Host>
<data:Port metadata:type="Int32">82</data:Port>
</metadata:element>
</data:BaseURLs>
<data:ExtensionProperties metadata:type="#Collection(Tridion.WebDelivery.Platform.WebKeyValuePair)"></data:ExtensionProperties>
</metadata:properties>
</content>
</entry>
</feed>
I also checked other service calls and most of them give expected responses apart from GetPublicationUrlsFunctionImport.
Both Broker and Discovery databases have records of host localhost and port 82 in the CONFIGURATION_VALUE and I see 2 as ID for PublicationMappings in CONFIGURATION_ITEM.
I also executed Sync-TtmCdEnvironment for my CD environment.
What am I missing?