You need to sign in to do that
Don't have an account?
ccolt
XML-RPC Callout
Hi,
i want to call a function over XML-RPC.
I read the thread http://th3silverlining.com/2009/10/25/flickr-jquery-force-com-awesome5-part-1/#more-348 , but it didn´t work.
simple call (is dynamic on more than one server, but on each it´s a isAlive function):
public String isAliveMSG { get; set; } public PageReference XMLRCP_isAlive(String URL) { Httprequest request = new HttpRequest(); request.setMethod('POST'); request.setEndpoint(URL); String XML = '<methodCall><methodName>isAlive</methodName></methodCall>'; request.setBody(XML); Http http = new Http(); HttpResponse response = http.send(request); isAliveMSG = response.getBody(); return null; }
isAliveMSG is a Textarea.
the function isAlive has no parameters and the response is XML with true or false.
My response is
<?xml version="1.0" encoding="UTF-8"?> <methodResponse> <fault> <value> <struct> <member> <name>faultCode</name> <value><int>105</int></value> </member> <member> <name>faultString</name> <value><string>XML error: Invalid document end at line 1</string></value> </member> </struct> </value> </fault> </methodResponse>
From .NET (with XML-RPC.NET) or an online XML-RPC debuggers it call true back.
Can somebody help me ?
thanks
Hi,
thanks a lot SimonF.
is the key.
In Documentation it stays in the code example for DOM-Class.
All Answers
You might need to set a content-type HTTP header, and you may need to include an xml dec in your payload
Hi,
thanks a lot SimonF.
is the key.
In Documentation it stays in the code example for DOM-Class.