ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

REST WEBSERVICE on the iseries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • REST WEBSERVICE on the iseries

    Hello all
    First of all this is the first time i'm dealing with webservices so i'm kinda little confused.

    Iv'e setup up a simple webservice linked to a rpg program with 2 parameters one for input and another for output that receives a xml string and then returns the result in xml as well.

    The thing is that the xml message is passing the output parameter as an element on the returned xml string when it's not supposed to.

    How can we surpess the output parameters on the xml returned message?



    this is the XML example send to the iseries server:
    <?xml version="1.0" encoding="utf-8"?><Document xmlns="urnxsd:PostTransactionRequest:001:001:001">
    <Message> blabla
    </Message>
    </Document>

    and the returned xml on the client:
    <?xml version="1.0" encoding="utf-8" standalone="yes">
    <GETRECRESULT>
    <ALLRESPONSE><Document xmlns="urnxsd:PostTransactionResponse:001:001:001"><MessageR esult>blablaba to you
    </MessageResult></Document></ALLRESPONSE>
    <HTTPSTATUS>0</HTTPSTATUS>
    </GETRECRESULT>

    the client is not expecting the tags in capitals, only the following string
    <Document xmlns="urn:testws:xsd:PostTransactionResponse:001: 001:001"><MessageResult>blablaba to you too
    </MessageResult></Document>


    the input parameters on the rpg program
    D GETREC PR ExtPgm('TESTREST')
    D AllRequest...
    D 5120a
    D AllResponse...
    D 5120a

    thanks in advance.

  • #2
    You didn't say HOW you are creating this web servuce... but it looks to me like you're generating the XML tags in your program, and I'm guessing that you're using a tool that thinks it/'s supposed to generate the tags for you.

    Comment

    Working...
    X