Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8175163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:40:28+00:00 2026-06-06T22:40:28+00:00

we have a simple REST request that I can use manually on my Mac

  • 0

we have a simple REST request that I can use manually on my Mac with RESTClient (from wiztools). The url is http://ws-argos.clsamerica.com/argosDws/services/DixService?getXml and the body is below:

<soap:Envelope 
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:typ="http://service.dataxmldistribution.argos.cls.fr/types">
  <soap:Body>
  <typ:xmlRequest>
     <typ:username>******</typ:username>
     <typ:password>******</typ:password>
     <typ:platformId>62518,62688,62520,62602,62608</typ:platformId>
     <typ:nbDaysFromNow>10</typ:nbDaysFromNow>
  </typ:xmlRequest>
 </soap:Body>
</soap:Envelope>

This returns a neat bit of XML with plenty of real data. So I know the data are there to be grabbed. However, I want to automate this on a nightly script in Linux, and am trying to use CURL for this using the two scripts below:

curl -H "content-type: application/soap+xml" \
 -H "SOAPAction:" \
 -d@soap.xml \
 -X POST http://ws-argos.clsamerica.com/argosDws/services/DixService?getXml \
> output.xml

which calls soap.xml with:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://service.dataxmldistribution.argos.cls.fr/types">
<soap:Body>
  <typ:xmlRequest>
     <typ:username>******</typ:username>
     <typ:password>******</typ:password>
     <typ:platformId>62518,62688,62520,62602,62608</typ:platformId>
     <typ:nbDaysFromNow>10</typ:nbDaysFromNow>
  </typ:xmlRequest>
</soap:Body>

The output is:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
 <soap:Body><soap:Fault>    
 <soap:Code><soap:Value>soap:Sender</soap:Value></soap:Code>
 <soap:Reason><soap:Text xml:lang="en">Error reading XMLStreamReader.</soap:Text>
 </soap:Reason>
 </soap:Fault></soap:Body></soap:Envelope>

Does anyone know how to resolve this, or a better way to automate it? I’m new to CURL, but could create something in Java if anyone suggests that as possibility (with examples ;-))

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:40:31+00:00Added an answer on June 6, 2026 at 10:40 pm

    I haven’t used Curl but since the author of the question would be happy with Java code, see below. I’ve followed this example: How to Build a SOAP Client on Google App Engine

    Here’s a script you can use to generate code for the Argos Web Service:

    wsdluri='https://ws-argos.cls.fr/argosDws/services/DixService?wsdl'
    gensrcdir='./src'
    targetpackage='com.mypackage'
    genoutdir='./war/WEB-INF/classes'
    wsimport -extension -d "$genoutdir" -s "$gensrcdir" -p $targetpackage -keep "$wsdluri"
    

    Here’s a simple test for the generated code:

    @Test
    public void test_parse() throws IOException, DixException_Exception {
        try {
        DixServicePortType argos =  new DixService().getDixServicePort();
        CsvRequestType params = new CsvRequestType();
        params.setShowHeader(true);
        params.setUsername("your_user_name");
        params.setPassword("your_password");
        params.setDisplaySensor(true);
        // params.setProgramNumber("your_program_number"); 
        params.setPlatformId("your_device_id"); 
        params.setNbDaysFromNow(2);
        StringResponseType csvres = argos.getCsv(params);
        assertNotNull(csvres);
        System.out.println(csvres.getReturn()); 
    
        StringResponseType xmlres = argos.getXml(params);
        assertNotNull(xmlres);
        System.out.println(xmlres.getReturn());
    
        } catch (SOAPFaultException e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
    }
    

    Note, although I’ve pointed the web service to an https address, it seems like the generated code still connects via http. I’d like to try https but I’ll have to change it manually.

    Now I’d like to use Jaxb to parse the XML response. I can deal with the CSV output, it’s simple enough but since it’s soap, we may as well do everything the same way.
    Any suggestion is welcome.

    [Edit]
    I’ve succeeded getting the schema for XML data and generating classes with the “xjc” compiler for unmarshalling via jaxb.
    Getting the schema is as simple as:

        StringResponseType xmlSchema = argos.getXsd(new XsdRequestType());
        assertNotNull(xmlSchema);
        System.out.println(xmlSchema.getReturn()); 
        // save schema to argos.xsd file
    

    Then you can invoke “xjc” to generate classes:

    xjc -p com.mypackage argos.xsd
    

    Unfortunately there’s a problem I’ve had before, the case of missing “XmlRootElement” annotations. Lots of SO questions to that regard.
    As far as I understand, it’s a matter of forcing “jxc” to treat certain names as unique (see also this article). Because I’d rather not change the schema, I’ve tried setting up “jxc” via an external bindings configuration file. That didn’t work but it has worked for other people.
    So at the end, I made some small manual changes to the schema that have added XmlRootElement annotations to the generated classes:

    <xs:annotation>
        <xs:appinfo>
          <jaxb:globalBindings>
              <xjc:simple />
          </jaxb:globalBindings>
        </xs:appinfo>
    </xs:annotation>
    
    <xs:element name="data" type="data"/>
    

    Now I can parse the XML data using Jaxb. Here’s an example with Restlet’s jaxb connector:

    ConverterHelper decoder = new JaxbConverter();
    Data data = decoder.toObject(new StringRepresentation( xmlres.getReturn()), Data.class, null);
    

    Hope that helps, if you have problems with this solution, please comment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have deployed a simple REST based application in RAD. A simple URL is
I have constructed a simple Rest service using ServiceStack (which is brilliant), that returns
I have the following simple Python code that makes a simple post request to
I want to have simple program in python that can process different requests (POST,
I have built a pretty simple REST service in Sinatra, on Rack. It's backed
I'm trying to create a very simple REST server. I just have a test
I have simple win service, that executes few tasks periodically. How should I pass
I have simple SSIS package which reads data from flat file and insert into
I have a ASP.NET Web Forms application that internally makes many SOAP and REST
I have an AJAX request (using JQuery) that calls a PHP script which does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.