Closed conradogarciaberrotaran closed 2 months ago
@conradogarciaberrotaran Hi,
Thanks for your feedback.
The ResponseRecord
model is incorrect:
batch_id
, record_id
, error_desc
are sub-elements of the response_record
, so that fields must be defined as elements:class ResponseRecord(BaseXmlModel, tag="response_record"):
batch_id: str | None = element()
record_id: str | None = element()
error_desc: str | None = element()
class ResponseRecord(BaseXmlModel, tag="response_record", nsmap={"": "http://xmlns.oracle.com/response_data"}):
batch_id: str | None = element()
record_id: str | None = element()
error_desc: str | None = element()
This code should work:
class ResponseRecord(BaseXmlModel, tag="response_record", nsmap={"": "http://xmlns.oracle.com/response_data"}):
batch_id: str | None = element()
record_id: str | None = element()
error_desc: str | None = element()
class ResponseDataList(BaseXmlModel, nsmap={"": "http://xmlns.oracle.com/response_data"}, tag="Response_DataList"):
receipt_id: str = element(tag="receipt_id")
total_records: NonNegativeInt = element(tag="total_records")
total_accepted: NonNegativeInt = element(tag="total_accepted")
total_rejected: NonNegativeInt = element(tag="total_rejected")
records: List[ResponseRecord] = element(tag="response_record")
class Body(BaseXmlModel, tag="Body"):
response_data_list: ResponseDataList = element(tag="Response_DataList")
class Envelope(
BaseXmlModel,
nsmap={"env": "http://schemas.xmlsoap.org/soap/envelope/"},
tag="Envelope",
ns="env",
):
body: Body = element(tag="Body")
You're correct. it worked.
Thank so much for the quick reply!
Hi, thanks for the awesome tool!
I'm having problems with this XML:
I have this models:
But i'm getting this errors:
Not sure what's going on. I've tried many things. Any suggestions?
Thanks!