Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7609445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:10:23+00:00 2026-05-31T01:10:23+00:00

EDIT: The solution was to make a view that mirrored the table in question

  • 0

EDIT:

The solution was to make a view that mirrored the table in question and converted the date to varchar and then convert it back to date with a matching collation

END OF EDIT

Can anyone tell me why OData4j reads datetime values fine from one of my WCF Data Service server but runs into an illegal argument exception (bad valueString as part of keyString) when reading exact same datetime type with same format from another WCF Data Service?

java.lang.IllegalArgumentException: bad valueString
[datetime’2012-01-24T14%3A57%3A22.243′] as part of keyString

The other problem is that when I ask for a JSON response from the service from which OData4j had no problem reading datetime types I get another illegal argument exception and the error message is – Odd number of characters.

java.lang.IllegalArgumentException:
org.odata4j.repack.org.apache.commons.codec.DecoderException: Odd
number of characters.

Because WCF Data Services can’t have multiple sources, I’ve made 2 projects with each it’s own Entity Data Model source (from existing database). And like I mentioned above, I’m getting these annoying errors.

To conclude…

Example 1: bad valueString as part of keyString – when reading datetime. Also happens with FormatType.JSON.

ODataConsumer customerInfoServices = ODataConsumer
                                     .newBuilder("http://10.0.2.2:41664/CustomerInfoWCFDataServices.svc/")
                                     .setFormatType(FormatType.ATOM)
                                     .build();

customer = customerInfoServices
           .getEntities("Customers")
           .select("name, id")
           .filter("id eq " + 5)
           .execute()
           .firstOrNull();

Example 2: Odd number of characters. Only happends with FormatType.JSON and no problem reading datetime.

ODataConsumer businessServices = ODataConsumer
                                 .newBuilder("http://10.0.2.2:35932/BusinessWCFDataServices.svc/")
                                 .setFormatType(FormatType.JSON)
                                 .build();

Enumerable<?> ordrer = businessServices
                       .getEntities("Orders")
                       .filter("custId eq " + customer.getProperty("id").getValue())
                       .execute();

What I want is to receive JSON responses (ATOM is still too bloaded for android) and no problems reading datetime properties.


No body able to help me?

I’ve been wearing my fingers down trying to find a solution on Google, without any luck.

The collation on the database without datetime problems is “Danish_Norwegian_CI_AS” and on the database with reading errors is “SQL_Danish_Pref_CP1_CI_AS”. I don’t know if this has any meaning but I have a suspescion it has something to do with it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T01:10:24+00:00Added an answer on May 31, 2026 at 1:10 am

    The solution was to make a view that mirrored the table in question and converted the date to varchar and then convert it back to date with a matching collation. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Intro: EDIT: See solution at the bottom of this question (c++) I have a
Edit: From another question I provided an answer that has links to a lot
EDIT I put my solution on a share site. Like that you'll be able
[edit] Found the solution. Reinstall EVERYTHING - xcode, mono, monodevelop and monotouch. Now it
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
My current solution will suck sometimes EDIT For those who don't understand,see this example:
Please note the Edit below for a lot more information, and a possible solution
Edit: This question was written in 2008, which was like 3 internet ages ago.
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business
I am making an application that creates and allows the user to edit an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.