We are currently working on the forum. For the short-term, all forum content will be in read-only format. We apologize for the interruption and look forward to collaborating with you shortly. All the best in your research!

oc web services identify required elements to create subject

I'm trying to create a new subject using oc web services. But, my study configuration doesn't require date of birth and gender. When I tried to manually create a new study subject from openclinica website, it also asked me Study Event and it is a required value. When I tried to use web services, I got the error "Element must not be null" which is not very useful. I followed this example to use web service: https://docs.openclinica.com/3.1/technical-documents/openclinica-web-services-guide/studysubject-web-service, but it doesn't show how to add a study event from openclinica web service. I tried to use a studyeventOID element, but I'm still getting the same error. How can I know what element am I missing or which elements are required to create a new subject?

Merry Christmas and Happy New Year.


  • toskriptoskrip Posts: 279 ✭✭✭

    there is a couple of known issues with create study subject web service:
    - Secondary ID field (secondary label) is ignored
    - if your study is configured to autogenerate StudySubjectID you still have to provide label property as empty string
    - gender property always mandatory (regardless of study configuration)


  • toskriptoskrip Posts: 279 ✭✭✭
    and I forgot to mention, for event scheduling you have to use the event web service...
    see here:

  • agthumoeagthumoe Posts: 14
    my studySubjectID is not auto generated and I provided a custom ID for it. I've also tried adding gender as well, still doesn't work and keep getting error "Element must not be null.".
    If you look at the following pic, you will see I need to provide Study Event just to create a new subject.

  • agthumoeagthumoe Posts: 14

  • agthumoeagthumoe Posts: 14
    is there any problem without providing study event to create a new subject from web services.
  • agthumoeagthumoe Posts: 14
    and all the events are already created, I just need to import new subjects. But as you can see, I need to provide study event. I'm not sure how to provide study event from studySubject web service.
  • toskriptoskrip Posts: 279 ✭✭✭
    You are mixing two things. First of all study event is only required when you are creating subject directly in OC. If you use a subject creation web service I can guarantee you that it is not necessary.

    The other thing is that it is not about adding an event (all the events defined for study will be automatically available for subject) it is about scheduling event in order to be able to do data entry.

    I think something is wrong with you SOAP XML. If you are providing all required parameters + gender than I guess that header is not correct (where the authentication is done).

    Check out the log file of OpenClinica-ws in Tomcat. It will tell you more details why the execution of web service was not sucessfull. Also try to post the complete SOAP XML which you are sending so I can have a look at it (maybe I will see an error in it directly).


  • agthumoeagthumoe Posts: 14
    BIG THANKS BRO, solved it. You saved my Christmas day ;)
This discussion has been closed.