How to retrieve the Authentication Policy Responses?

In my OAM server(OAM 11.1.1.5), I configured a Response in authentication policy to retrieve the user information after user signed in, the response item named "UserID", value is "$user.userid", type is "Cookie".
My question is:
If I use the WebGate , I will got the response items after user signed in. But I need to develop an Access Gate use the ASDK to replace the WebGate, I don't know how to retrieve the Response items by the ASDK.
Below is the access log captured by Fiddler, "http://auth.mydomain.com/login.aspx" is my customized login page.
-----------------------------Web Gate 10g (IIS)----------------------------
GET http://alan-hu.mydomain.com/oamtest/index.aspx HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://auth.mydomain.com/login.aspx?authn_try_count=0&request_id=6476845472436935518&OAM_REQ=VERSION_4%7EFC5cvGlDZbKLQVbcnbvJSmtBw163LKRGyryAQ8b3CvEpVzVXpqqVE3Nbdcf3K7J957wIyP1d%252bEHNaC92smcnXnYxZr7xSfW8eNMU9NlFRnCUoNBTNXR6jZr8Ug8zqnSau5U%252bEnlInxHudS%252bTzD%252bUy5E9qUfX6lySlHfesJbBBH2yubEJ%252fJVrjbetqv5L295D1mhF%252f7VKyTED%252fAOv2LaVjT7Mi9PGkKDwGkZy9Th5vKVCvT58V%252fEYEgWqawE2LUv%252fb9nh7mdP5gRGBcoDpIeqXWo1F9G767%252feG9vPxM7jZRlGWcMKuYQYSn1oTg%252fL1KBE0KW2EJPvOiBpsplU7e0BvbqWgoSR8ctora%252fj2DHbHZh7m2k1GulUeBRiF3MKbY8XulBEtOYIuc02qVNhlQg2XAHOOk%252bqQ1Z6oua3DWH0aru6jnlFNpsTx6Rk2Q4WHAhXqKPzTwjtVHLgs%252b7Fb32D2Ncz%252fQqx%252b%252bfRtK9yS4YSNcoA3AmF15HoHgFd0lXQzUuQzxsDiho5S6GRc5QY2UvTz%252fsoC0Osismkd%252bUx0yZtxeFJrqA1%252f%252b9eeN%252fEFLMes2%252bxn7jxDP9ahl%252bDKaF9GdypVNZAKSdxSdUKcVCWHneHRRRtqdW8jcUEcTzohuCdCOvEgETz%252fksM7nsFHq01GHakc8174sXvcEE1l1jvsPy8f1CBf75DtguanLVIfenmUEp7kcRhe1vIgiBxmNefuhMKhLV%252fW%252fveJgnuMtWZ%252bgc2Yr%252bYFL5Qe9yz3Zz0Zn2d4PAzZWiS9teBrLqzAk6dU5dM9JTGdthstrhwjovP96J252mAGrRjo%252fFWTByyfrXYoQzETxV8QCDl8kDWaCsZl6V3Ahm94gDcTQrW8MYK8PJDlkUlnVtRtaDevrv4%252fQY%252bFvo78W1iKYM9v9O%252fu0EgPqyOJBg%252fYsBC5fI4VV7OvLZ1YoPb2v6IsepN9avD8nTB6B%252f5ZW0z1IxocptShWgjb5fMrDclA%252fEqgShz0QXzkoOa80cqLu%252bNEG7aUHQQXhZEG42zCN0NaJZbENpksK5ZyKo8U92KdjdSgHeUsFbWA0jZ%252b5nIIYHtesLFwoRZw%252f%252bbceyXAG8%252b6LMjJWYsRpl8bKKJejnOIvzM1dlY7PQ%252bf8eCtGxPkCaCa%252bkuJUkhHcK%252bsS5T2JMyocrBj0hIZsBXiWIrtmGr5h%252bbQIT8TdTfVCmUiv3zBRgDSvQqpJ3hAFc0NIk6zJS%252bPxSquhuYIH15G7zeN%252faW3sRecDpH8%252bFqa7HsT7xDukI2c6Ro3x7Bvp5MBEBSITibP41PJo7f5kPP6wFIk3rMpsC9r7zsSU0pzN3RvWn5M5gNyQ4EZVuwYMFCfgIAjRKRcNUWHebwSMxsOhwrsYESNfA9rFYxtOapzvIcx63B%252baR%252bsQXHI%252fQ4eoP2VBkkCOktummpQ41bDC6elI5LhFrAlSwCT5qv4ytCSBRan6OfMZ%252bLSA5J%252fkFtTvx2aNbV&locale=en_US
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
Cookie: ObSSOCookie=NQqPNA%2BvLoyIujMLO%2F3VWalLMpFbnK6IW4uvEl1piC8hoQVQw%2FqGbDdkVg%2BDDcx1O7YeJhFVYinyJtKF8vI3VTQ%2BL3StaWFRZFLl7KqHnQEqdNVgkn4FCfx49t2KzXNQ%2FxLBkF0olHoNU1P01VTMOdQsq4hzdc6C0B7X6PM9hoaVGWvVmsbUKr5BmqWBG0aHbT1HXgNKlVsDimyz2Q9iy%2Briiu8%2B7x190rm8PTm3uXqEUqs4zuvOSdjZGs77uUFzeYnEzQb6T9gcZqyUvo8OtXqnmrUtPwdva8UrV9GlUkymsWDDtNk3iIqapLxQL1oXHO0iH2KXzXfUAcnQca%2BfNw%3D%3D
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Pragma: no-cache
Host: alan-hu.mydomain.com
HTTP/1.1 200 OK
Cache-Control: no-cache,private
Pragma: no-cache
Content-Length: 649
Content-Type: text/html; charset=utf-8
Set-Cookie: UserID=TEST; path=/
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 05 Jul 2012 08:14:13 GMT
-----------------------------My Access Gate (IIS)----------------------------
GET http://alan-hu.mydomain.com/oamtest/index.aspx HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://auth.mydomain.com/login.aspx?authn_try_count=0&request_id=-8854367975480028914&OAM_REQ=VERSION_4%7EslyJg6j%252fLhjd%252b%252b%252fAFDpFiRr4cPvaT3dU90HILcJWiqxptP4dV%252fNkm4eAzVOznnJmtFh8SNMg4G5K2IuCABhCNxJuFau4XUgfRJtQl03anU6YgU1U%252fc3nRevxNFTZ8bIGALMXNiGbtnNO7c9WRUy%252bekw7T5YidA2qr103PNQD0g36jKosUb2aT2kOYJ0HoZizyW%252bCeI2ARhjuqB4Kc0Kfv%252fHuZCCwcUychXY5cGDlcD2UVl9YRwEGBdcYnweNbps18LqmQNm0%252fJYh2XwW80hNKqRBQBGPUCrYP8A0XIF2%252bUFvViDfqcuK05n0vv5NErxih%252bgtZKRObD6pHsnLOd2a19jUU%252fsFaFYQ0n5UdTN0JSx8yFtvEjdwXKya2PGqKqHa2JzEXhLBXTP5eC4EavAwAMbVRVtNTle%252fU29tDOuUtb1NLTBsqI63ipchzUvouQ6QREcybIXErAMX06X9gpwEtMBXYCppIiV%252b67XpETVzcmMuOl%252bSj9Aha6AKy3yPYlEOTA0o5HqOMe2NTu2sSvJxUJJW0ZYXvqkprkWsaw5SBACH473KY7WS0kqUIiV7UoN60cRdT9I3fAdyuLzWDS7dhGKKTstmpTxClQQNlw7XcDfdczqJJBRSwbZQyomnSPRcO%252f%252f5EY56wSXMJLv5WDkfb3RC4Va5rzXeQn1McihExvrymn6ztZ2A6zZso%252b0jDObEa%252bWioCBinvdK%252bF85qk8ai%252bLal30b27oNzFHKc1AELQ7eP%252bkoyXDYQpVeHfX9ujHGAcEdN4FTGyxBoIohbQb%252fEvl3uEga%252fsufBa%252fVcFVM8WTI59kUSOCKankogv9ABry7CxYByZURjjloQp1CZif%252fuN1ddg5yGMuqmvY7OFz8BIT8mm%252b0klysXJbcneztKbVm2njffvj29gardyyFZ1%252fXDPqMJM1OKVcughERRZW%252fHbBFZ5h%252fupGqhgXaNXZGoeg%252bm8iaAXqrxRIg7NHmK7VnEtIV2qo4iDYWl%252fmf09eJJHMrhhQNRLjV5drgiIwGuPZWVC4irUhXBOPixks8StHx0c0TV%252boIRPxiyupLJKzdlE0SBjplC1%252ffMjiVgQGqZ2zena7601QT89vmuU%252bkO1NoAnN8iwZNF1dT45RDbfg8TLcK1C0CGb29eN7dbwBtbgnAAOXX8F421RTSv9W6UAn%252bttP%252fr2teYO8eXOwFkGMrGkdxdt%252b7%252fj9oH1nJ92Mviv5fiuxhnx9ukvyjQdkdGl0gnGVehnDIQODIXEG0EmEo9%252fJtQkNjgwLlKvTK5bcqIg0Kez27GqEKYhNc4XRsuYsfPQ2byH%252bnnsSDz%252bOLo43ub8vZ7XNWjMtQrNUpfbOwmw5jhfPsU9E2xgYTHGvDdbKBrLXgxQrO%252fSflCzRPhpc5gE9zOOFkCskHxy%252b%252bI8zyJFT7lEaIhz6WgXa5nk3An%252b9yukw2YkoFe1WB%252bfZsgdr%252fq%252b%252blUqjfUf1G5lHDUjODh0qh&locale=en_US
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
Cookie: ObSSOCookie=fhyRb/mqqsz1Tk7Ma3aAvuTmisrarOveqR1FWPkCOKcMG860oQ/V/trZzor0ZPZs4lOl3yHvf83Jj1ahsffCMIueaSlJqHoBZPFB+uLlof9KV6OzyztVzLaxUql/qddGnzajvRs0ti9vKx84AsnMEbZwTcYdf8CNesOh5aSSgz4r6U2D3/rWaT/s1h7vda9rUhD7McjybboHWThM1sKVUGmDFJBA3XdXpwCbG+L35yw5NdablTgB8KOCaAiYDSNsbRkDRluzAxrwD9r/glEq9xI7X3fQ+t40PEQ/sIVFAy+BH6fqXUUEN6D8sc3GKt5RxxTzNzaHLoczlLyakAainQ==
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Pragma: no-cache
Host: alan-hu.mydomain.com
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 05 Jul 2012 08:29:41 GMT
Content-Length: 649

