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

An issue in FromJson operation #2810

Closed
kalaiyarasiganeshalingam opened this issue Mar 24, 2022 · 2 comments
Closed

An issue in FromJson operation #2810

kalaiyarasiganeshalingam opened this issue Mar 24, 2022 · 2 comments
Assignees
Labels
module/xmldata Points/2 Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/DIU Data, IO, and Util packages related issues Type/Bug
Milestone

Comments

@kalaiyarasiganeshalingam
Copy link
Contributor

Description:
When we provide a JSON to convert to XML, the operation provides an XML output removing xmnls namespace as in the following example.

Ballerina Record

type TemplateGetOperation record {
   record{
       record{} 'soapenv\:Header;
       record{
           record{
               record{
                   string 'urn1\:name;
               } 'urn\:baseRef;
           } 'urn\:get;
       } 'soapenv\:Body;
       string _xmlns_soapenv = "http://schemas.xmlsoap.org/soap/envelope/";
       string _xmlns_urn = "urn:messages_2020_2.platform.webservices.netsuite.com";
       string _xmlns_urn1 = "urn:core_2020_2.platform.webservices.netsuite.com";
   } 'soapenv\:Envelope;
};

Record instance

TemplateGetOperation gettemp = {
       'soapenv\:Envelope : {
           'soapenv\:Header: {"Authorization" : 35},
           'soapenv\:Body: {
               urn\:get: {
                   'urn\:baseRef: {
                       'urn1\:name: "details"
                   }
               }
           }
       }
   };

Xml Output:

<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns_soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns_urn="urn:messages_2020_2.platform.webservices.netsuite.com" xmlns_urn1="urn:core_2020_2.platform.webservices.netsuite.com">
   <Header>
      <name>35</name>
   </Header>
   <Body>
      <get>
         <baseRef>
            <name>details</name>
         </baseRef>
      </get>
   </Body>
</Envelope>

Expected Output [1] or [2]

[1]

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:messages_2020_2.platform.webservices.netsuite.com" xmlns:urn1="urn:core_2020_2.platform.webservices.netsuite.com">
   <soapenv:Header>
	<name>35</name>
   <soapenv:Header>
   <soapenv:Body>
      <urn:get>
         <urn:baseRef>
            <urn1:name>details</urn1:name>
         </urn:baseRef>
      </urn:get>
   </soapenv:Body>
</soapenv:Envelope>

[2]

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:messages_2020_2.platform.webservices.netsuite.com" xmlns:urn1="urn:core_2020_2.platform.webservices.netsuite.com">
   <soapenv:Header>
	<name>35</name>
   <soapenv:Header>
   <soapenv:Body>
      <get>
         <baseRef>
            <name>details<name>
         <baseRef>
      <get>
   </soapenv:Body>
</soapenv:Envelope>
@kalaiyarasiganeshalingam
Copy link
Contributor Author

Closing this issue as this is fixed in the xmldata.

@github-actions
Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

@kalaiyarasiganeshalingam kalaiyarasiganeshalingam added the Reason/EngineeringMistake The issue occurred due to a mistake made in the past. label Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/xmldata Points/2 Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/DIU Data, IO, and Util packages related issues Type/Bug
Projects
None yet
Development

No branches or pull requests

2 participants