English 中文(简体)
如何利用轮椅制作网络服务
原标题:how to generate web service out of wsdl
  • 时间:2009-09-08 16:27:26
  •  标签:

Client provided me the wsdl to generate the web service.But when I used the wsdl.exe command it generated the .cs class out of it. I consumed that class in my web service and when I provided the wsdl to client it didn t match their schema. Actually I want the .asmx to be automatically generated from the wsdl so that I could fill in the web method. So that it will exactly match their schema. Hope it make sense.

问题回答

不幸的是,你找回的东西没有灵丹妙药。 在这方面,你可以做些什么:

  • • 在视力演播室指挥普姆普普切窗口使用这一指挥系统设立间课程:

    wsdl.exe yourFile.wsdl /l:CS /serverInterface
    Use VB or CS for your language of choice. This will create a new .cs or .vb file.

  • 创造新的环境。 NET Web Service Project。 输入贵项目的现有文件――上述步骤中产生的文件。

  • 在《刑法》-意见中,《刑法》中文本中文本不适用。

Sorry, you did not provide any text to translate. Please provide the text.

 public class MyWebService : System.Web.Services.WebService, IMyWsdlInterface
 {    
     [WebMethod]
     public string GetSomeString()
     {
         //you ll have to write your own business logic 
         return "Hello SOAP World";
     }
 }

How about using the wsdl /server or wsdl /serverinterface switches? As far as I understand the wsdl.exe command line properties, that s what you re looking for.

- ADVANCED -

http://www.ohchr.org。

Server switch has been deprecated. Please use /serverInterface instead.
Generate an abstract class for an xml web service implementation using
ASP.NET based on the contracts. The default is to generate client proxy
classes.

另一方面:为什么你想要创造过时的技术解决办法? 为什么不把这一网络服务作为世界合作框架服务。 这为这样做提供了目前和更加现代、更加灵活的方式!

页: 1


<><>UPDATE:

当我使用WSDL文档上的wsdl /server时,我就着手制作这一档案:

[WebService(Namespace="http://.......")]
public abstract partial class OneCrmServiceType : System.Web.Services.WebService 
{
    /// <remarks/>
    [WebMethod]
    public abstract void OrderCreated(......);
}

这基本上与你在解决办法中增加ASMX文件时产生的相同的代码(在档案后面的代码——“yourservice.asmx.cs”中)。 我不认为你可以更接近于从WSDL档案中创建ASMX档案。

你们总是能够用人工添加“yourservice.asmx”——它确实含有许多内容:

<%@ WebService Language="C#" CodeBehind="YourService.asmx.cs" 
      Class="YourServiceNamespace.YourServiceClass" %>

页: 1

open -> Visual Studio 2017 Developer Command Prompt

二级

WSDL.exe  /OUT:myFile.cs WSDLURL  /Language:CS /serverInterface
  • /serverInterface (this to create interface from wsdl file)
  • WSDL.exe (this use to create class from wsdl. this comes with .net
  • /OUT: (output file name)

二级

创建新的“Web服务项目”

第3级

增加——和;web service

页: 1

copy all code from myFile.cs (generated above) except "using classes" eg:

 /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")]
    [System.Web.Services.WebServiceBindingAttribute(Name="calculoterServiceSoap",Namespace="http://tempuri.org/")]

public interface ICalculoterServiceSoap {

    /// <remarks/>
    [System.Web.Services.WebMethodAttribute()]
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/addition", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    string addition(int firtNo, int secNo);
}

页: 1

past it into your webService.asmx.cs (inside of namespace) created above in 二级

页: 1

inherit the interface class with your web service class eg:

public class WebService2 : ICalculoterServiceSoap

我们不能保证自动产生的WSDL将与创立服务接口的WSDL相匹配。

在你的设想中,你应将WSDL文件放在你网站上,消费者使用URL。 您应在网上公布/code>。 召集这样说,“吗?wsdl”不会归还WSDL。 见<protocols> Element

2. 还注意到该条第1款:

www.un.org/Depts/DGACM/index_spanish.htm 这一专题专门针对遗产技术。 XML 网络服务和XML网络服务客户现在应当使用https://learn.microsoft.com/en-us/dotnet/framework/wcf/index” rel=“nofollow noreferer”创建。

你们可以利用世界能源论坛(Web Services第一号服务合同)工具,从想象中产生世界能源论坛的代班。 基本上,YOU CAN从Wsdls创建网络服务。 创造牛肉,也许不是,而是很容易bit? 这一工具精彩地融入了VS2005-8(2010年新版本/WCF称为WSCF-blue)。 我先把它装上了,而且总是发现它确实好。

This may be very late in answering. But might be helpful to needy: How to convert WSDL to SVC :

  1. Assuming you are having .wsdl file at location "E:" for ease in access further.
  2. Prepare the command for each .wsdl file as: E:YourServiceFileName.wsdl
  3. Permissions: Assuming you are having the Administrative rights to perform permissions. Open directory : C:Program Files (x86)Microsoft Visual Studio 12.0VCin
  4. Right click to amd64 => Security => Edit => Add User => Everyone Or Current User => Allow all permissions => OK.
  5. Prepare the Commands for each file in text editor as: wsdl.exe E:YourServiceFileName.wsdl /l:CS /server.
  6. Now open Visual studio command prompt from : C:Program Files (x86)Microsoft Visual Studio 12.0Common7ToolsShortcutsVS2013 x64 Native Tools Command Prompt.
  7. Execute above command.
  8. Go toDirectory : C:Program files (x86)Microsoftudio 12.0VCinamd64 相关情况 应当生成CS文档。

    9.Move向适当地点生成了CS文档。





相关问题
热门标签