ติดตาม @ServicEStack หรือดูเอกสารใช้ StackOverFlow หรือฟอรัมลูกค้าเพื่อรับการสนับสนุน
ดูบันทึกย่อการเปิดตัวสำหรับคุณสมบัติล่าสุดหรือดู servicestack.net/features สำหรับภาพรวม
Servicestack เป็นกรอบการทำงานของเว็บและบริการเว็บเต็มรูปแบบที่รวดเร็วหลากหลายและมีประสิทธิภาพสูงเพื่อลดความซับซ้อนของเทียมและส่งเสริมการปฏิบัติงานระยะไกลที่ดีที่สุดด้วยการออกแบบตามข้อความ บริการ Servicestack นั้นใช้งานได้ผ่านรูปแบบข้อมูลที่รวดเร็วในตัว (INC. JSON, XML, CSV, JSV, Protobuf, Wire และ Msgpack) รวมถึง XSD/WSDL สำหรับจุดสิ้นสุดของ SOAP และ Rabbit MQ, Redis MQ และ Amazon SQS MQ
การออกแบบและการมุ่งเน้นที่เรียบง่ายนำเสนอคุณสมบัติการผลิตที่ไม่มีใครเทียบได้ซึ่งสามารถเปิดใช้งานได้โดยไม่ต้องใช้รหัสจากการสร้าง Web API ที่สามารถสอบถามได้อย่างเต็มที่ด้วยคำขอพิมพ์เพียงครั้งเดียว DTO พร้อมแบบสอบถามอัตโนมัติที่รองรับ RDBM ที่สำคัญทุกครั้ง
บริการเดียวกันของคุณยังทำหน้าที่เป็นคอนโทรลเลอร์ในมุมมองสมาร์ทของ Servicestack ลดความพยายามในการให้บริการทั้งแอพเว็บและหน้าเดียวรวมถึงเดสก์ท็อปที่หลากหลายและไคลเอนต์มือถือที่สามารถส่งมอบประสบการณ์การโต้ตอบได้ทันทีโดยใช้กิจกรรมเซิร์ฟเวอร์แบบเรียลไทม์
Servicestack Services ยังเพิ่มประสิทธิภาพการผลิตให้กับผู้บริโภคที่ให้ API ที่พิมพ์แบบ end-to-end ทันทีโดยไม่ต้องใช้รหัส-เปิดใช้งานประสบการณ์การพัฒนาที่มีประสิทธิผลมากที่สุดสำหรับการพัฒนา. NET เป็น. NET Web Services
Servicestack ตอนนี้รวมเข้ากับ IDE ที่สำคัญทั้งหมดที่ใช้ในการสร้างประสบการณ์พื้นเมืองที่ดีที่สุดบนแพลตฟอร์มที่ได้รับความนิยมมากที่สุดเพื่อเปิดใช้งานเวิร์กโฟลว์ dev ที่มีประสิทธิภาพสูงสำหรับการใช้บริการเว็บทำให้ ServiceStack เป็นตัวเลือกแบ็คเอนด์ในอุดมคติสำหรับการเพิ่มประสิทธิภาพแอพ iPhone และ iPad Xamarin.ios, Xamarin.android, Windows Store, WPF, Winforms และ Silverlight:
ให้ API พิมพ์แบบดั้งเดิมสำหรับ C#, typeScript, F# และ VB.NET โดยตรงใน Visual Studio สำหรับแพลตฟอร์ม. NET ที่ได้รับความนิยมมากที่สุดรวมถึง iOS และ Android โดยใช้ Xamarin.ios และ Xamarin.android บน Windows
ให้การสนับสนุนประเภท C# ดั้งเดิมสำหรับการพัฒนาแอพ iOS และ Android มือถือโดยใช้ Xamarin.ios และ Xamarin.android พร้อม Xamarin Studio บน OSX ปลั๊กอิน ServicEStackXS ยังให้ประสบการณ์การพัฒนาบริการเว็บที่หลากหลายในการพัฒนาแอปพลิเคชันไคลเอนต์ด้วยการพัฒนา Mono บน Linux
การจัดหา API ที่พิมพ์แบบดั้งเดิมใน SWIFT รวมถึงไคลเอนต์บริการทั่วไปที่เปิดใช้งานเวิร์กโฟลว์ที่มีประสิทธิภาพสูงและการบริโภคบริการเว็บอย่างง่ายดายจากแอปพลิเคชัน iOS และ OSX ดั้งเดิม - โดยตรงจากภายใน XCode!
การจัดหา API ที่พิมพ์แบบดั้งเดิมใน Java และ Kotlin รวมถึงลูกค้าบริการ Java Generic ที่สนับสนุนการร้องขอการซิงค์และ Async โดยการใช้ประโยชน์จาก asynctasks ของ Android เพื่อเปิดใช้งานการสร้างแอพพลิเคชั่น Java หรือ Kotlin มือถือ Kotlin บนแพลตฟอร์ม Android
ปลั๊กอิน ServiceStack Idea สามารถติดตั้งได้โดยตรงจากที่เก็บปลั๊กอินของ Intellij และช่วยให้การรวมเข้ากับโครงการ Intellij Java Maven สำหรับการสร้าง API ที่พิมพ์ลงเพื่อใช้งานบริการเว็บ Servicestack ระยะไกลอย่างรวดเร็วและง่ายดาย
ผลผลิตที่ไม่มีใครเทียบที่นำเสนอโดย Java Add Servicestack Reference ยังมีอยู่ในปลั๊กอิน Servicestackeclipse IDE ที่ติดตั้งได้จากตลาด Eclipse เพื่อให้การรวมการอ้างอิง ServiceStack เพิ่มอย่างลึกซึ้งกับโครงการ Eclipse Java Maven
นอกเหนือจากรายการที่เพิ่มขึ้นของ IDE ที่ได้รับการสนับสนุนแล้ว Servicestack-CLI Cross-Platform คำสั่งสคริปต์ NPM คำสั่ง NPM ทำให้ง่ายสำหรับการสร้างเซิร์ฟเวอร์งานอัตโนมัติและนักวิ่งบรรทัดคำสั่งของโปรแกรมแก้ไขข้อความที่คุณชื่นชอบเพื่อเพิ่มและอัปเดตการอ้างอิง Servicestack!
ตัวอย่างนี้ยังมีอยู่เป็นการทดสอบการรวมแบบสแตนด์อโลน:
//Web Service Host Configuration
public class AppHost : AppSelfHostBase
{
public AppHost ( )
: base ( "Customer REST Example" , typeof ( CustomerService ) . Assembly ) { }
public override void Configure ( Container container )
{
//Register which RDBMS provider to use
container . Register < IDbConnectionFactory > ( c =>
new OrmLiteConnectionFactory ( ":memory:" , SqliteDialect . Provider ) ) ;
using ( var db = container . Resolve < IDbConnectionFactory > ( ) . Open ( ) )
{
//Create the Customer POCO table if it doesn't already exist
db . CreateTableIfNotExists < Customer > ( ) ;
}
}
}
//Web Service DTO's
[ Route ( "/customers" , "GET" ) ]
public class GetCustomers : IReturn < GetCustomersResponse > { }
public class GetCustomersResponse
{
public List < Customer > Results { get ; set ; }
}
[ Route ( "/customers/{Id}" , "GET" ) ]
public class GetCustomer : IReturn < Customer >
{
public int Id { get ; set ; }
}
[ Route ( "/customers" , "POST" ) ]
public class CreateCustomer : IReturn < Customer >
{
public string Name { get ; set ; }
}
[ Route ( "/customers/{Id}" , "PUT" ) ]
public class UpdateCustomer : IReturn < Customer >
{
public int Id { get ; set ; }
public string Name { get ; set ; }
}
[ Route ( "/customers/{Id}" , "DELETE" ) ]
public class DeleteCustomer : IReturnVoid
{
public int Id { get ; set ; }
}
// POCO DB Model
public class Customer
{
[ AutoIncrement ]
public int Id { get ; set ; }
public string Name { get ; set ; }
}
//Web Services Implementation
public class CustomerService : Service
{
public object Get ( GetCustomers request )
{
return new GetCustomersResponse { Results = Db . Select < Customer > ( ) } ;
}
public object Get ( GetCustomer request )
{
return Db . SingleById < Customer > ( request . Id ) ;
}
public object Post ( CreateCustomer request )
{
var customer = new Customer { Name = request . Name } ;
Db . Save ( customer ) ;
return customer ;
}
public object Put ( UpdateCustomer request )
{
var customer = Db . SingleById < Customer > ( request . Id ) ;
if ( customer == null )
throw HttpError . NotFound ( "Customer '{0}' does not exist" . Fmt ( request . Id ) ) ;
customer . Name = request . Name ;
Db . Update ( customer ) ;
return customer ;
}
public void Delete ( DeleteCustomer request )
{
Db . DeleteById < Customer > ( request . Id ) ;
}
}ไม่จำเป็นต้องใช้รหัส-สามารถนำกลับมาใช้ใหม่ได้อีกครั้งด้านบน DTOS:
var client = new JsonServiceClient ( BaseUri ) ;
//GET /customers
var all = client . Get ( new GetCustomers ( ) ) ; // Count = 0
//POST /customers
var customer = client . Post ( new CreateCustomer { Name = "Foo" } ) ;
//GET /customer/1
customer = client . Get ( new GetCustomer { Id = customer . Id } ) ; // Name = Foo
//GET /customers
all = client . Get ( new GetCustomers ( ) ) ; // Count = 1
//PUT /customers/1
customer = client . Put (
new UpdateCustomer { Id = customer . Id , Name = "Bar" } ) ; // Name = Bar
//DELETE /customers/1
client . Delete ( new DeleteCustomer { Id = customer . Id } ) ;
//GET /customers
all = client . Get ( new GetCustomers ( ) ) ; // Count = 0รหัสเดียวกันยังใช้งานได้กับ Android, iOS, Xamarin.Forms, UWP และ WPF
f# และ vb.net สามารถใช้ซ้ำลูกค้า. NET Service และ DTO's ได้อีกครั้ง
const client = new JsonServiceClient ( baseUrl ) ;
const { results } = await client . get ( new GetCustomers ( ) ) ; let client = JsonServiceClient ( baseUrl : BaseUri )
client . getAsync ( GetCustomers ( ) )
. then {
let results = $0 . results;
} JsonServiceClient client = new JsonServiceClient ( BaseUri );
GetCustomersResponse response = client . get ( new GetCustomers ());
List < Customer > results = response . results ; val client = JsonServiceClient ( BaseUri )
val response = client.get( GetCustomers ())
val results = response.results var client = new JsonServiceClient ( BaseUri );
var response = await client. get ( GetCustomers ());
var results = client.results; $ . getJSON ( $ . ss . createUrl ( "/customers" , request ) , request , ( r : GetCustomersResponse ) => {
var results = r . results ;
} ) ;การใช้คำจำกัดความ typeScript กับไคลเอนต์ HTTP เชิงมุม:
this . http . get < GetCustomersResponse > ( createUrl ( '/customers' , request ) ) . subscribe ( r => {
this . results = r . results ;
} ) ; $ . getJSON ( baseUri + "/customers" , function ( r ) {
var results = r . results ;
} ) ;นั่นคือรหัสแอปพลิเคชันทั้งหมดที่จำเป็นในการสร้างและใช้บริการ REST ที่เปิดใช้งานฐานข้อมูลอย่างง่าย!
หากคุณติดตั้ง Nuget วิธีที่ง่ายที่สุดในการเริ่มต้นคือ:
V4+ ล่าสุดบน NuGet เป็นการเปิดตัวเชิงพาณิชย์ที่มีโควต้าฟรี
รายการที่ชัดเจนของโครงการตัวอย่าง, กรณีการใช้, การสาธิต, แม่แบบเริ่มต้น
ตั้งแต่เดือนกันยายน 2556 ซอร์สโค้ด Servicestack สามารถใช้ได้ภายใต้ GNU Affero ทั่วไปใบอนุญาตสาธารณะ/ใบอนุญาต FOSS ให้ดูที่ License.txt ในแหล่งที่มา นอกจากนี้ยังมีการออกใบอนุญาตเชิงพาณิชย์ทางเลือกดูที่ https://servicestack.net/pricing สำหรับรายละเอียด
ผู้มีส่วนร่วมจำเป็นต้องอนุมัติข้อตกลงใบอนุญาตผู้มีส่วนร่วมก่อนที่จะมีการตรวจสอบรหัสใด ๆ โปรดดูเอกสารที่มีส่วนร่วมสำหรับรายละเอียดเพิ่มเติม การมีส่วนร่วมทั้งหมดจะต้องรวมถึงการทดสอบที่ตรวจสอบพฤติกรรมที่ต้องการ
Servicestack รวมถึงซอร์สโค้ดของไลบรารีที่ยอดเยี่ยมด้านล่างสำหรับฟังก์ชั่นหลักบางอย่าง ห้องสมุดแต่ละแห่งได้รับการปล่อยตัวภายใต้ใบอนุญาตที่เกี่ยวข้อง:
ติดตาม @Servicestack และ +Servicestack สำหรับการอัปเดตโครงการ
ขอบคุณมากสำหรับ GitHub และผู้สนับสนุนทั้งหมดของ Servicestack:
โครงการโอเพนซอร์สที่คล้ายกันสำหรับการพัฒนาหรือเข้าถึงบริการเว็บรวมถึง: