• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Chinese instead of xmh

N

Nono

Guest
Hi all,

I'm trying to use the api 4.5 with the last version of sitebuilder. I'm working in asp.
My problem is that the api doesn't creates any entity when I call a create function (like CreateAccount) and it returns no result when I call a display function (like ListPlans).

Here is my function call : sb_ListPlans()

Here is my function :

Function sb_ListPlans()
Dim url, xmlhttp, XMLDOM, XMLNodeList, x, str
' Call web service using HTTP-POST
url = getSitebuilderURL() & "/ServiceFacade/4.1/PlanWebService.asmx"
xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
Call xmlhttp.Open("POST", url, False)
Call xmlhttp.setRequestHeader("Content-Type", "application/soap+xml; charset=utf-8")
Dim body
body = "<?xml version=""1.0"" encoding=""utf-8""?>"
body = body & "<soap12:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope"">"
body = body & "<soap12:Header>"
body = body & "<CredentialsSoapHeader xmlns=""http://swsoft.com/webservices/sb/4.5/PlanService"">"
body = body & "<Login>" & getSitebuilderAdminLogin() & "</Login>"
body = body & "<Password>" & getSitebuilderAdminPassword() & "</Password>"
body = body & "</CredentialsSoapHeader>"
body = body & "</soap12:Header>"
body = body & "<soap12:Body>"
body = body & "<GetAvailablePlans xmlns=""http://swsoft.com/webservices/sb/4.5/PlanService"">"
'body = body & "<accountId></accountId>"
body = body & "<accountId>ae3157b1-ee78-4970-83aa-c23ad27cfc92</accountId>"
body = body & "</GetAvailablePlans>"
body = body & "</soap12:Body>"
body = body & "</soap12:Envelope>"

Server.HTMLEncode(body)

Call xmlhttp.send(body)
' Parse result
XMLDOM = Server.CreateObject("Microsoft.XMLDOM")
XMLDOM.Load(xmlhttp.responseBody)

Server.HTMLEncode(xmlhttp.responseBody)

