Skip to main content

XML related issues

  • April 14, 2011
  • 8 replies
  • 0 views

[Migrated content. Thread originally posted on 14 April 2011]

Hi,

I am developing an application in Acucobol which needs to converse with a third party who offer an XML interface. Data is passed either using REST (e.g. www.website.co.uk/getdata


DemoUser
****


standard
XYZ12345



or using SOAP (which I know nothing about).

I have a test program set up which writes XML and reads it back in again. I have two questions:-
1) How do I remove the generated at the start of the XML data stream I am writing out? This causes a syntax error with the third party's website when I enter the xml manually.
2) How do I assign the input and output files in the configuration file. I have tried:-

output-filename www.website.co.uk/getdata
input-filename www.website.co.uk/getdata

But I get an error 35 (file not found) when I try the initial write.

Any help/advice/suggestions etc. would ge gratefully received

Regards

Nick Brook

8 replies

Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • April 14, 2011

[Migrated content. Thread originally posted on 14 April 2011]

Hi,

I am developing an application in Acucobol which needs to converse with a third party who offer an XML interface. Data is passed either using REST (e.g. www.website.co.uk/getdata


DemoUser
****


standard
XYZ12345



or using SOAP (which I know nothing about).

I have a test program set up which writes XML and reads it back in again. I have two questions:-
1) How do I remove the generated at the start of the XML data stream I am writing out? This causes a syntax error with the third party's website when I enter the xml manually.
2) How do I assign the input and output files in the configuration file. I have tried:-

output-filename www.website.co.uk/getdata
input-filename www.website.co.uk/getdata

But I get an error 35 (file not found) when I try the initial write.

Any help/advice/suggestions etc. would ge gratefully received

Regards

Nick Brook
You have more control by using C$XML. On the http - as you can imagine http points to a resource on a web server. You have several options - C$COPY to copy the file to a local location, or look at the 9.0 Xcentricity - this covers using REST and has xml extensions.

  • Author
  • Rocketeer
  • 19312 replies
  • November 7, 2011

[Migrated content. Thread originally posted on 14 April 2011]

Hi,

I am developing an application in Acucobol which needs to converse with a third party who offer an XML interface. Data is passed either using REST (e.g. www.website.co.uk/getdata


DemoUser
****


standard
XYZ12345



or using SOAP (which I know nothing about).

I have a test program set up which writes XML and reads it back in again. I have two questions:-
1) How do I remove the generated at the start of the XML data stream I am writing out? This causes a syntax error with the third party's website when I enter the xml manually.
2) How do I assign the input and output files in the configuration file. I have tried:-

output-filename www.website.co.uk/getdata
input-filename www.website.co.uk/getdata

But I get an error 35 (file not found) when I try the initial write.

Any help/advice/suggestions etc. would ge gratefully received

Regards

Nick Brook

I am using "C$XML", it will automatically create these two lines:


<?xml version="1.0" standalone="no"?>
<!-- C:\\dmdata811\\files811\\asijc590.xml - generated by ACUCOBOL-GT v8.1.1 on 2011/11/07 -->


How should I remove them?

Thanks in advance.


  • Author
  • Rocketeer
  • 19312 replies
  • November 7, 2011

[Migrated content. Thread originally posted on 14 April 2011]

Hi,

I am developing an application in Acucobol which needs to converse with a third party who offer an XML interface. Data is passed either using REST (e.g. www.website.co.uk/getdata


DemoUser
****


standard
XYZ12345



or using SOAP (which I know nothing about).

I have a test program set up which writes XML and reads it back in again. I have two questions:-
1) How do I remove the generated at the start of the XML data stream I am writing out? This causes a syntax error with the third party's website when I enter the xml manually.
2) How do I assign the input and output files in the configuration file. I have tried:-

output-filename www.website.co.uk/getdata
input-filename www.website.co.uk/getdata

But I get an error 35 (file not found) when I try the initial write.

Any help/advice/suggestions etc. would ge gratefully received

Regards

Nick Brook

I am using "C$XML", it will automatically create these two lines:


<?xml version="1.0" standalone="no"?>
<!-- C:\\dmdata811\\files811\\asijc590.xml - generated by ACUCOBOL-GT v8.1.1 on 2011/11/07 -->


How should I remove them?

Thanks in advance.


Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • November 7, 2011

[Migrated content. Thread originally posted on 14 April 2011]

Hi,

