You need to sign in to do that
Don't have an account?

(HowTo) Sending a SOAP message within Apex
Hi!
I want to use a webservice whose WSDL is unable to be imported by Salesforce. So I pick up its WSDL file as input for a SOAP Client "SOAP UI" which gave me the soap message to request de service:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET/"> <soapenv:Header/> <soapenv:Body> <web:ConversionRate> <web:FromCurrency>USD</web:FromCurrency> <web:ToCurrency>EUR</web:ToCurrency> </web:ConversionRate> </soapenv:Body> </soapenv:Envelope>
So what I need is to send this SOAP message through my apex code. I tried this skeleton:
//setting endpoint string serviceUrl = 'http://www.webserviceX.NET/currencyconvertor.asmx'; Http h = new Http(); HttpRequest req = new HttpRequest(); req.setEndpoint(serviceUrl); req.setMethod('POST'); req.setTimeout(10000); HttpResponse res = h.send(req); string bodyRes=res.getBody();
What should I add to my code in order I can send the SOAP message above?
Thanks in Advance
This worked for me:
Hi,
Can you put here what was the resulting SOAP message?