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
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