3

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?

1 Answer 1

2

I have encountered similar scenario with RESTful API and (session-Enabled) Content service. This is because the (session-Enabled) Content service not aware of the environment details unless we give the Dicovery service url to it through ConfigRepository node as shown below:

<ConfigRepository ServiceUri="http://localhost:8082/discovery.svc"
    ConnectionTimeout="10000"
    CacheEnabled="true"
    CacheExpirationDuration="600"
    ServiceMonitorPollDuration="10"
    ClientId="cduser"
    ClientSecret="encrypted:o/cgCBwmULeOyUZghFaKJA=="> <!-- ClientSecret="CDUserP@ssw0rd" -->
</ConfigRepository>

Issue resolved after adding ConfigRepository in cd_storage_conf.xml of (Session-Enabled) content service. Hope this helps!

1
  • SDL Docs for (session-Enabled) Content service will be updated sooner with above information.
    – ARRX
    Mar 31, 2016 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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