angular.module('n52.core.metadata', [])
    .service('sosUrlSrv', ['interfaceService',
        function(interfaceService) {
            this.getSosUrl = function(timeseries, sos) {
                var id = timeseries.parameters.service.id,
                    apiUrl = timeseries.apiUrl;
                interfaceService.getServices(apiUrl, id).then(function(service) {
                    if (service.type === 'SOS') {
                        sos.url = service.serviceUrl;
                    }
                });
            };
        }
    ]);

@@ -170,24 +170,62 @@
 ies, sos) %7B%0A
+                if (timeseries) %7B%0A    
             
@@ -291,16 +291,20 @@
         
+  
+  
 apiUrl =
@@ -319,24 +319,28 @@
 ies.apiUrl;%0A
+    
             
@@ -401,32 +401,36 @@
 tion(service) %7B%0A
+    
                 
@@ -487,16 +487,20 @@
         
+    
 sos.url 
@@ -537,26 +537,32 @@
             
-%7D%0A
+    %7D%0A  
             
@@ -569,12 +569,32 @@
     
+  
 %7D);%0A
+                %7D%0A
     

fix error in sosUrlSrv