Expose different classes to multiple ports in an ASP. NET service in a way similar to Java WS -*

Source: Internet
Author: User
Tags wsdl

The following is an example of SSO in JBoss:

  • Sso2.war # RoleComponent (Wsdl)
    • GetRoles
    • GetTheRoleFunctions
    • GetTheRoleFunctionsByCode
    • GetTheSystemRoles
    • GetUserBySystemNameAndRoleId
    • IsFunctionInRole
  • Sso2.war # UserComponent (Wsdl)
    • Login
    • LoginUser
    • GetFilterNodes
    • GetFunctions
    • GetTheUserFunctions
    • GetTheUserNodes
    • GetTheUserRoles
    • GetTheUserRoles2
    • GetUserByID
    • GetUsers
    • IsInFunction
    • IsInFunctionByCode
    • IsInRole
    • IsInRoleByCode
    • GetUsers
  • Sso. war # RoleComponent (Wsdl)
    • GetRoles
    • GetTheRoleFunctions
    • GetTheRoleFunctionsByCode
    • GetTheSystemRoles
    • GetUserBySystemNameAndRoleId


    It is not hard to see that different classes and webmethods are provided in a Service.
    However, if you register two in ASP. NET Web services, the following error occurs:
    Parser Error

    Description:An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message:There can be only one webservice directive.

    Source Error:

     
    Line 1:  <%@ WebService Language="C#" CodeBehind="UserService.asmx.cs" Class="Inventory.UserService" %>
    Line 2:  <%@ WebService Language="C#" CodeBehind="UserService.asmx.cs" Class="Inventory.GroupService" %>


    Source File:/UserService. asmxLine:2


    Therefore, if you want to remove the Java Web Service in a similar way and prevent the Service client program from modifying too much code, you can use Port to separate a Web Service:

    <Service name="SSOService">

    <Port binding="Tns: NodeServiceBinding"Name="NodeServicePort">

     <Soap: addressLocation="Http: // win2003/sso2/service/NodeService

  • 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.