Archive for the ‘wcf’ Category
Using WSAS business service with .Net trader client
Stonehenge is an Apache project started to demonstrate interoperability between different Web services platforms. Until we get this into the Stonehenge documentation, this is to record how to configure .Net trader client (a web interface written in .Net and is operating in the presentation layer) to talk to business service written using Java and is hosted in WSAS. Prerequisites and installation steps can be found in the Stonehenge wiki.
IMO (also I’ve raised this issue numerous times in the Stonehenge mailing list) problem with .Net WCF code we have now in Stonehenge defines bindings to each and every endpoint. Currently Stonehenge .Net trader client program can talk to business services implemented in .Net, Java (deployed in WSO2 WSAS and Sun Metro) and PHP (implemented using WSF/PHP). Each of these implementations runs on a different port and is having their own URL that they’re exposing the services. When there is a new implementation of the business service using a different framework, in order to point the .Net trader client program to talk to this new business service we have to add a binding into the trader client configuration with a binding specific to that. This, IMHO, defeats the whole purpose of Web services. When you compare .Net WCF to WSO2 Web services frameworks, in the WSO2 family of open source frameworks for many languages, only need the end point. When you want to talk to a different service with similar semantics, you just change the end point URL and everything else just work. There’s no “boilerplate” configuration necessary. That’s loose coupling. Anyhoo, back to the steps,
- Open SQL Management Studio
- Connect to your StockTraderDB database
- Open up
ClientToBstable and make sureDOTNET_CLIENTis usingDOTNET_BS - Open up
Servicetable and change the URL ofDOTNET_BStohttp://localhost:9763/services/TradeServiceWsas - Open
Web.configinand add\dotnet\trader_client\Trade requireSignatureConfirmation="false"to line 99. After the change the line should look like the following,messageSecurityVersion="WSSecurity11WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10" requireSignatureConfirmation="false"> - Build WSAS trunk
- Start WSAS by running
<WSAS dir>\bin\wso2server.bat - Import BS.jks and OPS.jks in
<stonehenge trunk>\stocktrader\wsas\resources\conf. Go to https://localhost:9443/carbon and login as admin. Username: admin, password: admin. - Click on Key Stores -> Add New Key Store. For BS.jks password is ‘yyy’. For OPS.jks password is ‘password’.
- Start .Net services by running
RunServices.bat - Login to .Net trader client by going to http://localhost/trade and tryout the operations