diff --git a/smp-api/src/main/java/eu/europa/ec/smp/api/Identifiers.java b/smp-api/src/main/java/eu/europa/ec/smp/api/Identifiers.java
index 42cf810fd5e7997ff0ae9f3d4e498ba401e0bddb..e8104baf4105feda13c72e4f0d1f50df765d174e 100644
--- a/smp-api/src/main/java/eu/europa/ec/smp/api/Identifiers.java
+++ b/smp-api/src/main/java/eu/europa/ec/smp/api/Identifiers.java
@@ -18,9 +18,15 @@ import org.oasis_open.docs.bdxr.ns.smp._2016._05.DocumentIdentifier;
 import org.oasis_open.docs.bdxr.ns.smp._2016._05.ParticipantIdentifierType;
 import org.oasis_open.docs.bdxr.ns.smp._2016._05.ProcessIdentifier;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+
 /**
  * Factory and utility methods for API classes generated from OASIS XSD.
  *
@@ -56,6 +62,21 @@ public class Identifiers {
         return String.format("%s::%s", docId.getScheme(), docId.getValue());
     }
 
+    public static String asUrlEncodedString(ParticipantIdentifierType participantId){
+        try {
+            return URLEncoder.encode(asString(participantId), UTF_8.name());
+        } catch (UnsupportedEncodingException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    public static String asUrlEncodedString(DocumentIdentifier docId){
+        try {
+            return URLEncoder.encode(asString(docId), UTF_8.name());
+        } catch (UnsupportedEncodingException e) {
+            throw new IllegalStateException(e);
+        }
+    }
 
     private static String extract(String doubleColonDelimitedId, String groupName) {
         try {
diff --git a/smp-api/src/test/java/eu/europa/ec/smp/api/IdentifiersTest.java b/smp-api/src/test/java/eu/europa/ec/smp/api/IdentifiersTest.java
index 8d639f045b17616bcde950599928645bc9a1be03..64a37e8dd6a5e88ccc1f4259fc7cc49683343452 100644
--- a/smp-api/src/test/java/eu/europa/ec/smp/api/IdentifiersTest.java
+++ b/smp-api/src/test/java/eu/europa/ec/smp/api/IdentifiersTest.java
@@ -165,4 +165,22 @@ public class IdentifiersTest {
         assertEquals(MALFORMED_INPUT_MSG + negativeInput, e.getMessage());
     }
 
+    @Test
+    public void testUrlEncodingParticipantId(){
+        //given
+        ParticipantIdentifierType participantId = new ParticipantIdentifierType("0088:conformance:sg01#", "ehealth:actorid:qns");
+
+        //when-then
+        assertEquals("ehealth%3Aactorid%3Aqns%3A%3A0088%3Aconformance%3Asg01%23", Identifiers.asUrlEncodedString(participantId));
+    }
+
+    @Test
+    public void testUrlEncodingDocumentId(){
+        //given
+        DocumentIdentifier docId = new DocumentIdentifier("urn::ehealth##services:extended:epsos01::101", "busdox:docid:qns");
+
+        //when-then
+        assertEquals("busdox%3Adocid%3Aqns%3A%3Aurn%3A%3Aehealth%23%23services%3Aextended%3Aepsos01%3A%3A101", Identifiers.asUrlEncodedString(docId));
+    }
+
 }
diff --git a/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/controllers/ServiceMetadataPathBuilder.java b/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/controllers/ServiceMetadataPathBuilder.java
index 0c692555c2882839f7ab17a9d5644b0c1feba030..f3e84c855ab0a2d2755e41f1450dc6334c37d055 100644
--- a/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/controllers/ServiceMetadataPathBuilder.java
+++ b/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/controllers/ServiceMetadataPathBuilder.java
@@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.net.URI;
 
 import static eu.europa.ec.smp.api.Identifiers.asString;
+import static eu.europa.ec.smp.api.Identifiers.asUrlEncodedString;
 
 /**
  * Created by gutowpa on 13/07/2017.
@@ -47,7 +48,7 @@ public class ServiceMetadataPathBuilder {
         String path = ServletUriComponentsBuilder.fromCurrentRequestUri()
                 .replacePath(getUrlContext())
                 .path("/{participantId}/services/{docId}")
-                .buildAndExpand(asString(participantId), asString(docId))
+                .buildAndExpand(asUrlEncodedString(participantId), asUrlEncodedString(docId))
                 .toUriString();
 
         return path;