I am developing an application in Acucobol which needs to converse with a third party who offer an XML interface. Data is passed either using REST (e.g. www.website.co.uk/getdata


DemoUser
****


standard
XYZ12345



or using SOAP (which I know nothing about).

I have a test program set up which writes XML and reads it back in again. I have two questions:-
1) How do I remove the generated at the start of the XML data stream I am writing out? This causes a syntax error with the third party's website when I enter the xml manually.
2) How do I assign the input and output files in the configuration file. I have tried:-

output-filename www.website.co.uk/getdata
input-filename www.website.co.uk/getdata

But I get an error 35 (file not found) when I try the initial write.

Any help/advice/suggestions etc. would ge gratefully received

Regards

Nick Brook
I am not sure, does using CXML-DELETE-COMMENT help?

If not, then XML extensions in version 9.x would be worth investigating

  • Author
  • Rocketeer
  • 19312 replies
  • November 8, 2011

[Migrated content. Thread originally posted on 14 April 2011]

Hi,

I am developing an application in Acucobol which needs to converse with a third party who offer an XML interface. Data is passed either using REST (e.g. www.website.co.uk/getdata


DemoUser
****


standard
XYZ12345



or using SOAP (which I know nothing about).

I have a test program set up which writes XML and reads it back in again. I have two questions:-
1) How do I remove the generated at the start of the XML data stream I am writing out? This causes a syntax error with the third party's website when I enter the xml manually.
2) How do I assign the input and output files in the configuration file. I have tried:-

output-filename www.website.co.uk/getdata
input-filename www.website.co.uk/getdata

But I get an error 35 (file not found) when I try the initial write.

Any help/advice/suggestions etc. would ge gratefully received

Regards

Nick Brook
shjerpe originally wrote:
I am not sure, does using CXML-DELETE-COMMENT help?

If not, then XML extensions in version 9.x would be worth investigating




      *Create a new XML file
           call "C$XML" using CXML-NEW-PARSER
           move return-code to parser-handle. 

           call "C$XML" using CXML-DELETE-COMMENT
                   parser-handle.
      *Add a top element (using the name of the file)
           call "C$XML" using CXML-ADD-CHILD
                  parser-handle
                  "custRec"
           move return-code to element-handle. 

      *Add some namespace information 
           call "C$XML" using CXML-ADD-ATTRIBUTE
                  element-handle
                  "xmlns:xsi"
                  "www.w3.org/.../XMLSchema-instance".
                     
      *Add the first field of the record, which will be a child of
      *the last element.
           call "C$XML" using CXML-ADD-CHILD
                  element-handle
                  "cus-key"
                  "555-55-5555"
           move return-code to element-handle.

      *Add the rest of the record
           call "C$XML" using CXML-ADD-SIBLING
                  element-handle
                  "cus-name"
                  "Acucorp"
           move return-code to element-handle.

           call "C$XML" using CXML-ADD-SIBLING
                  element-handle
                  "cus-addr"
                  "8515 Miralani Drive"
           move return-code to element-handle.

           call "C$XML" using CXML-ADD-SIBLING
                  element-handle
                  "cus-city"
                  "San Diego"
           move return-code to element-handle.

           call "C$XML" using CXML-ADD-SIBLING
                  element-handle
                  "cus-state"
                  "CA"
           move return-code to element-handle.

           call "C$XML" using CXML-ADD-SIBLING
                  element-handle
                  "cus-zip"
                  "92126"

      *write the file
           call "C$XML" using CXML-WRITE-FILE,
                  parser-handle
                  "custRec.xml". 
           call "C$XML" using CXML-RELEASE-PARSER,
                  parser-handle.



This is my output,





     xmlns:xsi="www.w3.org/.../XMLSchema-instance">
  555-55-5555
  Acucorp
  8515 Miralani Drive
  San Diego
  CA
  92126





Looks no help with "CXML-DELETE-COMMENT"

  • Author
  • Rocketeer
  • 19312 replies
  • November 8, 2011

[Migrated content. Thread originally posted on 14 April 2011]

Hi,

I am developing an application in Acucobol which needs to converse with a third party who offer an XML interface. Data is passed either using REST (e.g. www.website.co.uk/getdata


DemoUser
****


standard
XYZ12345



or using SOAP (which I know nothing about).

I have a test program set up which writes XML and reads it back in again. I have two questions:-
1) How do I remove the generated at the start of the XML data stream I am writing out? This causes a syntax error with the third party's website when I enter the xml manually.
2) How do I assign the input and output files in the configuration file. I have tried:-

