Custom/Configure WSDL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • huohaodian@gmail.com

    Custom/Configure WSDL

    Hi,

    I have a sample web method return a custom UserInfo object something
    like

    [WebMethod]

    public UserInfo GetUsers()

    { }

    The UserInfo is a class like

    public class UserInfo
    {
    private int mID = 0;
    private string mLName = string.Empty;

    public int ID
    {
    get { return mID; }
    set { mID = value; }
    }

    public string LastName
    {
    get { return mLName; }
    set
    { mLName = value; }
    }

    }

    When I run the web service the asp.net automatically create wsdl
    file with types for UserInfo has something like
    - <s:complexTyp e name="UserInfo" >
    - <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="ID" type="s:int" /
    >
    <s:element minOccurs="0" maxOccurs="1" name="LastName"
    type="s:string" />
    </s:sequence>
    </s:complexType>

    Is it possible to configure or to set element minOccurs ="1" for the
    last name also with some other restrictions, fg max length = 12 etc ?

    Any ways to setting up and use a manually created WSDL file for
    a .net web service?

    Thanks in advance.
Working...