Consumir Web Services con Spring.net 消費WebサービスSpring.netで
Bueno, el ejemplo que arme anteriormente, lo publique con el IIS en un directorio virtual llamado WSUserAuthenticationうーん、 IIS仮想ディレクトリの出版で、上記の腕の例では、 WSUserAuthenticationと呼ばれる

Ahora, vamos a armar un cliente que consuma este WS, sin una Web Refence , sino por spring.net.現在のビルドは、これをWeb Refenceなくspring.netによって消費されたが、クライアントしましょう。
Generamos un nuevo proyecto web, tenemos que refenciar a las librerías de Spring, como también a la interfaz de nuestro Web Services y la capa que genere como “TransferObjects”, que tiene el objeto que va a recibir el cliente.新しいWebプロジェクトを作成します、私たちだけでなく、当社のWebサービスとは、 TransferObjects " 、これは、そのオブジェクトは、クライアントを受け取るとして生成される層のインターフェイスは、春のライブラリrefenciar必要があります。

Habría que pensar cómo vamos a hacer, para versiones posteriores, el control de las versiones de los asemblys, en caso de hacer modificaciones en nuestro WS, una alternativa seria colocarlos en la GAC, para olvidarnos de tener que copiar en todos los desarrollos que llamen al WS, la última versión en caso de necesitarla. Habría que pensar cómo vamos a hacer, para versiones posteriores, el control de las versiones de los asemblys, en caso de hacer modificaciones en nuestro WS, una alternativa seria colocarlos en la GAC, para olvidarnos de tener que copiar en todos los desarrollos que llamenは、最新バージョンを必要に応じてアンダルシアだった。

En mi caso, genero una carpeta de Configuración, con un Xml de los objetos que consumo en spring, en este caso私の場合、私は、 1つのオブジェクトとのセットアップパッケージを生成する場合には、この春にはXMLの消費量、
<? xml < ? XMLの
version = “ 1.0 “ バージョン = " 1.0 "
encoding = “ utf-8 “ ?> エンコード = " UTF - 8の" ? >
< objects <オブジェクト
xmlns = “ http://www.springframework.net “ > xmlns = " http://www.springframework.net " >
< description > An example that demonstrates simple IoC features. </ description > IOCの機能は、簡単な例を示して<Description> 。 < / 説明>
<!– Web Services –> < ! - Webサービス - >
< object <オブジェクト
id = “ UsuarioWS “ アイダホ = " UsuarioWS "
type = “ Spring.Web.Services.WebServiceProxyFactory, Spring.Services “ > タイプ = " Spring.Web.Services.WebServiceProxyFactory 、 Spring.Services " >
< property <物件
name = “ ServiceUri “ 名 = " ServiceUri "
value = “ http://localhost/WSUserAuthentication/UserServices.asmx “ 値 = " http://localhost/WSUserAuthentication/UserServices.asmx "
/> / >
< property <物件
name = “ ServiceInterface “ 名 = " ServiceInterface "
value = “ Synnax.Core.WS.UserAuthentication.Entitys.IUserService, Synnax.Core.WS.UserAuthentication.Entitys ” 値 = " Synnax.Core.WS.UserAuthentication.Entitys.IUserService 、 Synnax.Core.WS.UserAuthentication.Entitys "
/> / >
</ object > < / オブジェクト>
</ objects > < / オブジェクト>
Genero un objeto, llamado “UsuarioWS”, que es del tiplo del WebServiceProxyFactory, que especificamos la ServiceUri que es donde tenemos corriendo nuestro WS, con el servicio que insumimos, y la interfaz que implementa. は 、 高音がServiceUriを指定してWebServiceProxyFactory 、ここで私たちは、サービスの入力インターフェイスを実装していたとされているオブジェクトと呼ばれる" UsuarioWS " ジェンダー。
Definimos el contexto del spring, y la configuracion de los objetos. 私たちは、そのオブジェクトの構成には、春のコンテキストを定義します。
< configuration > <configuration>の
< configSections > <ConfigSections>
< sectionGroup < SectionGroup
name = “ spring “ > 名 = "春" >
< section <部署
name = “ context “ 名 = "コンテキスト"
type = “ Spring.Context.Support.ContextHandler, Spring.Core “ /> タイプ = " Spring.Context.Support.ContextHandler 、 Spring.Core " / >
</ sectionGroup > < / SectionGroup >
</ configSections > < / ConfigSections >
< appSettings /> <AppSettings />
< connectionStrings /> <ConnectionStrings />
< system.web > <System.web>
< compilation <コンピレーション
debug = “ false “ > デバッグ =は" false " >
< assemblies > <Assemblies>
< add <追加
assembly = “ Spring.Core, Version=1.1.2.20125, Culture=neutral, PublicKeyToken=65E474D141E25E07 “ /> 組立 = " Spring.Core 、バージョン= 1.1.2.20125 、文化=中立、 PublicKeyToken = 65E474D141E25E07 " / >
< add <追加
assembly = “ Spring.Services, Version=1.1.2.20125, Culture=neutral, PublicKeyToken=65E474D141E25E07 “ /> 組立 = " Spring.Services 、バージョン= 1.1.2.20125 、文化=中立、 PublicKeyToken = 65E474D141E25E07 " / >
< add <追加
assembly = “ Spring.Web, Version=1.1.2.20125, Culture=neutral, PublicKeyToken=65E474D141E25E07 “ /></ assemblies ></ compilation > 組立 = " Spring.Web 、バージョン= 1.1.2.20125 、文化=中立、 PublicKeyToken = 65E474D141E25E07 " / > < / アセンブリ> < / コンパイル>
< authentication <認証
mode = “ Windows “ /> モード = " Windowsの" / >
</ system.web > < / system.web >の
< spring > <Spring>
< context > <Context>
< resource <リソース
uri = “ ~/Configuration/Objects.xml “ /> のURI = " 〜 / 構成/ Objects.xml " / >
</ context > < / コンテキスト>
</ spring > < / 春>
</ configuration > < / 設定>
Y desde la aplicación との実施以来、
IUserService _ws = ( IUserService ) ContextRegistry .GetContext().GetObject( “UsuarioWS” ); IUserService = ( IUserService ) ContextRegistry 。 GetContext ( ) 。 _ws のGetObject ( " UsuarioWS " ) ;
lblMessage.Text = _ws.Test(); lblMessage.Text = _ws.Test ( ) ;
Con nuestro metodo, Test, como devuelve un string, no hay que castearlo, encambio en el otro metodo tendriamos que estar usando, los objetos de Transfer Objects.我々の方法では、テスト、文字列として、他のメソッドを持っていると転送オブジェクトのオブジェクトを使用するにはカースト、 encambioを返しました。
Les dejo, el ejemplo para que lo vean: 私は 、 例えば見てお帰り:
Consumiendo Web Services con Spring 春のかかるWebサービスに
Sepan disculpar, los horrores de ortografía, ya que lo hice rapidito a este post, Saludos! と私はすぐに、ごあいさつこの記事は、スペルの恐怖を知っている謝罪!
























