简体   繁体   中英

How to import xsd into wsdl in ASP.NET Webservice?

Please help me to find a solution for the titled problem. I've a Webservice developed in C# with few action. For each action there are two XSDs one for request and another for response. I want that when service is invoked on the client side these XSDs shold get exposed into the wsdl document. Any help to achieve this is most welcome.

You can make changes to webMethods? If yes, you can decorate the methods by the attribute XmlAttributeInclude.

This should include the declaration of XYZ and ABC types in the WSDL of your Web service. I hope I have understood your needs.

    [XmlInclude(typeof(XYZ))]
    [XmlInclude(typeof(ABC))]
    [WebMethod()]
    public XYZ Foo(ABC data)
    {
        return new XYZ();
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM