mdsol / rwslib

Provide a (programmer) friendly client library to Rave Web Services (RWS).
MIT License
31 stars 13 forks source link

ReasonCode="RWS00010" #144

Closed i11c closed 3 months ago

i11c commented 4 months ago

Hi, I tried to use postman to post data. But it said ReasonCode="RWS00010", ErrorClientResponseMessage="This is not a valid XML document.">.

image

Could you hep me to check if ODM below is right?

<?xml version="1.0" encoding="UTF-8" ?>

POST link is: https://rochema-qx.mdsol.com/RaveWebServices/webservice.aspx?PostODMClinicalData

i11c commented 4 months ago

Here is ODM body : `<?xml version="1.0" encoding="UTF-8" ?>

`
isparks-tg commented 4 months ago

As far as I can see this IS a valid XML document. I was able to load it into an xml editor and associate the ODM schema to it and it validated OK. Some things to try:

See: https://rwslib.readthedocs.io/en/latest/post_clinical_data.html#posting-clinical-data

For what it is worth I tried to use the rwslib builders to create a similar XML document. You could try the result and see if RWS is any happier with it:

from rwslib.builders import *
odm = ODM("test system")(
  ClinicalData("AB12345","UAT")(
     SubjectData("UAT01","10002", "Update")(
        StudyEventData(study_event_oid="SUBJECT")(
           FormData("SUB", transaction_type="Update")(
              ItemGroupData(itemgroupoid="SUB_LOG_LINE", transaction_type="Update")(
                 ItemData("SITEID","000002"),
                 ItemData("SUBJID","0000020002")
              )
           )
        )
     )
  )
)

print(str(odm))

'''
<?xml version="1.0" encoding="utf-8" ?>
<ODM ODMVersion="1.3" FileType="Transactional" CreationDateTime="2024-04-29T09:40:31" Originator="test system" FileOID="f22ee5ce-1cde-4fdb-b21e-5e9ba7d6286a" xmlns="http://www.cdisc.org/ns/odm/v1.3" Granularity="AllClinicalData" xmlns:mdsol="http://www.mdsol.com/ns/odm/metadata">
  <ClinicalData MetaDataVersionOID="1" StudyOID="AB12345 (UAT)">
    <SubjectData SubjectKey="10002" mdsol:SubjectKeyType="Update" TransactionType="Update">
      <SiteRef LocationOID="UAT01" />
      <StudyEventData StudyEventOID="Subject" TransactionType="Update">
        <FormData FormOID="SUB" TransactionType="Update">
          <ItemGroupData ItemGroupOID="SUB" TransactionType="Update" mdsol:Submission="SpecifiedItemsOnly">
            <ItemData ItemOID="SITEID" Value="000002" />
            <ItemData ItemOID="SUBJID" Value="0000020002" />
          </ItemGroupData>
        </FormData>
      </StudyEventData>
    </SubjectData>
  </ClinicalData>
</ODM>
'''
i11c commented 4 months ago

Hi @isparks-tg, Thank you for your comments. My apologies for the late reply. I tried using your code provided through rwslib.builders, but I'm still encountering the same error.

image

image

isparks-tg commented 4 months ago

@i11c Since you are using postman I suspect the problem is related to that. I do not know postman but a quick review of the postman docs tells me that there are options to set how the payload is encoded.

I don't know that these are the correct settings but are you ensuring that the content type setting is correct and that you are posting the XML without form encoding it?

image

If those settings are correct then I recommend a couple of other steps:

  1. Try posting the data with the rwslib request method to see if the results are any different.
  2. Try contacting Medidata for support

I'm afraid your problem doesn't seem to have anything to do with rwslib which provides builders and request methods to call Rave Web Services from python code - you are not using either so really this is a Rave Web Services support question that should go to Medidata.

Sorry I can't help more.

i11c commented 3 months ago

Hi @isparks-tg , thanks for help, I ran it via python, it worked. But using same XML code, it wasn't worked in postman.