Summary:
1. The Responses of Authentication Policy will be retrieved after user just signed in:
ObConfigMgd.initialize();
ObResourceRequestMgd rrq = new ObResourceRequestMgd("http", "//alan-hu.achievo.com/oamtest/index.aspx", "GET");
ObDictionary creds = new ObDictionary();
creds.Add("userid", "test");
creds.Add("password", "Tt1234");
ObUserSessionMgd session = new ObUserSessionMgd(rrq, creds);
ObDictionary actions = session.getActions("cookie");
ObConfigMgd.shutdown();
2. The Responses of Authorization Policy will be retrieved after execute the ObUserSession.IsAuthorized() method:
ObConfigMgd.initialize();
ObResourceRequestMgd rrq = new ObResourceRequestMgd("http", "//alan-hu.achievo.com/oamtest/index.aspx", "GET");
HttpCookie ObSSOCookie = Request.Cookies["ObSSOCookie"];
string sessionToken = ObSSOCookie.Value;
ObUserSessionMgd session = new ObUserSessionMgd(sessionToken);
if (session.Status.IsLoggedIn && session.IsAuthorized(resource))
ObDictionary actions = session.getActions("cookie");
ObConfigMgd.shutdown();
-----

Similar Messages

  • How to retrieve a password policy response after a ldap bind operation

    Background:
    I've set up openldap with the ppolicy overlay. The overlay works as expected, but after a bind operation I need to get hands on the ppolicy response.
    This can be done manually (with shell commands like ldapsearch) by specifying '-e ppolicy' (general extension).
    But how can i get hands on response from my LoginModule? Code:
    env.put(Context.SECURITY_PRINCIPAL, userDN);
    env.put(Context.SECURITY_CREDENTIALS, inputPassword);
    ctx = new InitialLdapContext(env, null);
    ..is it possible to use ExtendedRequest or UnsolicitedNotificationEvent when the creation of the context throws a NamingException (the bind operation fails due to a locked account).
    Thanks in advance!
    J�rgen L�kke

    Hi,
    I am having the exact same problem in that OpenLDAP is implementing the password policy people login and everything is fine, but then the password expires and bang they are out. I would like to be able to give my users some warning to say that their password will expire in x days or that your password has expired you have X logins left.
    Anyway I have tried the methods suggested here and using ctx.getResponseControls() will either give me null or an array with the exact same objects that I passed in with new InitialLdapContext. What I have did work fine when we used the old jar libraries but we moved to JNDI.
    Any help would be appriciated

  • HT201303 Do any of you apple geniuses out there know how to retrieve the answers to your security questions or at least reset them?  Apparently its to much for the support team. Can't get an answer out of them...

    Do any of you apple geniuses out there know how to retrieve the answers to your security questions or at least reset them?  Apparently its to much for the support team. Can't get an answer out of them...

    Reset Security Questions
    Frequently asked questions about Apple ID
    Manage My Apple ID
    Or you can email iTunes Support at iTunes Store Support.
    If all else fails:
    Go to: Apple Express Lane;
    Under Product Categories choose iTunes;
    Then choose iTunes Store;
    Then choose Account Management;
    Press Continue;
    Now choose iTunes Store Security and answer the bullet questions, then click Continue;
    Sign in with your Apple ID and press Continue;
    Under Contact Options fill out the information and advise iTunes that you would like your security/challenge questions reset;
    Click Send.
    You should get a response within 24 hours by email.
    Presently there appears to be problems on Apple's end, so it may be quite some time before they respond.
    Another user posted the following:
    I got some help from an apple assistant on the phone.
    It is kind of round about way to get in
    Here is what he said to do and it is working for me...
    1) on the device that is asking you for the security questions go to "settings", > "store" > tap the Apple ID and choose view"Apple ID" and sign in.
    2) Tap on payment information and add a credit/debit card of your preference then select "done", in the upper right corner
    3) sign out and back into iTunes on the device by going to "settings"> "store" > tap the Apple ID and choose "sign-out" > Tap "sign -in" > "use existing Apple ID" and you should be asked to verify your security code for the credit /debit card and NOT the security questions.
    4) At this time you can remove the card by going back in to edit the payment info and selecting "none" as the card type then saving the changes by selecting "done". You should now be able to use your iTunes store credit without answering the security questions.
    It's working for me ...I just have to put in my 3 digit security pin from the credit card I am using.
    Good Luck friends!

  • How to retrieve the image back from the running CSS

    how to retrieve the image back from the running CSS

    Gilles,
    Thank for your response.
    But the version we use is sg0740107s and can not download from the Cisco Web site any more.
    Does cisco have a archive site for all the image so that the user can download it?
    sctorcss1# sh ver
    Version: sg0740107s (07.40.1.07s)
    Flash (Locked): 07.20.2.06
    Flash (Operational): 07.40.1.03
    Type: PRIMARY
    Licensed Cmd Set(s): Standard Feature Set

  • How to retrieve the values from a table if they differ in Unit of Measure

    How to retrieve the values from a table if they differ in Unit of Measure?

    If no data is read
    - Insure that you use internal code in SELECT statement, check via SE16 desactivating conversion exit on table T006A. ([ref|http://help.sap.com/saphelp_nw70/helpdata/en/2a/fa0122493111d182b70000e829fbfe/frameset.htm])
    If no quanity in result internal table
    - There is no adqntp field in the internal table, so no quantity is copied in itab ([ref|http://help.sap.com /abapdocu_70/en/ABAPINTO_CLAUSE.htm#&ABAP_ALTERNATIVE_1@1@]).
    - - Remove the CORRESPONDING, so quantity will fill the first field adqntp1.  ([ref|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_WA.htm])
    - - Then loop at the internal table and move the quantity when necessary to the 2 other fields.
    * Fill the internal table
    SELECT msehi adqntp
      INTO TABLE internal table
      FROM lipso2
      WHERE vbeln = wrk_doc1
        AND msehi IN ('KL','K15','MT').
    * If required move the read quantity in the appropriate column.
    LOOP AT internal_table ASSIGNING <fs>.
      CASE <fs>-msehi.
        WHEN 'K15'.
          <fs>-adqnt2 = <fs>-adqnt1.
          CLEAR <fs>-adqnt1.
        WHEN 'MT'.
          <fs>-adqnt3 = <fs>-adqnt1.
          CLEAR <fs>-adqnt1.
      ENDCASE.
    ENDLOOP.
    - You could also create another table with only fields msehi and adqntp and then collect ([ref|http://help.sap.com/abapdocu_70/en/ABAPCOLLECT.htm]) the data to another table.
    Regards,
    Raymond

  • How to Retrieve the Selected Values from selectOrderShuttle using ADF 11g

    Hi Every One,
    Does anyone has idea how to retrieve the selected Items using shuttle and Order of the items using 'SelectOrderShuttle' component ?
    Thanks

    shuttle's valuechangeevent would fire when you shuttle items back and forth.
        public void selectOrderShuttle1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
            ArrayList list = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
            if (list != null){
                for (int i=0; i<list.size(); i++) {
                    int l = list.size()-1;
                    val = list.get(l).toString(); //returns , delimited string
                    if (val != null){
                        val = val.replaceAll("[\\[\\]]", "");
                        StringTokenizer st = new StringTokenizer (val, ",");
                        int nto = st.countTokens ();
                        for (int j = 0; j < nto; j++)
                            String token = st.nextToken ();                     
                ..........

  • How to retrieve the vendor number during creation of Purchase Order?

    Dear SAP experts,
    For our Purchase Orders, during PO creation (t-code ME21 or ME21N) we want to achieve the following:-
    1) default the delivery address to our plant A address if the vendor is local and
    2) default the delivery address to our plant B address if the vendor is foreign.
    At the moment, we are trying to use the user exit enhancement "MMDA0001" to achieve the above.
    The problem is how to retrieve the vendor number from the screen so we could pass the vendor number to ZXM06U32 to check the ktokk field in LFA1 table in the whether the vendor is foreign or local.
    Thank you in advance.
    Regards,
    Alex

    u can do one thing, create 2 partner function, like 1 for local, and second for import vendor.
    or make 2 batch  n activate vendor batch and make mandatory field from SPRO. 
    then goto SHD0, and do one by one step. first time take 1st requirement and second time take second . like that make two variant .
    i dont know how much it will be helpful. bt i want to suggest smth like that only.
    or, go for ABAPER help
    thanks
    nisha

  • My music files etc were all located on my old laptop which was stolen. I have just plugged my iphone in to my new computer and it has deleted all my files. Has anybody got any ideas on how to retrieve the files?

    My music files etc were all located on my old laptop which was stolen. I have just plugged my iphone in to my new computer and it has deleted all my files. Has anybody got any ideas on how to retrieve the files?

    WINDOWS?
    Connect the iPod to your PC. If iTunes starts syncing (ie erasing) your music automatically, hit the X in the upper right hand corner of iTunes display, to the left of the search box, to stop it.
    In Control Panel, Portable Media Devices, double-click your iPod.
    In the Tools menu -> Options, in the View Tab, check "Show hidden files and folders."
    Navigate to the Music folder. On my 'pod, the full path is
    Portable Media Devices\NAME of IPOD (F:)\iPod_Control\Music
    Select all the music folders, and drag and drop them into a folder on your hard drive, or directly into iTunes.
    And you're done! The iPod music folder structure is strange and inexplicable, but once you move your files into iTunes you can set it to automatically organize your folder by artist and album to clean that up. (To do this, in iTunes Edit menu, choose Preferences and in the Advanced tab, check "Keep iTunes Music Folder organized."
    might be out of date worth a try

  • How to retrieve the data from SAP-BAPI by using VB Code

    Hi ,
    I am new to BAPI.
    V have created an application in Visual Basic with the following fields
    EmpNo , EmpName, Addr1, Addr2, City and Phone (Only for Test)
    We have written the code for SAVING the data into SAP. Already we have
    constructed a table with the respective fields in SAP.
    For that we ourself created our own BAPI Structure / Function Group /
    Function Module/ Business Object - RELEASED related elements.
    1)Established the connection successfully.
    2)Stored the data into SAP Successfully and v r in need of
    3)HOW TO RETRIEVE THE DATA FROM SAP (USING GETLIST.....GETDETAIL....)
    Following is the code :
    'BAPI Structure  : ZBAPIEMP
    'Function Group  : ZBAPIEMP
    'Function Module : ZBAPI_EMP_CREATEFROMDATA
    'Business Object : ZBAPIEMP
    'Function Module : ZBAPI_EMP_GETLIST
    Dim bapictrl As Object
    Dim oconnection As Object
    Dim boEmp As Object
    Dim oZEmp_Header As Object
    Dim oImpStruct As Object
    Dim oExpStruct As Object
    Dim oreturn As Object
    Dim x As String
    Private Sub Form_Load()
    Set bapictrl = CreateObject("SAP.BAPI.1")
    Set oconnection = bapictrl.Connection
    oconnection.logon
    Set boEmp = bapictrl.GetSAPObject("ZBAPIEMP")
    Set oZEmp_Header = bapictrl.DimAs(boEmp, "CreateFromData", "EmployeeHeader")
    Set oImpStruct = bapictrl.DimAs(boEmp, "GetList", "EmployeeDispStruct")
    End Sub
    Private Sub cmdSave_Click()
        oZEmp_Header.Value("EMPNO") = txtEmpNo.Text
        oZEmp_Header.Value("EMPNAME") = txtEmpName.Text
        oZEmp_Header.Value("ADDR1") = txtAddr1.Text
        oZEmp_Header.Value("ADDR2") = txtAddr2.Text
        oZEmp_Header.Value("CITY") = txtCity.Text
        oZEmp_Header.Value("PHONE") = txtPhone.Text
        boEmp.CreateFromData EmployeeHeader:=oZEmp_Header, Return:=oreturn
        x = oreturn.Value("Message")
        If x = "" Then
            MsgBox "Transaction Completed!..."
        Else
            MsgBox x
        End If
    End Sub
    Private Sub cmdView_Click()
    End Sub
    COULD ANYBODY GUIDE ME, HOW TO RETRIEVE THE DATA FROM BAPI, FOR THE WRITTEN CODE.

    I didn't seen any other answers but here's how it's been done previously in our organization for a custom BAPI. In this example, we give material and language to return the part description. It's not specific to your project but may give you ideas..
    -Tim
    Option Compare Database
    Dim SAPLOGIN As Boolean
    Dim FunctionCtrl As Object
    Dim SapConnection As Object
    Sub SAPLOGOUT()
    On Error GoTo LogoutFehler
        SapConnection.logoff
        SAPLOGIN = False
    Exit Sub
    LogoutFehler:
        If Err.Number = 91 Then
            Exit Sub
        Else
            MsgBox Err.Description, vbCritical, "Fehler-Nr." & CStr(Err.Number) & " bei SAP-Logout"
        End If
    End Sub
    Function SAPLOG() As Boolean
    'Verbindungsobjekt setzen (Property von FunctionCtrl)
       Set FunctionCtrl = CreateObject("SAP.Functions")
       Set SapConnection = FunctionCtrl.Connection
    'Logon mit Initialwerten
       SapConnection.Client = "010"
       SapConnection.Language = "EN"
       SapConnection.System = "PR1"
       SapConnection.SystemNumber = "00"
       'SapConnection.Password = ""
       SapConnection.GroupName = "PR1"
       SapConnection.HostName = "168.9.25.120"
       SapConnection.MessageServer = "168.9.25.120"
         If SapConnection.Logon(0, False) <> True Then  'Logon mit Dialog
             Set SapConnection = Nothing
             DoCmd.Hourglass False
             MsgBox "No connection to SAP R/3 !"
             SAPLOGIN = False
             SAPLOG = False
             Exit Function
          End If
        SAPLOG = True
    End Function
    Function MatDescr(MatNr As String)
    Dim func1 As Object
    Dim row As Object, X As Integer, ErsteNr As String
    Dim DatensatzZähler As Long
    Dim RowField(1 To 50, 0 To 1) As String, RowLine As Long
        If Not SAPLOGIN Then
            If Not SAPLOG() Then
                MsgBox "No connection  to SAP !", 16
                SAPLOGOUT
                Exit Function
            End If
        End If
    ' Instanziieren des Function-Objektes
    Set func1 = FunctionCtrl.Add("Z_BAPI_READ_MAKT")
    ' Export-Paramter definieren
    func1.exports("MATNR") = MatNr
    func1.exports("SPRAS") = "EN"
    DoEvents
    If Not func1.call Then
        If func1.exception <> "" Then
            MsgBox "Communication Error with RFC " & func1.exception
        End If
        DoCmd.Hourglass False
        SAPLOGOUT
        Exit Function
    Else
      MatDescr = func1.imports("MAKTX")
    End If
    If MatDescr = "" Then
        MatDescr = "PART NO. NOT FOUND"
    End If
    End Function

  • How to retrieve the java object in a proxy service in osb -- Plz help

    Hi all,
    I have a singleton java class which runs whenever the weblogic server gets started and store the output in its object. I need to access this java object from a proxy service in osb.
    We tried using java call out and retrieved that object but we couldn't know how to parse that object into XML.
    We are not sure of using the java call out in osb to solve this purpose because whenever we use a java callout, that particular java code will run which is not the case of singleton class.
    So kindly help us how to retrieve the java object which holds the output without running the java code every time because its already run and holding the output in its object.
    Regards
    Prabhu

    here the doc http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1106656
    but I guess you are already at the stage of getting a POJO in a first Java Callout and passing the POJO to a second Java Callout, which should then return it to OSB as a XMLObject.
    My recommendation is to write a Java function which returns a XMLObject and uses a XMLCursor to populate it with the values of the POJO.
    An XMLObject returned to the OSB is automatically transformed in a "XML" variable (which in reality is represented as a XMLObject in the Pipeline context)
    Here some code sample:
    http://www.javamonamour.org/2010/09/how-to-create-xmlobject-using-xmlcursor.html

  • HELP! How te retrieve the last row in MYSQL database using Servlet!

    Hi ,
    I am new servlets. I am trying to retireve the last row id inserted using the servlet.
    Could someone show me a working sample code on how to retrieve the last record inserted?
    Thanks
    MY CODE
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class demo_gr extends HttpServlet {
    //***** Servlet access to data base
    public void doPost (HttpServletRequest req, HttpServletResponse resp)
         throws ServletException, IOException
         String url = "jdbc:mysql://sql2.njit.edu/ki3_proj";
              String param1 = req.getParameter("param1");
              PrintWriter out = resp.getWriter();
              resp.setContentType("text/html");
              String semail, sfname, slname, rfname, rlname, remail, message;
              int cardType;
              sfname = req.getParameter("sfname");
              slname = req.getParameter("slname");
              rfname = req.getParameter("rfname");
              rlname = req.getParameter("rlname");
              semail = req.getParameter("semail");
              remail = req.getParameter("remail");
              message = req.getParameter("message");
              //cardType = req.getParameter("cardType");
              cardType = Integer.parseInt(req.getParameter("cardType"));
              out.println(" param1 " + param1 + "\n");
         String query = "SELECT * FROM greeting_db "
    + "WHERE id =" + param1 + "";
              String query2 ="INSERT INTO greeting_db (sfname, slname ,semail , rfname , rlname , remail , message , cardType ,sentdate ,vieweddate) values('";
              query2 = query2 + sfname +"','"+ slname + "','"+ semail + "','"+ rfname + "','"+ rlname + "','"+ remail + "','"+ message + "','"+ cardType + "',NOW(),NOW())";
              //out.println(" query2 " + query2 + "\n");
              if (semail.equals("") || sfname.equals("") ||
              slname.equals("") || rfname.equals("") ||
              rlname.equals("") || remail.equals("") ||
              message.equals(""))
                        out.println("<h3> Please Click the back button and fill in <b>all</b> fields</h3>");
                        out.close();
                        return;
              String title = "Your Card Has Been Sent";
              out.println("<BODY>\n" +
    "<H1 ALIGN=CENTER>" + title + "</H1>\n" );
                   out.println("\n" +
    "\n" +
    " From  " + sfname + ", " + slname + "\n <br> To  "
                                            + rfname + ", " + rlname + "\n <br>Receiver Email  " + remail + "\n<br> Your Message "
                                            + message + "\n<br> <br> :");
                   if (cardType ==1)
                        out.println("<IMG SRC=/WEB-INF/images/bentley.jpg>");
                   else if(cardType ==2) {
                        out.println("<IMG SRC=/WEB-INF/images/Bugatti.jpg>");
                   else if(cardType ==3) {
                        out.println(" <IMG SRC=/WEB-INF/images/castle.jpg>");
    else if(cardType ==4) {
                        out.println(" <IMG SRC=/WEB-INF/images/motocross.jpg>");
    else if(cardType ==5) {
                        out.println(" <IMG SRC=/WEB-INF/images/Mustang.jpg>");
    else if(cardType ==6) {
                        out.println("<IMG SRC=/WEB-INF/images/Mustang.jpg>");
    out.println("</BODY></HTML>");
         try {
              Class.forName ("com.mysql.jdbc.Driver");
              Connection con = DriverManager.getConnection
              ( url, "*****", "******" );
    Statement stmt = con.createStatement ();
                   stmt.execute (query2);
                   //String query3 = "SELECT LAST_INSERT_ID()";
                   //ResultSet rs = stmt.executeQuery (query3);
                   //int questionID = rs.getInt(1);
                   System.out.println("Total rows:"+questionID);
    stmt.close();
    con.close();
    } // end try
    catch (SQLException ex) {
              //PrintWriter out = resp.getWriter();
         resp.setContentType("text/html");
              while (ex != null) { 
         out.println ("SQL Exception: " + ex.getMessage ());
         ex = ex.getNextException ();
    } // end while
    } // end catch SQLException
    catch (java.lang.Exception ex) {
         //PrintWriter out = resp.getWriter();
              resp.setContentType("text/html");     
              out.println ("Exception: " + ex.getMessage ());
    } // end doGet
    private void printResultSet ( HttpServletResponse resp, ResultSet rs )
    throws SQLException {
    try {
              PrintWriter out = resp.getWriter();
         out.println("<html>");
         out.println("<head><title>jbs jdbc/mysql servlet</title></head>");
         out.println("<body>");
         out.println("<center><font color=AA0000>");
         out.println("<table border='1'>");
         int numCols = rs.getMetaData().getColumnCount ();
    while ( rs.next() ) {
              out.println("<tr>");
         for (int i=1; i<=numCols; i++) {
    out.print("<td>" + rs.getString(i) + "</td>" );
    } // end for
    out.println("</tr>");
    } // end while
         out.println("</table>");
         out.println("</font></center>");
         out.println("</body>");
         out.println("</html>");
         out.close();
         } // end try
    catch ( IOException except) {
    } // end catch
    } // end returnHTML
    } // end jbsJDBCServlet

    I dont know what table names and fields you have but
    say you have a table called XYZ which has a primary
    key field called keyID.
    So in order to get the last row inserted, you could
    do something like
    Select *
    from XYZ
    where keyID = (Select MAX(keyID) from XYZ);
    Good Luckwhat gubloo said is correct ...But this is all in MS SQL Server I don't know the syntax and key words in MYSQL
    This works fine if the emp_id is incremental and of type integer
    Query:
    select      *
    from      employee e,  (select max(emp_id) as emp_id from employee) z
    where      e.emp_id = z.emp_id
    or
    select top 1 * from employee order by emp_id descUday

  • How to retrieve the Conversation ID in ABAP

    Does anyone know how to retrieve a conversation ID in ABAP?
    You can retrieve the reference ID from SXMSPMAST but how do you retrieve the conversation ID?
    Table names? FM?
    ABAP not Java or UDF
    All suggestions welcome.
    Regards,
    Nay

    As I said in my question, I am not asking for how to retrieve the conversation ID in a UDF. Please read my question....
    I am asking, given a specific message ID, how can I retrieve the conversation id for that message ID on the ABAP stack - e.g. with a function module, what table names etc.
    thanks, Nay

  • How to retrieve the parameter names from a JSP page ? Urgent Please

    Hello,
    Can anybody tell me how to retrieve the parameter names from the JSP
    page. (without using getParameterNames() method.)
    The problem with the getParameterNames() method is I get the Jumbled output.
    I need it very badly
    With regards
    Ananth R
    email:[email protected]
    [email protected]

    Dear duffymo,
    My primary intention is to convert the JSP form information into a XML file.
    If I do not get the Parameter names in the correct order how can I maintain
    tag order in XML file.
    For ex: (JSP PAGE VIEW)
    Name--
    FirstName
    MiddleName
    LastName
    Address--
    Street1
    Street2
    City
    Country
    &so on
    (XML File to be generated)
    <Name>
    <FirstName>Value</FirstName>
    </Name>
    <Address>
    <street1>value</street1>
    </Address>
    & so on
    If I use getParameterNames() to get all the parameter names(Which form the tag names in the XML file ) the Enumeration object it returns will not be in the same order as the text fields in JSP.From this I can not construct a meaningful XML file.
    order means: Order of entry on the page, from top to bottom
    That's it
    Waiting for your responses

  • How to retrieve the procedure value and pass the value to a form field

    How to retrieve the procedure value and pass the value to a form field?

    Set property for the field and the value is the actual procedure/function.
    Cheers

  • How to handle the java.policy file ?

    Can somebody tell me how to handle the java.policy file?
    I always get java.net.SocketExceptions and java.security.AccessControlExceptions while connecting to an appserver from an applet.
    What do I have to write in the java.policy file, where do I have to place it and do I have to call it in some way form my applet?
    Thanks in advance.
    don call

    The java.policy file goes in your jre installation directory in .../jre/lib/security (there should be one there already).
    I used it to allow otherwise restricted permissions for an applet using javax.comm. Add something like the following to the file:
    grant codeBase "URL:http://yourDomainName/rootDirectoryOfYourApp/*" {
         permission java.security.AllPermission;
    This will give the applet downloaded from your site all permissions. You might want to give only certain permissions, I don't know.
    Teri

Maybe you are looking for

  • Trying to solve an unknown problem on my computer.

    I am currently trying to solve a problem that has screwed up many of my applications. iMovie, Windows Media Player, and AOL Instant Messanger on my computer are all malfunctioning for an unknown reason. I am not sure if this is the problem, but when

  • Need to remove password on Satellite A660-18N

    Hi there, I have problem with an access to my laptop Satellite A660-18N, it is asking for the password, that i do not remember (or know). I bought it in UK back in 2010, since then it is the first time i am dealing with this problem. Is there any pos

  • How to scan for Delimiter?

    Hi there, My Vi is reading data from a bar code scanner. I would like to stop my while loop by reading the terminal string "/s" from the bar code that been scanned. May I know to "scan" for the terminal string? Thanks & Regards, Norman

  • How to run two mobile application in netbeans

    if I run the next main.fx ,netbeans execute the build.xml, netbeans will clear and rebuild project, when clear the project command error... and if I run the project,one application is show ,and another can not show. how install the fx mobile simulato

  • An app occupy the same space in the flash memory whether it is iPod Touch 5G or iPad Air / Retina iPad mini?

    For example, Real Racing 3 takes 1.5 GB in my iPod Touch 5G. But it takes the same in the iPad Air / Retina iPad mini?