Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to deserialize XML #1020

Open
davisjose19 opened this issue Jan 16, 2025 · 3 comments
Open

Unable to deserialize XML #1020

davisjose19 opened this issue Jan 16, 2025 · 3 comments
Labels
type: enhancement New feature or request

Comments

@davisjose19
Copy link

davisjose19 commented Jan 16, 2025

I am doing a XSD based development where I make use of this plugin to generate JAXB annotated classes.

I am able to read and consume the xmls via Spring Boot , but when I try to do the same in micronaut it is not working.
Is there something different in the way that Spring Boot and Micronaut do this ?

"message": "Failed to convert argument [commsHubReq] for value [null] due to: Unexpected end-of-input when trying read value of type com.mns.commshub.ExtendedData\n at [Source: (io.netty.buffer.ByteBufInputStream); line: 25, column: 19] (through reference chain: com.mns.commshub.CommsHubReq[\"Header\"]->com.mns.commshub.Header[\"actionType\"]->com.mns.commshub.ActionType[\"ExtendedData\"]->java.util.ArrayList[4])"

The above error is what is causing issues for me.

The xml is :

<NS1:CommsHubReq xmlns:NS1="http://service.commhub.commerce.mns.com/"> <NS1:Header> <NS1:source>XXX</NS1:source> <NS1:txnID>-3b1c8d90:19345def737:-6609</NS1:txnID> <NS1:TxnTimestamp>2024-11-19T21:59:03.722Z</NS1:TxnTimestamp> <NS1:messageType>ORDER_CONFIRMATION</NS1:messageType> <NS1:actionType> <NS1:ExtendedData name="sendSMS">N</NS1:ExtendedData> <NS1:ExtendedData name="sendEmail">Y</NS1:ExtendedData> </NS1:actionType> </NS1:Header> <NS1:Payload> <NS1:Commshub> <NS1:customerID>504083807</NS1:customerID> <NS1:subscriberID>[email protected]</NS1:subscriberID> <NS1:ToEmailAddress>[email protected]</NS1:ToEmailAddress> <NS1:storeID>101</NS1:storeID> <NS1:Language>en</NS1:Language> <NS1:Country>GB</NS1:Country> <NS1:channelID>-6</NS1:channelID> <NS1:MessageDetails> </NS1:MessageDetails> </NS1:Commshub> </NS1:Payload> </NS1:CommsHubReq>

Somehow when it comes to the ActionType the list is not being parsed properly.

Any help with this is appreciated.

@graemerocher
Copy link
Contributor

currently this is only supported with Jackson https://github.com/micronaut-projects/micronaut-jackson-xml

@davisjose19
Copy link
Author

Does this mean i have to use a jackson based plugin to generate the pojos from an xsd and then proceed?

@graemerocher
Copy link
Contributor

correct, Micronaut Serialization doesn't currently support XML

@graemerocher graemerocher added the type: enhancement New feature or request label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants