C#調用Oracle ebs生成Webservice,加用戶名密碼驗證

public void GetDept()
        {
            CUX_BASEINFO_OA_PKG_Service client = new CUX_BASEINFO_OA_PKG_Service();
            var inputParameters = new InputParameters();
            inputParameters.P_ACTION_ID = "1";

            var userToken = new UsernameToken("ERP_API", "qazwsx12345", PasswordOption.SendPlainText); //須要usertoken

            var context = client.RequestSoapContext;
            context.Security.Tokens.Add(userToken);
            context.Security.Elements.Add(new MessageSignature(userToken));



            var SOAHeader = new SOAHeader();//soapheader的參數中沒有username和password,須要建立usertoken
            SOAHeader.Responsibility = "APPLICATION_DEVELOPER";
            SOAHeader.RespApplication = "FND";
            SOAHeader.SecurityGroup = "STANDARD";
            SOAHeader.NLSLanguage = "SIMPLIFIED CHINESE";
            SOAHeader.Org_Id = "81";
            client.SOAHeaderValue = SOAHeader;
            
            var OutputParameters=  client.CUX_GET_BASEINFO_TO_OA(inputParameters);
        }
相關文章
相關標籤/搜索