Home » , » Build web service client from .NET framework

Build web service client from .NET framework

Written By BoSteR/. on Thursday 22 September 2011 | 01:21

To consume our web service – wheter it is jax-ws, axis web service, .net web service, or WCF – we can create a .net client application to get return value from that web method or operation. In this tutorial, I will show you how to consume jax-ws web service and publish it as a .net web service. Sometimes, we can’t consume java web service directly – I try to use java web service directly from BIRT Report, but I fail.. BIRT Report just can read wsdl schema generated from .net web service so I must pass java web service into .net web service first.

First, create a new ASP.NET Web Service Application from your visual studio (I use visual studio 2008 in this tutorial). Be sure you choose a new project not a new website from visual studio.



Right click on WebService1 project node and choose New Web Reference.



Input your wsdl in url address to get the list of web service operation or web method. And then click go. Automatically it check and search all of web method or operation defined in input wsdl schema. After show the list of available operation, rename web reference name and then click add reference button.



Okay, let’s code.. Create a new Web Service file (.asmx) from WebService1 project node. And then open it.



Input this code behind in ProvideFinancialReport.asmx to create a new web method :

[WebMethod]
 public FinancialReportRef.glGroupAmountDTO[] GetBalanceSheet(int period)
 {
 FinancialReportRef.ProvideFinancialReportService client = new WebService1.FinancialReportRef.ProvideFinancialReportService();
 return client.ProvideBalanceSheetReport(period);
 }

Share this article :

0 comments:

Post a Comment

Keuntungan apabila berkomentar:
1. Blog ini sudah saya set menjadi DOFOLLOW
2. Ada permasalahan, pasti saya jawab
3. Bisa buat request artikel yang dibutuhkan

Silakan Isi KOmentar Dengan Baik

 
Support : Jak | Johny Template | Mas Template
Copyright © 2011. Gigablog-area - All Rights Reserved
Template Modify by Gigablog-area
Proudly powered by Blogger