Consuming a Web Service in Saba happens in two steps:
1) Authorization of the consumer via a service exposed by Saba and available at the following address:
This service returns a certificate to use in step 2
2) Invoke the web service exposed by your installation of Saba using the certificate
To make life easier with step 1, Saba distributes a .NET assembly that is a wrapper around that service; this wrapper contains two classes in the Saba.Platform namespace:
- SabaLogin, that you should use for authentication
- InfoServiceClient, that you should use for invoking your own service
A quick example of how to use the above classes in C#:
string username = "admin";
string password = "welcome";
// get an authentication certificate
string certificate = SabaLogin.Authenticate(endpointURL, username, password);
// invoke the "updateUsername" service
Hashtable requestParams = new Hashtable();
requestParams["old_username"] = "JSMITH";
requestParams["new_username"] = "HPOTTER";
XmlDocument response = InfoServiceClient.CallService(
endpointURL,
"updateUsername",
certificate,
requestParams);
requestParams is a map of parameters to pass to the service (no generics yet, Saba is still on the old-fashioned .NET 1.1 code...)
Communication is over SOAP, no REST services in Saba yet.
Enjoy!
Vriendelike groete
@stefanotempesta
Hello. I am actually working on the Saba API and have a question. I see that that the RESTful web service now exists. I can retrieve a certificate but keep getting "(500) Internal Server Error" whenever I try to use any other method. For example: /Saba/api/common/infoservice/profile. I pass the certificate as a string parameter and also pass username as a search parameter.
ReplyDeleteDo I pass the entire certificate string (i.e. {'SabaCertificateWrapper': {'@type:SabaCertificate', 'certificate':'31343.......') or just the long number part?
Thanks Niall
Niall, did you ever resolve your issue? I am experiencing the same thing.
Delete
Delete- Ngươi vào bằng cách nào, ngươi đã tiến vào học viện ma pháp sao?
Yến Hiểu Kỳ khẽ đóng cửa sổ lại, thẹn thùng nói với Nhạc Thành. Cho tới bây giờ nàng vẫn không thể tin được tất cả mọi chuyện là thật sự.
- Hiện tại ta đã vào học viện đấu khí, dự định hai ngày nữa sẽ bế quan nửa năm chđồng tâm
game mu
cho thuê phòng trọ
cho thuê phòng trọ
nhac san cuc manh
tư vấn pháp luật qua điện thoại
văn phòng luật
số điện thoại tư vấn luật
dịch vụ thành lập doanh nghiệpo nên tới đây thăm ngươi.
Nhạc Thành cất tiếng trả lời, ánh mắt quét quanh Yến Hiểu Kỳ.
Chỉ nhìn thấy trên người của Yến Hiểu Kỳ mặc một bộ váy hồng, trước ngực là bộ ngực sữa đày đặn, khe núi thật sâu nóng bỏng, bờ eo nhỏ mềm mại. Nhạc Thành nhìn thấy vậy thì không kìm được nuốt nước miếng.
- Cha ta đã nói với ngươi chưa?
Yến Hiểu Kỳ nhìn Nhạc Thành, khuôn mặt yêu kiều.
Yến Hiểu Kỳ ở ma pháp học viện, cha nàng cũng đã nói với nàng chuyện thông gia với Nhạc gia, lúc đó trong lòng nàng vô cùng cao hứng, chỉ là không biết
Hi Niall,
ReplyDeleteThe header key should be "SabaCertificate" and the value is just the long number.
How did you go with calling the rest of the API? I keeping getting "No message body writer has been found for response class WebApplicationException" when calling "Saba/api/common/infoservice/catalogsearch"
This comment has been removed by the author.
ReplyDeleteDo these web services are available in Saba Cloud? Specially the Authentication ws.
ReplyDeleteYes, Web Services are available also in Saba Cloud.
DeleteWhere can I find the .Net Assembly?
ReplyDeleteThe .Net assembly is distributed by Saba, ask Saba Support for help.
DeleteI did ask but not very responsive.
DeleteWrite me in private, I'll see if I can help.
DeleteIs there something I can use for Java EE Web application to consume the Saba rest service? I would like to build a calendar and we don't have access to .NET but I can use Java EE and Netbeans.
DeleteThe best way to invoke a Web Service in Java is to use JAX-WS. As you are using Netbeans, have a look at this tutorial for some examples: https://netbeans.org/kb/docs/websvc/jax-ws.html
DeleteHi Stefano,
ReplyDeleteThanks for your guide, but can you send me .net assembly please. I can not find any from saba support. My email: homthu_abc@yahoo.com
Thanks.
I know that this post is dated, but I'm having difficulty using the SABA API with .NET and I'm not getting much in the way of support. Does anyone have any a code sample that uses the REST Services to create a profile for example. My email address is aggie4ga-bbb@yahoo.com Thanks for any help.
ReplyDelete