Results 1 to 2 of 2

Thread: Unmarshalling Fails but Marshalling Works

  1. #1
    Join Date
    Jan 2011
    Posts
    6

    Default Unmarshalling Fails but Marshalling Works

    I have a <ws:outbound-gateway>. I'm able to marshall using a marshalling-transformer and also by setting the marshaller attribute in the outbound-gateway (I just choose one).

    But when setting a unmarshalling-transformer or setting the unmarshaller attribute, I get a ClassCastException

    Code:
    java.lang.ClassCastException: java.lang.String cannot be cast to org.example.Magazine
    Which is expected because the message that's received from the web service is indeed a String. But isn't it that's reason why we have unmarshallers? To unmarshall those back to object? Whose gonna convert that String back to Object?

    If the marshalling works, then it means the JaxB generated classes are correct. So the unmarshalling process should work as well?

    By the way when I print out the String result from the web service, I get the correct response but I needed it back as an object

  2. #2
    Join Date
    Jan 2011
    Posts
    6

    Default

    SOLVED

    The issue was a mispelling in the web service elements. Instead of uppercase S it should had been lower case s!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •