{
"base": "USD",
"rates": {
"GBP": 0.8098223235,
"HKD": 7.7519817768,
"IDR": 14754.9977220957,
"ILS": 3.5118906606,
"DKK": 6.7934396355,
"INR": 75.5599088838,
"CHF": 0.9658314351,
"MXN": 22.150523918,
"CZK": 24.667881549,
"SGD": 1.4177676538,
"THB": 31.8797266515,
"HRK": 6.9102505695,
"EUR": 0.9111617312,
"MYR": 4.3634624146,
"NOK": 9.9264692483,
"CNY": 7.131571754,
"BGN": 1.7820501139,
"PHP": 50.4400911162,
"PLN": 4.0552164009,
"ZAR": 17.3712984055,
"CAD": 1.3835079727,
"ISK": 140.410022779,
"BRL": 5.3862414579,
"RON": 4.413667426,
"NZD": 1.6143052392,
"TRY": 6.7438724374,
"JPY": 107.444191344,
"RUB": 70.8422779043,
"KRW": 1232.1002277904,
"USD": 1.0,
"AUD": 1.5069703872,
"HUF": 318.5421412301,
"SEK": 9.6184965831
},
"date": "2020-05-26"
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/CPI_DEMO/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CPI_DEMO" targetNamespace="http://www.example.org/CPI_DEMO/">
<wsdl:types>
<xsd:schema targetNamespace="http://www.example.org/CPI_DEMO/">
<xsd:element name="GetCurrency">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="FROM" type="xsd:string" />
<xsd:element name="TO" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetCurrencyResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="VALUE" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="GetCurrencyRequest">
<wsdl:part element="tns:GetCurrency" name="parameters"/>
</wsdl:message>
<wsdl:message name="GetCurrencyResponse">
<wsdl:part element="tns:GetCurrencyResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="CPI_DEMO">
<wsdl:operation name="GetCurrency">
<wsdl:input message="tns:GetCurrencyRequest"/>
<wsdl:output message="tns:GetCurrencyResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CPI_DEMOSOAP" type="tns:CPI_DEMO">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetCurrency">
<soap:operation soapAction="http://www.example.org/CPI_DEMO/GetCurrency"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CPI_DEMO">
<wsdl:port binding="tns:CPI_DEMOSOAP" name="CPI_DEMOSOAP">
<soap:address location="http://www.example.org/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
import groovy.json.*;
def Message processData(Message message) {
map = message.getProperties();
currto = map.get("CURRFROM");
def body = message.getBody(String.class);
def jsonSlurper = new JsonSlurper();
def list = jsonSlurper.parseText(body);
String val = list.rates[currto];
message.setBody(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<ns0:GetCurrencyResponse xmlns:ns0=\"http://www.example.org/CPI_DEMO/\"><VALUE>" +
val +
"</VALUE></ns0:GetCurrencyResponse> "
);
return message;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |