ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

IWS Web service Full Request String

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

  • IWS Web service Full Request String

    I have Exposed a test web service using a simple RPG and IWS to create the web service.

    The RPG entry Parameters are defined as Follows.

    dRequest...
    d pr extpgm('TESTING2')
    DEp1 1
    DEp2 1 0
    DEp3 likeds(Testds) DIM(99)
    DEp4 likeds(Testds2) DIM(99)
    DEp5 1
    DEp6 1 0
    DResponse_LENGTH 10i 0
    dResponse Likeds(Responseds) dim(99)

    And

    dTestds ds qualified
    DEp3a 2
    DEp3b 2

    dTestds2 ds qualified
    DEp4a 2
    DEp4b 2


    dResponseds ds qualified
    DCode 7
    DDescription 50


    My program is working correctly and after the SOAP call from soapUI my input parameters all contain the data sent from the Web service. all pretty straight forward.

    My actual requirement to now is to LOG the incoming request from the soapUI as below.

    <REQUEST>
    <EP1>a</EP1>
    <EP2>2</EP2>
    <EP3>
    <EP3A>B</EP3A>
    <EP3B>3</EP3B>
    </EP3>
    <EP3>
    <EP3A>C</EP3A>
    <EP3B>9</EP3B>
    </EP3>
    <EP4>
    <EP4A>YY</EP4A>
    <EP4B>NN</EP4B>
    </EP4>
    <EP5>T</EP5>
    <EP6>3</EP6>
    </REQUEST>


    but i cannot manage to get/find this anywhere. My preferred solution would be to get this information in my RPG and write it to the DB. But even if it gets logged to the IFS somewhere that would be acceptable. I have looked through all the log files on IWS and cannot find this anywhere.

    The only other thing i can think of now is to Build up the XML string in the RPG based off of the Entry Parameters which is not practical as when entry parameters change we would also have to change this and i also cannot see if there is additional tag the requester is sending trough or incorrect tags.

    If my only option is to rebuild the Request String is there any way to "Reverse" an XML Into to convert a Data Structure into a XML String using the Field names as the Tags?

  • #2
    I absolutely could not read this code as posted, so I took the time to re-format it. I'm posting the reformatted code here in case someone else might find it useful:

    Code:
         d Request...                                                      
         d                 pr                    extpgm('TESTING2')        
         D  Ep1                           1                               
         D  Ep2                           1  0                                                 
         D  Ep3                                   likeds(Testds) DIM(99)                          
         D  Ep4                                   likeds(Testds2) DIM(99)   
         D  Ep5                           1                               
         D  Ep6                           1  0                            
         D  Response_LENGTH              10i 0                            
         d  Response                              Likeds(Responseds) dim(99)
    
     -- And --
    
         d Testds          ds                   qualified   
         D  Ep3a                          2                 
         D  Ep3b                          2                 
    
         d Testds2         ds                   qualified   
         D  Ep4a                          2                 
         D  Ep4b                          2                 
    
    
         d Responseds      ds                   qualified    
         D  Code                          7                  
         D  Description                  50
    Code:
          
    <REQUEST>
      <EP1>a</EP1>
      <EP2>2</EP2>
      <EP3>
        <EP3A>B</EP3A>
        <EP3B>3</EP3B>
      </EP3>
      <EP3>
        <EP3A>C</EP3A>
        <EP3B>9</EP3B>
      </EP3>
      <EP4>
        <EP4A>YY</EP4A>
        <EP4B>NN</EP4B>
      </EP4>
      <EP5>T</EP5>
      <EP6>3</EP6>
    </REQUEST>

    Comment


    • #3
      As far as I know, there is no way to get the original XML message that was sent to you. I suppose you could build a new XML document from the parameters, but there's no guarantee that it'd match the original one precisely. Can I ask why you want to log this? I've never heard of anyone doing this before.

      Comment

      Working...
      X