Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: SUP2.2 MBO migration to SMP3.0 OData

$
0
0

Hi Vicente,

 

If the type field is mandatory I don't think it is possible to pass this value in the input.

 

Given below is a sample code that could be used in the case when you want to get the output based on an input.

function processRequestData(message) {

 

 

   //Import statements

   importPackage(com.sap.gateway.ip.core.customdev.logging);

   importPackage(com.sap.gateway.ip.core.customdev.util);

   importPackage(org.apache.olingo.odata2.api.uri);

   importPackage(java.util);

   importPackage(com.sap.gateway.core.ip.component.commons);

   importPackage(com.sap.gateway.ip.core.customdev.api);

 

 

 

   child = new LinkedHashMap();

   child.put("key:City", "california");

   message.setBody(child);

  

   //Logger

   importPackage (com.sap.gateway.ip.core.customdev.logging);

   log.logErrors(LogMessage.TechnicalError, "This is first log"+message.getBody().toString());

  

  

  return message;

}

 

The above code is used in the below case.

2015-10-14_09-26-03.png

 

To debug you have to look at the smp logs. Search the log that starts with "This is first log". The xml being created should be same as the soap input. i.e

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webservicex.net/">

   <soapenv:Header/>

   <soapenv:Body>

      <web:GetSupplierByCity>

         <!--Optional:-->

         <web:City>califronia</web:City>

      </web:GetSupplierByCity>

   </soapenv:Body>

</soapenv:Envelope>

 

 


Regards, Midhun

SAP Technology RIG


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>