Forum Discussion

johnnybegood's avatar
johnnybegood
New Contributor
3 months ago

xml to soap

I need to take a SQL defined Xml that looks like this...

<optiondata>

    <system.admission_data>

      <AdmissionDate>2020-06-15</AdmissionDate>

      <AdmissionTime>07:15 PM </AdmissionTime>

      <ClientName>Doe, John</ClientName>

      <EpisodeNumber>1</EpisodeNumber>

      <Program>3958</Program>

<sex>M</sex>

      <TypeOfAdmission>01</TypeOfAdmission>

    </system.admission_data>

    <ClientID>123456</ClientID>

    <Episode>1</Episode>

  </optiondata>

and change it to this...

<tem:UpdateAdmission>

         <tem:SystemCode>Code</tem:SystemCode>

         <tem:UserName>Username</tem:UserName>

         <tem:Password>Password</tem:Password>

         <tem:ClientAdmissionInfo>

            <tem:AdmissionDate>2020-06-15</tem:AdmissionDate>

            <tem:AdmissionTime>07:15 PM</tem:AdmissionTime>

            <tem:ClientName>Doe,JOHN</tem:ClientName>

            <tem:EpisodeNumber>1</tem:EpisodeNumber>

            <tem:Program> 3958</tem:Program>

            <tem:Sex>M</tem:Sex>

            <tem:TypeOfAdmission>01</tem:TypeOfAdmission>

         </tem:ClientAdmissionInfo>

         <tem:ClientID>123456</tem:ClientID>

         <tem:Episode>1</tem:Episode>

      </tem:UpdateAdmission>

  • nmrao's avatar
    nmrao
    Champion Level 3

    Just trying to understand your use case, please confirm:

    optiondata xml is the response of a step and extract data and create request for next with UpdateAdmission 
    • johnnybegood's avatar
      johnnybegood
      New Contributor

      I use SQL to create optiondata xml  for most my imports however this import requires it push through a webservice using <tem:UpdateAdmission> format soap envelope above.

      I have the Request defined with header.  I have the system code, username and password.  I tested the envelope and it imports correctly..

      however i had to manually change each line.  Example

      <AdmissionDate>    to     <tem:AdmissionDate> 

      I can't find a way to take the SQL extracted data and drop it into the soap body without manually changing it.

       

  • nmrao's avatar
    nmrao
    Champion Level 3

    Looks like it is namespace issue. Based on the available data (Unless there is full information), it is difficult to help.