Bueno, acá publico un ejemplo simple de un Web Servicess que implementa spring, para levantar servicios virtuales, con una capa de datos también por inyección de código.公共のWeb Servicessのさてここでは簡単な例と、そのデータの層での仮想サービスを構築するための春、実装も、コードを注入された。
Son mis primeras experiencias, así que las quiero compartir con ustedes, las capas que tengo son:彼らは私の初体験しているので、私はあなたと共有したい場合は、私はレイヤーされている:

Ahora les explico, no tiene gran funcionalidad este ejemplo, ya que solo lo hice para compartir… y no es para ningún desarrollo real.今私は、この例にしている素晴らしい機能を共有するだけでしたので...ではなく、任意の実際の開発のために説明しています。
Tengo elわたし

Sería el CommonTypes, el objeto que voy a transferir, para este caso no tiene mucho sentido, pero más adelante voy a mostrar como consumir un WS por spring.Net, y en este caso si es útil para saber que voy a recibir. CommonTypesは、私を転送するんだ、この場合には非常に意味がないオブジェクトになるだろう保存spring.Netだった私はどのように消費するとすれば、これを受け取るかどうかは、私は知っておくと便利ですが表示されます。
Así que es una clase sin nada en particularだから、特に何もない状態では、クラスの

….. ... ..

En el DAO, defino las interfaces, así puedo tener un Sql Implementation, Oracle, Xml, lo que quisiera realmente, no hay ningún secreto por ahora.のDAOで、私は実装のためのSQL 、オラクル、 XMLのは、今のところ秘密を持つことができますので、私は本当にないのインターフェイスを定義します。
Ahora veamos las otras dos capas que nos quedan今の我々はしている他の2つの層を見てみよう

En Entitys, es una interfaz del WebServices… en este caso, es muy simple EntitysでのインターフェイスWebServicesを...このケースでは非常に簡単です

Y en ServiceImplementation, simplemente hay que implementar y codificarlo.とServiceImplementationだけを実装し、エンコードしている。

Bueno ahora vamos a ver, mas sobre este UserService…今もこの... UserServiceの詳細については見ることができます

Generamos estas propiedades, para asignarle por spring, una instancia del DAO, podría ser de sql, oracle, o lo que quisieran, mientras implementaran la interfaz … Eso es lo que ofrece spring.netまたそれは...それが生成するこれらのプロパティを実装していますspring.net春のDAOのインスタンスでは、 Oracle 、または何をするのSQLが、割り当てること
En nuestro método, usamos este DAO que asignamos, para traer “x” dato.我々のアプローチでは、このDAOのは" x "のデータを添付します。

Ahora, solo nos falta configurar el WebServices.今はちょうどWebServicesを設定する必要があります。

