Application WSDK - Practice WebServices route and routing (on)

zhaozj2021-02-17  77

Application WSDK - Practice WebServices route and routing

Mood

2002-11-18

Article Type: in-depth

Difficult Level: 8/9

Version: 3.46

Not long ago, I thought we have discussed the issue of WSDK, then we discussed about DIME issues. And when I tried to debug the function in WSDK, I have encountered some problems, simply, I can't achieve the simple route of SOAP, and the mistakes have made me a little frustrating, almost repeated Reicker unavailable error, more detailed is my "system.unauthorizedaccessException: Access to the path" xxxxxx.config "s denied." I am magnified by ASP.NET to a height that makes me feel surprised, but wrong Still, I am a little frustrating, and after my windows.net has finally expired, a new starting point began in the forced, because I need to reinstall my system.

The WSDK has also changed, because when I get the next version, all namespaces have changed, I saw the same argument in the discussion group on the network, and the reliable news will always be Continuation to the official version of WSDK. The legend is no longer compatible with the previous version of the previous version from the Builds 5217. Specifically, this change occurs:

Microsoft.wsdk. * -> Microsoft.Web.Services. *

Microsoft.wsdk.dll-> Microsoft.Web.Services.dll

Microsoft.wsdk.wsdkclientProtocol-> Microsoft.Web.Services.WebserviceSClientProtocol

Microsoft.wsdk.wsdkextension -> Microsoft.Web.Services.WebserviceSextension

Microsoft.wsdk.configuration.wsdkconfiguration-> Microsoft.Web.Services.configuration.WebserviceSconfiguration

Microsoft.wsdk.configuration.install.wsdkinstaller-> Microsoft.Web.Services.configuration.install.WebservicesInstaller

->

Simply put, all WSDK has changed to Web.Services, and the frustration of modifying the namespace has brought new changes. After that, I found the problem I encountered before, because the problem is like autumn disappear, I don't know if the new version of the question, or I reinstall the problem of the system, but I am happy at that moment.

Ok, still care about our ideas, start today's WSDK application trip. Simply put, we need to get a routing to get the resources we really need. This is mainly used in our distributed applications, such as we request a virtual named resource, then our server selects the active resource based on the mapping on the server, and then returns to our corresponding function. That is too unprofessional J, but I hope to clearly explain the Route and the REFERRAL. That is to say, after DIME, we will focus on the application of WS-Routing and WS-REFERRAL protocols.

Specifically, this is this: 1. Customer requests a non-existing resource link request inputQuestion.asmx

2. Our Server uses Httphandlers to find the definition of our pre-defined resources and return the request.

3. The customer gets the web services description information returned by the server. And call methods or functions.

4. Server returns the result of the corresponding function call.

It seems more easy to say:

Ok, let's take a look at it. Before this, please forgive me for violations, because I re-used the WebServices I have said before, and the last article I have talked about the discussion WEBSERVICES for A B

1. We produce a A B Web SERVICES

2. Plus the route function of WSDK.

3. Define mapping files and selection

4. Generate the client to test.

1. Generate a B WebServices and plus routing

I will not say more about the Web Services that produces A B. We do the following work after the encoding test is successful.

A. Add a reference to Microsoft.Web.Services.dll in the project.

B. Add WS-Routing Support in Web.config

priority = "1" group = "0" />

C. Compile Web Services app and test it.

Here you can write a simple client for testing. In the previous article, I also said that I use MSSOAP TRACE to track the way, you can see the round-trip SOAP information.

First create a Proxy class

CD / TMP WSDL / L: CS /OUT :MATH.CS / N: Proxy / Urlkey: MathURL http://localhost/myproject/wsdk/wsreferral/math.asmx? WSDL

Then also need to join the reference to Microsoft.Web.Services.dll, join in the generated Proxy class:

USING Microsoft.Web.Services;

The inherited parent class is then modified from the original System.Web.Services.protocols.SoAphttpClientProtocol to Microsoft.Web.Services.WebserviceSClientProtocol (see prior art in the specific steps)

Then add, the code below after the client's event code:

Private void btnadd_click (Object Sender, System.Eventargs E)

{

INT A = 0;

INT b = 0;

Int results = 0;

a = int.parse (txta.text);

B = int.parse (txtb.text);

Proxy.Service1 SVC = New Proxy.Service1 ();

Result = svc.add (a, b); string msg = a.tostring () " " b.toString () "=" result.toString ();

LBLRES.TEXT = MSG;

}

The results of the operation are as follows:

especially:

This article original, 9CBS signature start, all text and photo copyright. Do not propagate, reprint, or adaptation without authorization.

If you have any questions or suggestions, please email new2001@msn.com

转载请注明原文地址:https://www.9cbs.com/read-30980.html

New Post(0)