output-filename www.website.co.uk/getdata
input-filename www.website.co.uk/getdata

But I get an error 35 (file not found) when I try the initial write.

Any help/advice/suggestions etc. would ge gratefully received

Regards

Nick Brook
shjerpe originally wrote:
I am not sure, does using CXML-DELETE-COMMENT help?

If not, then XML extensions in version 9.x would be worth investigating




      *Create a new XML file
           call "C$XML" using CXML-NEW-PARSER
           move return-code to parser-handle. 

           call "C$XML" using CXML-DELETE-COMMENT
                   parser-handle.
      *Add a top element (using the name of the file)
           call "C$XML" using CXML-ADD-CHILD
                  parser-handle
                  "custRec"
           move return-code to element-handle. 

      *Add some namespace information 
           call "C$XML" using CXML-ADD-ATTRIBUTE
                  element-handle
                  "xmlns:xsi"
                  "www.w3.org/.../XMLSchema-instance".
                     
      *Add the first field of the record, which will be a child of
      *the last element.
           call "C$XML" using CXML-ADD-CHILD
                  element-handle
                  "cus-key"
                  "555-55-5555"
           move return-code to element-handle.

      *Add the rest of the record
           call "C$XML" using CXML-ADD-SIBLING
                  element-handle
                  "cus-name"
                  "Acucorp"
           move return-code to element-handle.

           call "C$XML" using CXML-ADD-SIBLING
                  element-handle
                  "cus-addr"
                  "8515 Miralani Drive"
           move return-code to element-handle.

           call "C$XML" using CXML-ADD-SIBLING
                  element-handle
                  "cus-city"
                  "San Diego"
           move return-code to element-handle.

           call "C$XML" using CXML-ADD-SIBLING
                  element-handle
                  "cus-state"
                  "CA"
           move return-code to element-handle.

           call "C$XML" using CXML-ADD-SIBLING
                  element-handle
                  "cus-zip"
                  "92126"

      *write the file
           call "C$XML" using CXML-WRITE-FILE,
                  parser-handle
                  "custRec.xml". 
           call "C$XML" using CXML-RELEASE-PARSER,
                  parser-handle.



This is my output,





     xmlns:xsi="www.w3.org/.../XMLSchema-instance">
  555-55-5555
  Acucorp
  8515 Miralani Drive
  San Diego
  CA
  92126





Looks no help with "CXML-DELETE-COMMENT"

Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • November 9, 2011

[Migrated content. Thread originally posted on 14 April 2011]

Hi,

I am developing an application in Acucobol which needs to converse with a third party who offer an XML interface. Data is passed either using REST (e.g. www.website.co.uk/getdata


DemoUser
****


standard
XYZ12345



or using SOAP (which I know nothing about).

I have a test program set up which writes XML and reads it back in again. I have two questions:-
1) How do I remove the generated at the start of the XML data stream I am writing out? This causes a syntax error with the third party's website when I enter the xml manually.
2) How do I assign the input and output files in the configuration file. I have tried:-

output-filename www.website.co.uk/getdata
input-filename www.website.co.uk/getdata

But I get an error 35 (file not found) when I try the initial write.

Any help/advice/suggestions etc. would ge gratefully received

Regards

Nick Brook
I confirm that you do not have the ability to eliminate those two lines with C$XML .. XML extension in 9.x will provide you with more control.

  • Author
  • Rocketeer
  • 19312 replies
  • November 9, 2011

[Migrated content. Thread originally posted on 14 April 2011]

Hi,

I am developing an application in Acucobol which needs to converse with a third party who offer an XML interface. Data is passed either using REST (e.g. www.website.co.uk/getdata


DemoUser
****


standard
XYZ12345



or using SOAP (which I know nothing about).

I have a test program set up which writes XML and reads it back in again. I have two questions:-
1) How do I remove the generated at the start of the XML data stream I am writing out? This causes a syntax error with the third party's website when I enter the xml manually.
2) How do I assign the input and output files in the configuration file. I have tried:-

output-filename www.website.co.uk/getdata
input-filename www.website.co.uk/getdata

But I get an error 35 (file not found) when I try the initial write.

Any help/advice/suggestions etc. would ge gratefully received

Regards

Nick Brook
shjerpe originally wrote:
I confirm that you do not have the ability to eliminate those two lines with C$XML .. XML extension in 9.x will provide you with more control.


Thanks.