XMLNodeList = XMLDOM.selectNodes("//PlanValue")
For x = 1 To XMLNodeList.length
str = str & "<option value=""" & XMLNodeList.Item(x - 1).selectSingleNode("PlanId").text & """>" & XMLNodeList.Item(x - 1).selectSingleNode("Name").text
Next
sb_ListPlans = str
End Function


The code comes from documentation on parallels website, I only changed the call of api 4.1 into call of api 4.5 (the 4.1 didn't worked neither).
I Tried without an accountId (body = body & "<accountId></accountId>") and with an accountId (body = body & "<accountId>ae3157b1-ee78-4970-83aa-c23ad27cfc92</accountId>")

I displayed the Server.HTMLEncode(body) and the xml seems correct (I replaced here the name and password by stars):

<?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"><soap12:Header><CredentialsSoapHeader xmlns="http://swsoft.com/webservices/sb/4.5/PlanService"><Login>******</Login><Password>******</Password></CredentialsSoapHeader></soap12:Header><soap12:Body><GetAvailablePlans xmlns="http://swsoft.com/webservices/sb/4.5/PlanService"><accountId>ae3157b1-ee78-4970-83aa-c23ad27cfc92</accountId></GetAvailablePlans></soap12:Body></soap12:Envelope>

But when I display the Server.HTMLEncode(xmlhttp.responseBody) I recieve strange characters :

ℼ佄呃偙⁅呈䱍倠䉕䥌⁃ⴢ⼯㍗⽃䐯䑔䠠䵔⁌⸴㄰⼯久•栢瑴㩰⼯睷⹷㍷漮杲启⽒瑨汭⼴瑳楲瑣搮摴㸢਍䠼䵔㹌䠼䅅㹄吼呉䕌夾畯愠敲渠瑯愠瑵潨楲敺⁤潴瘠敩⁷桴獩瀠条㱥启呉䕌ാ㰊䕍䅔䠠呔ⵐ充䥕㵖䌢湯整瑮吭灹≥䌠湯整瑮∽整瑸栯浴㭬挠慨獲瑥圽湩潤獷ㄭ㔲∲ാ㰊呓䱙⁅祴数∽整瑸振獳㸢਍†佂奄笠映湯㩴㠠瑰ㄯ瀲⁴敶摲湡⁡ൽ 䠠‱⁻潦瑮›㌱瑰ㄯ瀵⁴敶摲湡⁡ൽ 䠠′⁻潦瑮›瀸⽴㈱瑰瘠牥慤慮素਍†㩁楬歮笠挠汯牯›敲⁤ൽ 䄠瘺獩瑩摥笠挠汯牯›慭潲湯素਍⼼呓䱙㹅਍⼼䕈䑁㰾佂奄㰾䅔䱂⁅楷瑤㵨〵‰潢摲牥〽挠汥獬慰楣杮ㄽ㸰吼㹒吼㹄਍਍格㸱潙⁵牡⁥潮⁴畡桴牯穩摥琠楶睥琠楨⁳慰敧⼼ㅨാ吊敨圠扥猠牥敶⁲潹⁵牡⁥瑡整灭楴杮琠敲捡⁨慨⁳⁡楬瑳漠⁦偉愠摤敲獳獥琠慨⁴牡⁥潮⁴污潬敷⁤潴愠捣獥⁳桴⁥敗⁢楳整‬湡⁤桴⁥偉愠摤敲獳漠⁦潹牵戠潲獷湩⁧潣灭瑵牥椠⁳湯琠楨⁳楬瑳മ㰊牨ാ㰊㹰汐慥敳琠祲琠敨映汯潬楷杮㰺瀯ാ㰊汵ാ㰊楬䌾湯慴瑣琠敨圠扥猠瑩⁥摡業楮瑳慲潴⁲晩礠畯戠汥敩敶礠畯猠潨汵⁤敢愠汢⁥潴瘠敩⁷桴獩搠物捥潴祲漠⁲慰敧㰮氯㹩਍⼼汵ാ㰊㉨䠾呔⁐牅潲⁲〴⸳‶*潆扲摩敤㩮䤠⁐摡牤獥⁳景琠敨挠楬湥⁴栉獡戠敥敲敪瑣摥㰮牢䤾瑮牥敮⁴湉潦浲瑡潩敓癲捩獥⠠䥉⥓⼼㉨ാ㰊牨ാ㰊㹰敔档楮慣湉潦浲瑡潩昨牯猠灵潰瑲瀠牥潳湮汥㰩瀯ാ㰊汵ാ㰊楬䜾潴㰠⁡牨晥∽瑨灴⼺术⹯業牣獯景⹴潣⽭睦楬歮㼯楬歮摩㠽㠱∰䴾捩潲潳瑦倠潲畤瑣匠灵潰瑲匠牥楶散㱳愯‾湡⁤数晲牯⁡楴汴⁥敳牡档映牯琠敨眠牯獤㰠㹢呈偔⼼㹢愠摮㰠㹢〴㰳戯⸾⼼楬ാ㰊楬伾数戼䤾卉䠠汥㱰戯ⰾ眠楨档椠⁳捡散獳扩敬椠䥉⁓慍慮敧⁲椨敮浴牧Ⱙ਍愠摮猠慥捲⁨潦⁲潴楰獣琠瑩敬⁤戼䄾潢瑵匠捥牵瑩㱹戯ⰾ㰠㹢楌業楴杮䄠捣獥⁳祢䤠⁐摁牤獥㱳戯ⰾ㰠㹢偉䄠摤敲獳䄠捣獥 ⁳敒瑳楲瑣潩獮⼼㹢‬湡⁤戼䄾潢瑵䌠獵潴牅潲⁲敍獳条獥⼼㹢㰮氯㹩਍⼼汵ാഊ㰊启㹄⼼剔㰾启䉁䕌㰾䈯䑏㹙⼼呈䱍ാ

I have no idea of what's happening, please help.

Thanks in advance,

Nono
 
Back
Top