. NET calling Java Service proxy class methods

Source: Internet
Author: User
Tags wsdl

Generating proxy class calls through the Svcutil.exe tool

1. Locate the following address "C:\Windows\System32\cmd.exe" command-line tool, right-run as administrator (depending on whether the system is Win7)

2. Enter the following command: "C:\Program Files\Microsoft Sdks\windows\v7.0a\bin\svcutil.exe"/out:c:\wcfclint\clientcode.cs/config:c : \wcfclint\app.config http://localhost:81/WCFServiceTest/CNPatentSearchService.svc

Description

Parameter 1: "C:\Program Files\Microsoft Sdks\windows\v7.0a\bin\svcutil.exe" means the address of the SvcUtil.exe tool

Parameter 2: "C:\WCFClint\ClientCode.cs" refers to the address where the generated proxy class output is stored

Parameter 3: "C:\WCFClint\app.config" refers to the output storage address of the configuration file that is stored in the calling WCF Service program directory

Parameter 4: "Http://localhost:81/WCFServiceTest/CNPatentSearchService.svc" refers to the address of the WCF service deployed to IIS

3. After running the above command, two files will be generated in the "C:\WCFClint\" directory, ClientCode.cs and app. Config

(the necessary information such as the root node of the WCF service has been configured for us in C:\WCFClint\app.config, of course, if you can also modify some of the parameters yourself)

4. Add ClientCode.cs and App. config to the project where you want to invoke the WCF service

5. Add a reference to the "System.ServiceModel" and "System.Runtime.Serialization" assemblies in the project where you want to invoke the WCF service

6. Since then all the operations of the deployment and proxy class generation have been completed, we only need to instantiate the service class in the ClientCode.cs in the project and call the methods in it

My actual operation "C:\Program Files (x86) \microsoft Sdks\windows\v7.0a\bin\svcutil.exe"/out:c:\wcfclint\clientcode.cs/config: C:\WCFClint\app.config http://local:8001/womaiapp/wmsServiceCancelAllocateout?wsdl
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (r) Communication Foundation, Version 3.0.4506.2152]
Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from ' Http://local:8001/womaiapp/wmsServic
ECANCELALLOCATEOUT?WSDL ' using Ws-metadata Exchange or DISCO.
Generating files ...
C:\WCFClint\ClientCode.cs
C:\WCFClint\app.config

C:\windows\system32>exit Oracle queries using wmscancelallocateoutserviceclient client= NEW                   Wmscancelallocateoutserviceclient ();  blresult= ("1" ==client.cancleallocateout (Allocateout.allocateoutno,allocateout.targetwarehouseno)); Find Dblink If very slow can add a/*+driving_site (XXX) in this way */, query quickly

. NET calling Java Service proxy class methods

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.