summaryrefslogtreecommitdiffstats
path: root/adapters/mso-sdnc-adapter/src/main/java/org
diff options
context:
space:
mode:
authorSrinivasan Ramanathan <srinivasan.ramanathan2@us.fujitsu.com>2020-05-30 17:19:10 +0000
committerSrinivasan Ramanathan <srinivasan.ramanathan2@us.fujitsu.com>2020-06-10 12:25:44 +0000
commitb155bb4a1bd9a588731cde61e5dea58c5648efe9 (patch)
tree24c1dbd0d9c802f1d63dacfcfd32be2e0a58735a /adapters/mso-sdnc-adapter/src/main/java/org
parentfa20cbaba61bbb6dc073ddfadea264bb7b0c823d (diff)
Fix for MDONS usecase issue SO-2967
Change-Id: I20077b501b945ec6ef52816e4c6f2ace3e7bf711 Issue-ID: SO-2967 Signed-off-by: Srinivasan Ramanathan <srinivasan.ramanathan2@us.fujitsu.com>
Diffstat (limited to 'adapters/mso-sdnc-adapter/src/main/java/org')
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
index b8977f05d8..4ad32909b0 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
@@ -24,7 +24,6 @@
package org.onap.so.adapters.sdnc.impl;
-
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStream;
@@ -65,7 +64,6 @@ import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-
@Component
public class SDNCRestClient {
@@ -153,10 +151,15 @@ public class SDNCRestClient {
String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
con.setRequestProperty("Authorization", basicAuth);
con.setRequestMethod(rt.getReqMethod());
+ String msoAction = rt.getMsoAction();
// Add request headers
if ("POST".equals(rt.getReqMethod()) || "PUT".equals(rt.getReqMethod())) {
- con.setRequestProperty("Content-type", "application/xml");
+ if (Constants.MSO_ACTION_MDONS.equals(msoAction)) {
+ con.setRequestProperty("Content-type", "application/json");
+ } else {
+ con.setRequestProperty("Content-type", "application/xml");
+ }
con.setRequestProperty("Content-length", String.valueOf(sdncReqBody.length()));
con.setDoOutput(true);
out = new DataOutputStream(con.getOutputStream());