Form digest for REST service

Hi <o:p></o:p>
I have created a rest service to update list items in share point 2013. This needs to be consumed by a java application.I understand that any
POST request should have form digest in the header<o:p></o:p>
I tried to test this with a C# console application.I used /_api/contextinfo with a POST request with proper credentials,but i get 401unauthorised
error.<o:p></o:p>
How to get form digest by passing credentials from a java application.<o:p></o:p>

See if this helps:
http://msdn.microsoft.com/en-us/library/jj164022(office.15).aspx#WritingData
"You can retrieve this value by making a POST request with an empty body to
http://<site url>/_api/contextinfo"
Then extract the "d:FormDigestValue" node in the XML that was returned.
Also see here: (these aren't Java examples, but may give you an idea.)
http://blogs.msdn.com/b/nadeemis/archive/2012/10/23/tip-handling-http-403-forbidden-when-querying-the-search-rest-service-using-the-postquery-method.aspx
http://www.c-sharpcorner.com/UploadFile/d2ee01/how-to-modify-sharepoint-2013-objects-using-rest-calls/
Mike Smith TechTrainingNotes.blogspot.com
Books:
SharePoint 2007 2010 Customization for the Site Owner,
SharePoint 2010 Security for the Site Owner

Similar Messages

  • ADF Mobile: JSON support for REST services?

    Will the JSON format be supported for REST services using ADF Mobile? Is there a workaround for now that can be used?

    For now you can write a Java class to communicate with your JSON service, and expose it as a data control.

  • Getting error while writing JUnit test case for RestFul Services

    Hi All,
    I have written Restful services in Netbean 6.8.
    It's running well...no issues.
    {color:#0000ff}While writing JUnit test cases for them, I am getting following error:
    {color}{color:#993300}Testcase: testGetAuthenticated(com.ct.services.LoginServicesTest): Caused an ERROR
    Implementing class{color}
    java.lang.IncompatibleClassChangeError: Implementing class
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
    at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:160)
    at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:65)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
    at com.ct.services.LoginServices.getAuthenticated(LoginServices.java:205)
    at com.ct.services.LoginServicesTest.testGetAuthenticated(LoginServicesTest.java:84)
    Test com.ct.services.LoginServicesTest FAILED
    F:\NetbeanProjectsWorkspace\DemoProject\nbproject\build-impl.xml:972: Some tests failed; see details above.
    BUILD FAILED (total time: 11 seconds)
    {color:#0000ff}Strange thing is that when I am commenting below lines and its related calls:
    {color}
    {color:#ff0000}EntityManagerFactory mEmf = Persistence.createEntityManagerFactory("AnyName");
    EntityManager mEm = mEmf.createEntityManager();
    {color}
    {color:#0000ff}from my code, JUnit test cases are working fine.
    {color}Anybody having any idea about this ?
    Thanks
    Avi
    Edited by: Avi007 on Aug 28, 2010 5:17 AM

    Hi All,
    [http://stackoverflow.com/questions/2778295/test-driven-development-problem]
    Please refer the above link for the solution
    Thanks
    Avi
    Edited by: Avi007 on Aug 30, 2010 12:33 AM

  • HTTP Adaptor for RESTful service calls -- Proxy Settings?

    Hi Guys,
    I have successfully configured an HTTP Adaptor on my Access Server, imported a REST service function, set up DTDs etc etc all ok.
    Now, when it comes to calling this function in a data-flow, the run of the job just times out while calling the function. I have tried this via another route and this time-out occured their too until I entered my proxy server login details.
    I am assuming I need to do this for the HTTP Adaptor but there is no parameter/setting around for me to do this.
    Could you please tell me how I can get my proxy settings in place for the HTTP call? If the solution involves the "axis2" file, please could you give me clear/step-by-step instructions on how to use this and deploy it as that area is all new to me.
    Thanks very much for any help.
    Flip.

    you can set the proxy server details in the Additional JVM Arguments of the HTTP Adapter Configuration using the following syntax. Add this to existing memory setting args
    -Dhttp.proxyHost=<enter proxyserver name> -Dhttp.proxyPort=<enter proxy port>
    have no idea how to specify the credentials, not sure if that can be done using Java arguments, if you are on windows try running the Jobservice under named user, and see if it works

  • Security of RESTful services in weblogic 10.3.x

    Hello,
    What are the different types of security options available for RESTful services in WebLogic Server 11g Release 1 (10.3.6)?
    Does the platform support X.509 certificate based client authentication?
    Best Regards,
    Kartheek

    Hi Kartheek,
    Yes,OAG supports the client authentication based on X.509 certificate.
    You can use the SSL filter and “Authentication By Attribute” filter .
    Let me know if you need more detail.
    Thanks

  • How to call rest service with POST Http method in SMP2.3 HWC?

    Hi Experts,
       I am doing a sample for Rest Service in smp.
    http://192.168.1.119:8086/Test/services/Products
    I am calling the above service in the smp it is pulling the data from the service with GET Http Method.
    Now i want to call this service for login functionality.
    http://192.168.1.119:8086/Test/services/auth?uname=:uname&pass=:pass
    here :uname &:pass values are argument values for the uname & pass.
    the output of the service is
    http://192.168.1.119:8086/Test/services/auth?uname=sravanya.k&pass=sravanya
    <?xml version="1.0" encoding="UTF-8"?>
    <details>
    <responsecode>200</responsecode>
    <profile>
    <firstname>sravanya</firstname>
    <lastname>k</lastname>
    <email>[email protected]</email>
    <chart_type>North</chart_type>
    <location>MACHILIPATNAM</location>
    <language>English</language>
    </profile>
    </details>
    How can i do this?
    Thanks & Regards,
    Sravanya K

    Create a uriTemplate like this
    /auth?uname={uname}&pass={pass}
    use GET method only.
    generate the personalization keys.

  • Is there a way to use REST service to query data from a forms collection?

    I want to query and retrieve data from a SharePoint forms collection. I have a forms library that has multiple documents all being created using the same template.
    I need to query and retrieve data from it using oData/ReST API.
    I could see the /_vti_bin/listdata.svc and it seems I cannot get the forms data using this.
    What will be the best approach?
    Does that helps?
    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”.
    Thanks,
    Kangkan Goswami |Technical Architect| Blog: http://www.geekays.net/
    http://in.linkedin.com/in/kangkan

    Hi,
    Rest service is not available to retrieve the data in forms.
    For this issue, the common workaround I know is to first populate the form fields as columns in form library, then retrieve the columns value instead. You can also use rest service in this way.
    If it is not convenience this way, please provide more information about the scenario to get the data.
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Custom service (using Reader Extensions) for REST invocation

    Hello,
    is it possible to implement and configure a custom service (using Reader Extensions) for REST invocation?
    Best regards
    CommanderPeek

    Yes LiveCycle does support REST as an endpoint http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=000562.html

  • How to configure proxy services in OSB for Rest based services?

    how to configure proxy services in OSB for Rest based services implemented using Jersey (Rest).
    The Client need to contact OSB proxy servies by posting application/xml using jersey client and OSB proxy service will call the OSB business service.
    i would like to know how to get this request in OSB proxy service and send it to the business service and get the response back.

    I would suggest you refer to the below links:
    https://blogs.oracle.com/jeffdavies/entry/restful_services_with_oracle_s_1
    https://blogs.oracle.com/jamesbayer/entry/using_rest_with_oracle_service
    Hope this helps.
    Thanks,
    Patrick

  • Role Assignment Discovery Issue for Files and Folders through Sharepoint REST services

    To preface, I am a decided Sharepoint newbie in every sense. I am trying to use the Sharepoint REST services (Sharepoint 2013) to walk the folder and file structure of my Sharepoint server and, determine as I go, the Role Assignments (and subsequently
    Permissions) on those folders and files. I'm using an Administrator credentials and I'm actually able to successfully do it but I've run into some caveats. All the caveats begin with this; when I'm examining a folder, for example:
    /_api/Web/GetFolderByServerRelativeUrl('/sites/cmisdev/Development')/ListItemAllFields
    I receive either an empty list or an error response doc when following the link supplied for ListItemAllFields.  When following that kind of link for folders, I either get:
    <d:ListItemAllFields
    m:null="true"
    />
    or an error response document that says "The object specified does not belong to a list." When I hit the /ListItemAllFields endpoint for files, I receive a response with a link for Role Assignments which subsequently also works and I get the
    info I need. So, is this a bug? Why does the link returned from Sharepoint work for files and not folders? So, google, google, google, and I discover that there is another possible way to get at the Role Assignments (and that the object does, indeed, belong
    to a list!).
    If I know the Title (or the guid) of the folder in question, I can use the following endpoint:
    /_api/Web/Lists/GetByTitle('Development')
    If I use that endpoint, I get the information I would have expected to get from following /ListItemAllFields and the subsequent Role Assignments links all work and I get what I need. If there's a bug and this is how I have to work around it, that's fine
    but I have yet to discover how to dynamically determine the Title of a given folder nor am I sure if all Titles are supposed to be unique within a given Sharepoint server. I'm assuming that the folder name as represented in the server relative URL and the
    Title may be different and this is where my newbishness may start to shine if I'm misunderstanding what a "List" is supposed to be in Sharepoint. Anyway, I did find that I could use the Properties endpoint to perhaps get the Title, for example:
    /_api/Web/GetFolderByServerRelativeUrl('/sites/cmisdev/Development')/Properties
    gives me:
    <d:vti_x005f_listtitle>Development</d:vti_x005f_listtitle>
    whose value I assume I could then supply to the /GetByTitle endpoint and be golden. However, "vti_x005f_listtitle" just sounds a little too deep to be something I should be relying on but maybe that's kosher. That's part of what I'm trying to
    find out. Also, if there is a way to use the Sharepoint REST API to discover the guid of a given object, then I could look it up in that way.
    So, in summary:
    1. Am I going about getting folder Role Assignment information in the wrong way? Based on the CSOM examples I've seen, I believe I'm doing it correctly and that the answer to #2 below is a resounding "Yes!" :)
    2. Is it a bug if I'm not able to use /ListItemAllFields on folders using the server relative url?
    3. If I'm supposed to use GetByTitle as a workaround, am I discovering that Title correctly through /Properties? Seems quite circuitous and awkward. Are Titles required to be unique throughout a given Sharepoint server?
    4. If I'm supposed to use the guid, how can I use the REST interface to discover an object's guid? Once we get down to the Role Assignments and other links, the guid appears in those links but I don't know how to discover it independently if that's the
    path I should use to get the data I described above.

    Upon further research, I'll answer my own question for the benefit of some other potential future newbie.  The answer to question number 1 above is "Not exactly.".  The server relative URLs I was using corresponded to lists (which are
    returned as a collection through /_api/web/lists).  I was treating them mentally like regular folders.  That, coupled with the fact that accessing their data as I showed above returns a ListItemAllFields link, made me think that was the way to get
    the Role Assignments just as I would for files and, as it turns out, "real" folders and sub-folders created under these lists.  That was the other problem with thinking of these lists as regular folders.  So, ListItemAllFields works on
    all files and folders in a list.  However, if you want Role Assignments for the lists themselves, you can keep track of the Titles and\or Guids from the /_api/web/lists that you're interested in (in my case, all non-hidden "document library"
    type lists) and then access those Role Assignments as I discussed in questions 3 and 4 above.  For example, from the /_api/web/lists collection from my test server, the "Development" document library Role Assignments are accessable via /_api/Web/Lists(guid'cd242eeb-aafa-4efa-aecc-9bbdf8e3d459')/RoleAssignments
    or /_api/Web/Lists/GetByTitle('Development')/RoleAssignments.

  • About the Error after applying product key for bing search rest service

    For the Project Siena I ve created the product key for Bing search rest service and i applied that product key which is valid even though i got the error when i click TRY button .can anyone please help me to find the solution
    There was an error in retrieving sample data. Error : Unable to reach service. Please check if your service connector configuration is valid and you have network connectivity

    Hello,
    Thanks for your post. I am jotting down few steps to get the Bing search account key (you may have completed many/all of these).
    To add Bing Search Service, go to
    https://datamarket.azure.com/account/datasets and search for "Bing Search API". After you have subscribed to the service, navigate to "My Data" and click on Use. Click on Show and copy the
    Primary Account Key information.
    Note if your key contains a special character like / or = then double clicking on the content will copy the key partially.
    Make sure you have copied the full key correctly. If the is incorrectly pasted in Siena's Primary Account Key field, you will get the error below:
    This is similar to the error you have posted. Since the Primary Account Key is masked you can never be sure the contents are correct. It's best to clear the field and paste the key again.
    If you still face the issue, please post your machine configuration (x86/OS) information.
    Hope this helps,
    -Karthik
    This posting is provided "AS IS" with no warranties and confers no rights.

  • Can I create JDE BSSV (Business Services) for REST based services?

    Can I create JDE BSSV (Business Services) for REST based services? If yes, then how? In what way it will be different from SOAP based?

    Hi
    Within Oracle SOA Suite, Oracle Service Bus would handle the REST side of things, which in turn would call the JCA adapter to talk to your JDE backend, or vice versa.
    Checkout the JDE adapter docs - http://www.oracle.com/technetwork/middleware/soasuite/documentation/jdewardsweb-1954164.pdf
    and the OSB Docs - HTTP and Poller Transports - 11g Release 1 (11.1.1.7)
    OSB 11.1.1.7 introduced additional REST support, so I'd recommend using that version onwards.
    Cheers
    iain

  • Sample "REST" service for context based routing in OSB

    Hi All,
    We have a requirement where we have to do context based routing in OSB.For that, we need to have a Rest Service which should do context based routing.In the payload there will be Action tag, based on the Action tag we need to invoke corresponding Business service, if you have any sample service like this please send it to me.
    As I am quite new to Rest services.It will be helpful if I get a sample service.
    Thanks In Advance

    http://prsync.com/oracle/restful-services-with-oracle-service-bus-6243/
    http://blogs.oracle.com/jamesbayer/2008/07/using_rest_with_oracle_service.html
    http://blogs.oracle.com/jeffdavies/2009/06/restful_services_with_oracle_s_1.html
    Regards,
    Anuj
    Edited by: Anuj Dwivedi, TCS on Aug 17, 2010 3:02 PM

  • Form class for service notification

    Hi All,
    I am unable to find form class (In transaction EFCS) for service notification for shop papers printing. Can anyone help me in finding form class for this.
    Thanks in advance.
    Vijay

    Tcode OIDA (I had to type /NOIDA 
    IMG>Plant Maintenance and Customer Service>Maint and Serv Processing>Maint and Serv Notifications>Notification Procesing>Notification Print Control

  • SOAP proxy for RESTful business service

    Hi,
    I have a requirement to consume a 3rd-party RESTful web service from within WebLogic Integration 9.2.3.
    My organisation also has an OSB 10.3 installation which is lucky since WLI 9.2.3 does not readily support RESTful service consumption.
    My plan is therefore to proxy the RESTful service via the OSB with a SOAP proxy service and consume the proxy from WLI.
    Can anyone provide guidance on how I might go about this?
    Cheers,
    Rob

    I want to give it a try :)
    1. Create a business service with the 3rd-party RESTful web service WSDL and point it to the URL where it is currently deployed/hosted.
    2. Create a Proxy Service to invoke the 3rd-party RESTful web service via the business service. (I think you will need to define a simple WSDL to be able to use this service from WLI)
    3. Then import the ProxyService WSDL in WLI and invoke the same via the WebServiceControl.
    I hope this works out well for you.
    Thanks,
    Patrick.

Maybe you are looking for

  • Cabinet On my line?

    Hi all , Sorry if this gets posted in the wrong section as im new to this . But i was wondering how can i find out if i have a cabinet on my line?. as i was told theres 2 different types of line 1 where the exchange goes to the cabinet an then from t

  • Help with Purcased items on iTunes

    I'm purcasing a new computer, is it possible to have all my purcased items from iTunes to be put on my new computer.

  • Import from a camera that contains mts files

    what is the required file structure for FCE to import from a camera that contains mts files

  • Where is default icons location in oracle form 10g

    hi, Can anybody please tell me, where is the default(given below) icons location in oracle form 10g. I want to user that icons in my form. Image: !c:\icons.gif! thanks mohan

  • File in Flex3

    hi , I am using flex3 and i just wanna write an xml content in to an file and need to read from there... I saw flash.filesystem .File, flash.filesystem.Filestream which belongs to Adobe AIR and also done a sample , it was ok during compilation of uti