Generen, una carpeta “X”, con un Xml de configuración, en mi caso “Configuration”, y “webServices.xml”. "は、 XML構成で、私の場合、 "設定" 、 " webServices.xmlのフォルダの" Xを作成します。
En este mismo, tenemos que hacer todo el mappingこれでは、マッピングをしなければならない
<? xml < ? XMLの
version = “ 1.0 “ バージョン = " 1.0 "
encoding = “ utf-8 “ ?> エンコード = " UTF - 8の" ? >
< objects <オブジェクト
xmlns = “ http://www.springframework.net “ > xmlns = " http://www.springframework.net " >
< description > Servicios Expuestos </ description > <Description>サービス公開< / 説明>
< object <オブジェクト
id = “ UserServiceAsmx “ アイダホ = " UserServiceAsmx "
type = “ Synnax.Core.WS.UserAuthentication.ServiceImplementation.UserService, Synnax.Core.WS.UserAuthentication.ServiceImplementation “ > タイプ = " Synnax.Core.WS.UserAuthentication.ServiceImplementation.UserService 、 Synnax.Core.WS.UserAuthentication.ServiceImplementation " >
< property <物件
name = “ IUser “ 名 = " IUser "
ref = “ UserDAO “ /> 参照 = " UserDAO " / >
</ object > < / オブジェクト>
< object <オブジェクト
id = “ UserDAO “ アイダホ = " UserDAO "
type = “ Synnax.Core.WS.UserAuthentication.DataAccess.SqlImplementation.UserImpl, Synnax.Core.WS.UserAuthentication.DataAccess.SqlImplementation “ /> タイプ = " Synnax.Core.WS.UserAuthentication.DataAccess.SqlImplementation.UserImpl 、 Synnax.Core.WS.UserAuthentication.DataAccess.SqlImplementation " / >
< object <オブジェクト
id = “ UserServices “ アイダホ = " UserServices "
type = “ Spring.Web.Services.WebServiceExporter, Spring.Web “ > タイプ = " Spring.Web.Services.WebServiceExporter 、 Spring.Web " >
< property <物件
name = “ TargetName “ 名 = " TargetName "
value = “ UserServiceAsmx “ /> 値 = " UserServiceAsmx " / >
< property <物件
name = “ Namespace “ 名 = "名前空間"
value = “ http://synnax/services/ “ /> 値 = " http://synnax/services/ " / >
< property <物件
name = “ Description “ 名 = "説明"
value = “ Web Service de Usuario “ /> 値 = " Webサービスの利用者" / >
</ object > < / オブジェクト>
</ objects > < / オブジェクト>
En sí, configuramos un objeto UserDAO , que apunta a la implementación del DAO que queremos, en este caso una para SqlServer, generamos un Objeto “ UserServiceAsmx “, que apunta a la implementación del WS, y como verán le asigno la propiedad IUser, que espera una implementación del DAO, en este caso el UserDAO que configuramos.このように、このケースでは、構成のSQLServer オブジェクトUserDAO 、 DAOを欲しいの実装を指して、私たちは、 " 指差していたの実施、および目的 " UserServiceAsmx生成IUser財産、彼を代入されは、このケースでは、 DAOの設定UserDAOの実施を保留中。
Y por ultimo generamos un “ UserServices ” que como Target tiene nuestro UserServiceAsmx , esto va a levantar un .asmx “virtual”, en este caso sería un UserServices.asmx.そして最後に、 1つのターゲットを解除することのように私たちのUserServiceAsmxが" UserServices "を作成します。 Asmx " "それはこの場合には、仮想UserServices.asmx 。
Bueno, como último paso, hay que configurar el Web.Config.さて、最後のステップとして、次のような構成は、 Web.configしている。
< configuration > <configuration>の
<!– Begin - Necesario para Spring.NET –> < ! - 開始- Spring.NETに必要- >
< configSections > <ConfigSections>
< sectionGroup < SectionGroup
name = “ spring “ > 名 = "春" >
< section <部署
name = “ context “ 名 = "コンテキスト"
type = “ Spring.Context.Support.WebContextHandler, Spring.Web “ /> タイプ = " Spring.Context.Support.WebContextHandler 、 Spring.Web " / >
</ sectionGroup > < / SectionGroup >
</ configSections > < / ConfigSections >
… ...
</ configuration > < / 設定>
Esto siempre va, dentro de System.Webこれは、常に、 System.Webに
< system.web > <System.web>
<!– Begin - Necesario para Spring.NET –> < ! - 開始- Spring.NETに必要- >
< httpHandlers > <HttpHandlers>
< add <追加
verb = “ * “ 動詞 = " * "
path = “ *.asmx “ パス = " *. asmx "
type = “ Spring.Web.Services.WebServiceHandlerFactory, Spring.Web “ /> タイプ = " Spring.Web.Services.WebServiceHandlerFactory 、 Spring.Web " / >
</ httpHandlers > < / HttpHandlers >
< httpModules > <HttpModules>
< add <追加
name = “ Spring “ 名 = "春"
type = “ Spring.Context.Support.WebSupportModule, Spring.Web “ /> タイプ = " Spring.Context.Support.WebSupportModule 、 Spring.Web " / >
</ httpModules > < / HttpModules >
<!– End - Necesario para Spring.NET –> < ! - エンド - 必要なSpring.NET - >
… ...
</ system.web > < / system.web >の
Es evidente que hace esto, levanta las peticiones que se hacen para los asmx, y el modulo correspondiente para manejar todo esto. asmxとは、このモジュールのすべてのリクエストを処理するには、明確に提起されています。
Y como final, después del nodo de system.web … system.webとノードの後に最終的な...
</ system.web > < / system.web >の
<!– Begin - Necesario para Spring.NET –> < ! - 開始- Spring.NETに必要- >
< spring > <Spring>
< context <コンテキスト
type = “ Spring.Context.Support.WebApplicationContext, Spring.Web “ > タイプ = " Spring.Context.Support.WebApplicationContext 、 Spring.Web " >
< resource <リソース
uri = “ ~/Configuration/webServices.xml “ /> のURI = " 〜 / 構成/ webServices.xml " / >
</ context > < / コンテキスト>
</ spring > < / 春>
<!– End - Necesario para Spring.NET –> < ! - エンド - 必要なSpring.NET - >
</ configuration > < / 設定>
Le asignamos el archivo de configuración, al contexto que estamos usando.我々の設定ファイルを割り当てると、私たちは、コンテキストを使用している。
Levantan, y si tipean el nombre alias que apuntamos la implementación del WS, va a andar todo correctamente: 、および解除の場合は、名前を実装しているポインティングtipeanエイリアス、すべてがスムーズになる:

Bueno, eso fue algo rápido, y que no tenía pensando publicarlo hoy, pero alguien me pidió un ejemplo.うーん、何かが速かったし、今日の心はしなかったが、一例を私は尋ねた。
Saludos.拝啓。
PD: No se olviden de meter todas las dependencias de spring.net, sino no va a andar nada!シモンズ: spring.netすべての単位を忘れてはいけないが、何も乗っていないよ! Obvie esos pasos, porque son lógicos.彼らの論理は、これらの手順をバイパスします。
Share and Enjoy: 共有し、楽しみなさい: