POST using REST - encoding issue

Hi guys,
We have a REST web service that uses the Jersey API, running on a WebLogic Portal 10.0 server. This service must receive data that includes accentuated characters, such as e acute (é), populate an entity and store in a database. Using an HTML form to test, we observe the following behavior:
1. On the 1st submit, accentuated characters are replaced with reversed question marks in the database - clearly an encoding error.
2. On the 2nd and subsequent submits, accentuated characters are interpreted properly and saved correctly in the database.
HTTP request analysis shows that the only difference between the 2 requests is that the 2nd request includes a JSESSIONID cookie, so basically the session cookie. Removing the cookie after a successful submit then resubmitting the form produces again garbled characters in the database. This behavior can be reproduced on servers running on Windows and Linux (Red Hat).
Can anybody explain this behavior to me? How does having an HttpSession open change how character encoding is performed?
Thanks.

Since UploadedFile.getInputStream() returns an InputStream, you can impose the character encoding when you wrap it with a Reader.

Similar Messages

  • 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

  • Unable to upload Files to child site collection using REST

    Dear All,
    I referred this article http://www.shillier.com/archive/2013/03/26/uploading-files-in-sharepoint-2013-using-csom-and-rest.aspx for uploading documents to SP Document Library and it works fine for any document library under the root site collection(
    for example "http://<server name>/Shared Documents" but when i upload the same document to one of the sub site collection created using Managed Path( the site collection path is "http://<server name>/files/Case" and the library
    name is "records") it fails and i get below error:
    The security validation for this page is invalid. Click Back in your
    Web browser, refresh the page, and try your operation again, Error Code -2130575251 Microsoft.SharePoint.SPException"
    Any help suggestion to resolve this? I've almost tried everything to resolve this issue but no luck.. appreciate any help
    for this..
    Regards,
    Vishal

    Hi,
    According to your post, my understanding is that you had an issue uploading files to subsite using REST.
    I had made a simple code demo below, it will upload a file to Document Library after you make your selection with the File control.
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    function uploadFile(){
    //alert(2);
    if (document.getElementById("file").files.length === 0) {
    alert('No file was selected');
    return;
    var parts = document.getElementById("file").value.split("\\");
    var filename = parts[parts.length - 1];
    var file = document.getElementById("file").files[0];
    uploadFileSync("http://YourSite", "Documents", filename, file);
    //Upload file synchronously
    function uploadFileSync(spWebUrl , library, filename, file)
    //alert(3);
    var reader = new FileReader();
    reader.onloadend = function(evt)
    if (evt.target.readyState == FileReader.DONE)
    var buffer = evt.target.result;
    var completeUrl = spWebUrl
    + "/_api/web/lists/getByTitle('"+ library +"')"
    + "/RootFolder/Files/add(url='"+ filename +"',overwrite='true')?"
    + "@TargetLibrary='"+library+"'&@TargetFileName='"+ filename +"'";
    $.ajax({
    url: completeUrl,
    type: "POST",
    data: buffer,
    async: false,
    processData: false,
    headers: {
    "accept": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val(),
    "content-length": buffer.byteLength
    complete: function (data) {
    //uploaded pic url
    console.log(data.responseJSON.d.ServerRelativeUrl);
    error: function (err) {
    alert('failed');
    reader.readAsArrayBuffer(file);
    </script>
    <input type="file" id='file' onchange="uploadFile()"/>
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected].
    Jason Guo
    TechNet Community Support

  • UTL_SMTP Encoding Issue

    I've written a PL/SQL package for emailing.
    The issue that I'm having is that the final encoded stream has extra characters ( exclamation mark + new line + space ) "randomly" scattered throughout it.
    If the email is plain-text, it's not a big deal, it just looks messy and unprofessional.
    However, when sending HTML formatted emails, those extra characters can break HTML tag logic and thus, visually, hide some data/text.
    This package allows for the creation of nicely formatted HTML alert emails which have a common look-and-feel.
    However, when I view the email in my email viewer (+MS Outlook 2007+), there are additional characters inserted in the email source. However, if I user DBMS_OUTPUT.PUT_LINE( ... ) to view the dynamically created HTML code, created at run-time, it's clean.
    I had previously created a similar process in UNIX Shell Script and a 2nd in webMethods.
    The webMethods version also had some issues with the encoding (+we had to use base64 encoding to fix that+), however using base64 didn't fix the issue that I'm having in ORACLE.
    My package code can be found at:
    [http://www.mediafire.com/?sharekey=5b5b57bc23b48b866e7203eb87368129f0607387acaaf72db99f3f1679ee9294]
    Any help would be greatly appreciated.
    To reproduce my issues:
    BEGIN
    WM_EMAIL_HANDLER.SEND_ALERT ( in_processName => 'Test Maker',
    in_msg => 'Something gone done broke. You''d better fix it.',
    in_subject_msg => 'Something Broke',
    in_threatLevel => 5,
    in_to => WM_EMAIL_HANDLER.ARRAY( '[email protected]' ),
    in_from => '[email protected]',
    in_fromName => 'Oracle Database Account <[email protected]>',
    in_smtp_hostname => 'yourMailHost',
    in_smtp_portnum => 'yourMailHostPort' );
    END;
    Extra Info:
    <ul>
    <li>Oracle 10g running on Solaris UNIX</li>
    <li>MS Exchange Server is our MAIL server</li>
    <li>We're using mail host port 25</li>
    </ul>

    Could you post the code which you are using to send the mail. I need to send mail from a oracle procedure. I posted a thread with subject "sending mail from oracle procedure".
    Many thanks in advance.

  • Exceptions are using rpc/encoded messages in documentwrapped mode

    Version: Weblogic 8.1SP3
    I exposed a web service in documentwrapped(/literal) mode, and it seems weblogic is using rpc/encoded convention instead, to serialize Exception.
    I posted more infos on the Axis bugtracker : http://nagoya.apache.org/jira/browse/AXIS-1576
    but I found later that the problem seems to come from Weblogic.
    Does someone know a workaround for this problem ?

    Hi Shabrish,
                               As per the details from MQ Server technical guys, thread is opened by admin user of PI to put the messages on queues of MQ server and that thread does not get close itself and keep on hanging the message in Delivering Mode. Because of this issue all messages behind it get queued to Delivering mode .And as soon as we restart the Java Stack it gets flushed up and open the new connection and deliver all old messages but new message again get stuck in Delivering Mode.
    Any idea on this.
    Regards,
    Anurag

  • Z10 encoding issue in outgoing email

    Hoping someone can help me. I've been an avid bb fan for years and my husband and I both handed in our bonds a week ago to move to the z10. We are both loving it. While my husband has had no issues with his I am very close to having no issues - except for one major one that affects me and my clients greatly. I have 2 email accounts - gmail (working without any issue at all - was up and running within a matter of minutes of receiving my z10). The other however has not been a fun or even manageable experience. My work email is web based and took a few days for me to even get it up and running. With my bold I was able to connect via Exchange but am no longer able to do so. I was told to connect via Active sync however my employer does not have this functionality and it is not supported. Following that I was told to connect using either IMAP or POP. And while I have been finally able to connect and receive my email when I SEND email it is a disaster!!!!! My out going mail seems to be adding in all of the encoding and so it becomes "unreadable" for lack of a better term. I have no idea where to turn on this. I have been constantly surfing and searching and and all forums that I can in hopes to find a resolution but have not yet found one - this is my last resort - otherwise sadly ....... Very, very sadly I will have to return my phone. Any suggestions at all would be much appreciated! Sorry for the "long-winded ness"

    lesedwards wrote:
    I agree. I run my own business in fact two business and I cannot be sending emails out from some half **bleep** address how professional does that look. Everything has worked perfect for 10 years and then I bought this piece of **bleep** called a Z10 and it even worked on it until the OS update.
    Wow lesedwards.. you are on fire. Jacking your issue into every email thread and getting **bleep**ed constantly.
    This thread was about an encoding issue, and from your other posts you are simply having connection issues.
    @Sarealex - I haven't seen this issue with any of my email accounts over IMAP, what software version are you currently using?
    -: DrewRead :-
    Can't find an app on Blackberry World yet? Tweet the developer and ask when they will #GetWithBB10 !!
    "Like it" if you like it.

  • Sharepoint-Hosted App giving FORBIDDEN error when i use REST Api

    Hi,
    I have created a sharepoint hosted app which will create Team site on button click.
    I used REST Api  and  NAPA Tool to develop this app.
    Napa tool gives to things ClientWebpart.aspx and Default.aspx.
    When i run my Default.aspx code is working fine but ClientWebpart.aspx is giving FORBIDDEN error when i am trying to create site.
    Below is the code which i used to create site
    code:
    var hostweburl;
    var appweburl;
    $(document).ready(function () {
    hostweburl= decodeURIComponent(getQueryStringParameter("SPHostUrl"));
    appweburl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));
    function createSPWeb() {
    $.ajax(
    url: appweburl +
    "/_api/SP.AppContextSite(@target)/web/webinfos/add?@target='" +
    hostweburl + "'",
    type: "POST",
    data: JSON.stringify(
    'parameters':
    '__metadata': { 'type': 'SP.WebInfoCreationInformation' },
    'Url': 'RestSubWeb',
    'Title': 'RestSubWeb',
    'Description': 'REST created web',
    'Language': 1033,
    'WebTemplate': 'sts#0',
    'UseUniquePermissions': false
    headers: {
    "accept": "application/json;odata=verbose",
    "content-type": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val()
    success: successHandler,
    error: errorHandler
    NOTE:This is on sharepoint online.
    Please help
    Regards,
    sudeep

    So in the app you are testing, are you using the FQDN or the NetBIOS name? Bad practice but could you test with both (hard code the absolute URL for testing purposes) then retest your app?
    If you are making a web part based on the new app model this will be an "app part" and probably have the same issues you are experiencing. If this is for something internal rather than a product you are developing to resell then the script editor /
    content editor web part approach could work for you.
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Media Encoder issue or bug? 720p50 to 720i50

    Can anyone confirm a Media Encoder issue, happening when converting progressive 50-fullframe (or 60 for ntsc) to 50-interlaced frames?
    I tried to convert DVCProHD 720p50 clips to PAL DVD wich uses 576i50 (25 frames devided to 50 interlaced frames). The result was, that every second frame of the source clip was skiped, so I received a PAL clip in 25 full-frames (25p). And it didn't matter which field-order I choosed (upper/lower/progressive) - the result was always the same.
    when converting p50 to i50 I would expect, that AME would convert these 50 full-frames to 50 interlaced-frames with the field order I choosed. For example Canopus Procoder is working this way.
    Btw, I lost the link, where to report Premiere bugs to adobe. Can anyone post it, please?

    See:
    FAQ:How/Where do I report a bug?
    Cheers
    Eddie
    PremiereProPedia   (
    RSS feed)
    - Over 300 frequently answered questions
    - Over 250 free tutorials
    - Maintained by editors like
    you
    Forum FAQ

  • Set group owner using REST API

    I'm trying to use the REST API to set the owner of a SharePoint group. I can successfully create the group using REST, but I can't change the owner. I've tried the following.
    1 - Specifying a group owner while creating the group
    Endpoint: .../_api/web/sitegroups
    Method: POST
    Headers:
    Content-Type: application/json; odata=verbose
    Body:
    { '__metadata': { 'type': 'SP.Group' }, 'Title': '<title>', 'Description': '<description>', 'Owner': { '__metadata': { 'type': 'SP.Principal' }, 'Title': '<owner_title>'}}
    This returns a 500 error: "The specified name is already in use. Please try again with a new name". In other words, the owner title I specified already exists, which is correct - I'm trying to make an existing principal the owner of the new group.
    2 - Merging a new group owner into an existing group
    Endpoint: .../_api/web/sitegroups(<group_id>)
    Method: POST
    Headers:
    Content-Type: application/json; odata=verbose
    X-HTTP-Method: MERGE
    Body:
    { '__metadata': { 'type': 'SP.Group' }, 'Owner': { '__metadata': { 'type': 'SP.Principal' }, 'Title': '<owner_title>'}}
    This returns a 500 error with a Microsoft.SharePoint.SPException: "Exception from HRESULT: 0x80131904". The trace logs don't shed any light on it.
    3 - Using the owner endpoint directly
    Endpoint: .../_api/web/sitegroups(<group_id>)/owner
    Method: POST
    Headers:
    Content-Type: application/json; odata=verbose
    X-HTTP-Method: PUT
    Body:
    { '__metadata': { 'type': 'SP.Principal' }, 'Title': '<owner_title>'}
    This throws various 400 errors. If the current owner of the group is a user, I get the error "The required property 'Email' does not exist in the message" - i.e. it wants SP.User properties. If the current owner of the group is another group, I get
    the error "The required property 'AllowMembersEditMembership' does not exist in the message." - i.e. it wants SP.Group properties.
    I've tried various adaptations of the three approaches above, such as specifying additional SP.Principal properties or passing SP.User or SP.Group objects instead, but with no success. Any ideas?

    As we chatted on email.  There doesn't seem to be any combo that will set the owner.  Only way to do it is to use the CSOM XML method and post to client.svc\ProcessQuery:
    POST
    http://weburl/_vti_bin/client.svc/ProcessQuery HTTP/1.1
    X-RequestDigest: 0xAE382F0A8F11688BA9BE66739F84443892CE5E5452BA3E2622F6013D9D97EA8A8D9476463EDC503F700EB24F45024150D0DEEB2F40B160CD88BA7C7B4769BECD,15 Jan 2014 00:11:02 -0000Content-Type: text/xml
    Host:
    www.sanspug.org
    Cookie: FedAuth=blah
    Content-Length: 612
    Expect: 100-continue
    Accept-Encoding: gzip, deflate
    XML body is:
    <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
    <Actions>
    <SetProperty Id="45" ObjectPathId="32" Name="Owner">
    <Parameter ObjectPathId="33" />
    </SetProperty>
    <Method Name="Update" Id="46" ObjectPathId="32" />
    </Actions>
    <ObjectPaths>
    <Identity Id="32" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:a1452dcc-8fc4-4631-8ada-97cb204810f1:g:9" />
    <Identity Id="33" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:a1452dcc-8fc4-4631-8ada-97cb204810f1:g:7" />
    </ObjectPaths></Request>
    The ids are randomly generated and can be anything you want, as long as they correlate (setproperty and method objectpathid is the object you are updating).  The most important part is the
    “Name” parts. The first part is the typeid of the object (in this case is means SPGroup), the second part as you can see if the site guid id.  The response does in fact return json if you tell it too:
    Chris Givens CEO, Architecting Connected Systems
    Blog Twitter

  • Return under Warranty (Tracking Line only) Should we use MIGO - Goods Issue

    Return under Warranty (Tracking Line only) Should we use MIGO - Goods Issue when sending out Materials for repair or exchange under Warranty (Free)?

    Please post it in SD/MM forum.

  • Document Set Creation in document library using REST API in Sharepoint 2013

    Hi,
    I want to create the document set using REST API call. Currently i am able to create the folder and able to upload the files using REST API's in the document library. Is there any way we can pass the contentype name or Id and create the document set using
    REST API call. We need to create the document set along with metadata and upload the files inside the document set.
    I need to create the document set along with meta data column values using REST API. Please let me know how we can achieve this through REST API.
    Thank you,
    Mylsamy

    Hi,
    According to your post, my understanding is that you wanted to create document set along with managed metadata fields.
    The REST API does not currently support working with Managed Metadata or Taxonomy fields.
    As a workaround, we can use the JavaScript Client Object Model.
    Create document set using JavaScript Client Object Model.
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/aacd96dc-0fb2-4f0d-ab4c-f94ce819e3ed/create-document-sets-with-javascript-com-sharepoint-2010
    Set managed metadata field with JavaScript Client Object Model.
    http://sharepoint.stackexchange.com/questions/95933/add-list-item-with-managed-metadata-field-through-jsom
    http://sharepointfieldnotes.blogspot.com/2013/06/sharepoint-2013-code-tips-setting.html
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • Posting using cross company code transaction must be blocked

    Hello Guys,
    I have a  problem related to cross company code transaction.
    In the OBA7 I have the document type KE that not allows posting using cross company code transactions. In the moment that I am creating a new document through the FB01, I have an error as "Consolidated companies US52 and ' ' are different
    Message no. F5080. As a results, the document cannot be created by this way. This is the correct process.
    But I have several documents that was used the doc type KE and the cross company code transaction was used. This is my issue. I don´t know why these documents were posted. The document come from another interface via IDOC and the IDOC not errored out.
    Can anyone help on this?
    Thanks
    Rafael B.

    Hello, I´ve checked the log and no changes since 2008.
    The document was created in 2010.
    This is the message: "No logs found for the selected period"
    More suggestions?
    Regards.
    Rafael

  • How to get the list of parameter and set them using RESTFul WS for a Crystal Report

    Hi All,
    I am able to schedule a Crystal report using following POST Restful call - http://localhost:6405/biprws/infostore/4738/scheduleForms/now and with a request xml body. But report is failing because I am not passing the parameter.
    But I need pass parameters/prompts to the Crystal report to execute successfully.
    What is the request XML to pass the parameter  for the report?
    I was able to do this for WEBI reports but I am not able to find any way to do this for Crystal reports?
    Any help on this matter is really appreciated.

    Hi Venki
    Please have a look at:
    How to pass parameters and generate the report using RESTful API in VB.net
    This is also described in the Developer Help files:
    http://help.sap.com/businessobject/product_guides/sbo41/en/sbo41_webi_restful_ws_en.pdf
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • About Movement type used in Goods Issue from Subcontracting Stock directly

    HI SAP MM Expert,
    We have transfer material to subcontractor through transfer posting using Mvt. 541 and raised subtracting challan also. Material is not returned by Subcontractor and  now we want to debit Subcontractor A/c . For w we want to mkae Goods Issue (Direct consumption)  from Subcontracting Stock and raised debit note subcontractor through FI. In this case what movement type & Transaction code  should be used to consume stock from subcontractor account and t.code for raising debit note to subcontractor in SAP R/3 system.
    Pls. suggest the process.
    Regards
    VKM

    For subsequent adjustment to subcontracting stock use transaction MB04
    If the vendor informs you that a greater or smaller quantity of the components was actually consumed than planned in the purchase order, you must post a subsequent adjustment to correct the goods issue posting. The value of the goods receipt is recalculated to include the
    subsequent adjustment quantity. (SAP transaction MB04)
    Subsequent Adjustment to Subcontracting PO (Move 121/544)
    Negative adjustment (Vendor Consumed Less but you Consumed
    more in SAP and subsequently you did minus adjustment to component consumption
    in SAP)
    Debit
      - Raw Material Inventory (S)
    Credit
    - Vendor Subcontracting Charges (H)
    Subsequent Adjustment to Subcontracting PO (Move 121/543)
    Positive adjustment (Vendor consumed more but you consumed
    less in SAP and subsequently you added further component consumption in SAP)
    Credit
    - Raw Material Inventory (H)
    Debit
    - Vendor Subcontracting Charges (S)
    Thanks
    DD

  • Add Item using REST and populate People field (SharePoint 2010)

    I am trying to add an item to a list that has a People type field using REST API.  For some reason, I am getting 400 (Bad Request) error.  Can anyone show me how to add a list item and populate the user field?
    Here's the code snippet I am using -
    var url = 'https://mytestsite/_vti_bin/listdata.svc/mylist';
    var item = {};
    item.Title = 'my REST item';
    item.User = 'contoso\user1';
    var jsonObj = Sys.Serialization.JavaScriptSerializer.serialize(item);
    $.ajax({
             type: 'POST',
             url: url,
             contentType: 'application/json',
             processData: false,
             data: jsonObj,
             success: function ()
               console.log('item updated');
    Thanks!

    Hi,
    To update the People field, we will need to make a reference to the user information list.
    Here are two links will provide more information:
    http://sharepoint.stackexchange.com/questions/65650/rest-api-update-a-muli-value-user-field
    http://charliedigital.com/2011/04/23/updating-user-fields-via-listdata-svc/
    You can view the User Information list in this way:
    http://zimmergren.net/technical/sharepoints-hidden-user-list-user-information-list
    Best regards
    Patrick Liang
    TechNet Community Support

Maybe you are looking for

  • Down payment request against PO

    Hi SAP Guru, When user entering down payment request in F-47 against  a purchase oder the system is allowing to post the amount more than PO value which is logically incorrect. How can I prevent this ? Kindly reply with details. Regards, Sajib

  • CHM file looks fine on my Desktop - but Topic contents missing in Dropbox

    When I try to zip the .CHM file and mail it to the developer or when I upload it to Dropbox everything seems to be fine. The file is 5.8 MB (72 Topics) But when he tried to open it all he sees are the purple "books" and the individual Topic Titles -

  • Select validation problem

    Hello, I'm trying to learn Spry, but I'm really confused right now. I've got one page with several validation areas (textbox, textarea, select) that works beautifully, and another one I'm working on now that I can't get to work. I copied the code fro

  • Invoke-Command - SQL collation change function

    Hi, I am creating a script to automatically configure SQL servers in Azure from one of the base Azure SQL VM templates. All of my code works well besides changing the default collation of the instance. The PowerShell code works but the problem is tha

  • Address book is using too much memory

    After my computer slowed dwon, I checked activity monitor to see address book using between 80 - 90 % of the CPU. I closed Address book and reopened. same issue. Tried deleting preferences and rebuilding metadata.  Running Lion 10.7.3 on a new imac