First, you have to have a Web service address:
http://www.baiduc.om/XXServices?wsdl
Then add the Web reference in the. NET project and give it the address.
Third, the code:
Using system;using system.data;using system.configuration;using system.collections;using System.Web;using System.web.security;using system.web.ui;using system.web.ui.webcontrols;using System.Web.UI.WebControls.WebParts; Using system.web.ui.htmlcontrols;using webservicestest.xxservices; namespace webservicestest{ Public partial class _default:system.web.ui.page { protected void Page_Load (Obje CT sender, EventArgs e) { giftcardrequest GCR = new Gi Ftcardrequest (); Gcr.orderrequestid = DateTime.Now.ToString (" Yyyymmddhhmmssffff "); Gcr.username =" 9001373 "; Gcr.applytype = 1; gcr.applytypespecified = true;   ; Gcr.saleid = null;   Gcr.recordnum = 1; gcr.recordnumspecified = true;   ; giftcardinfo[] Gcis = new giftcardinfo[gcr.recordnum]; &NBSP ; Giftcardinfo GCI = new Giftcardinfo (); Gci.cardtype = "cardtype_vc_461999" ; Gci.cardvalue = 10000; GCI.CARDVALUESP ecified = true; Gci.cardcount = 1; GCI.C ardcountspecified = true; Gci.cardtotalvalue = 10000; gci.cardtotalvaluespecified = true; Gci.giftvalue = 0; gci.giftvaluespecified = true; gcis[0] = gci;& nbsp   Gcr.cardinfo = gcis; XXSERVICES.XXSERVICESOCSS = new X Xservices.xxservices (); Giftcardresponse giftcardresponse = Ocss.giftcard (GCR) ; } }}
One thing to be aware of is that vs in parsing, int,long,double,datetime and other variables will be resolved to change the name and change the amount of the name plus specified form, as long as the parameters to be transmitted to the specified value =true, so that can pass, otherwise , these types of parameters do not pass through
C#.net calling Java's web Service