Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
buggabill Absent Member.
Absent Member.
648 views

Pass an array into Xcentrisity service program

I am attempting to pass an array into a service program and am having little success.  The data is not being imported/transformed by the default soap_to_cobol.xsl stylsheet.

The SOAP-REQUEST-RESPONSE working storage section looks like this:

 01 SOAP-REQUEST-RESPONSE.
03 HTTP-METHOD PIC X(06)
VALUE HTTP-METHOD-POST.
88 HTTP-METHOD-IS-POST VALUE HTTP-METHOD-POST.
88 HTTP-METHOD-IS-GET VALUE HTTP-METHOD-GET.
03 METHOD-NAMESPACE-INDICATOR PIC X(01).
88 METHOD-NAMESPACE-MATCH VALUE "1".
88 METHOD-NAMESPACE-MISMATCH VALUE "0".
03 METHOD-NAME PIC X(50) VALUE SPACES.
88 METHOD-IS-PAYINV
VALUE L-PAYINV-METHOD-NAME.
03 FAULT-AREA.
05 FAULTCODE PIC X(10) VALUE SPACES.
05 FAULTSTRING PIC X(30) VALUE SPACES.
05 FAULTDETAIL PIC X(80) VALUE SPACES.

03 PAYINV--METHOD-NAME PIC X(20)
VALUE L-PAYINV-METHOD-NAME.
03 PAYINV--METHOD-PARAMETERS.
05 INPUT-PARAMETERS.
07 PI-USER-ID PIC X(15).
07 PI-USER-ID--NAME PIC X(20)
VALUE L-PI-USER-ID-NAME.
07 PI-PAY-COUNT PIC 9(03).
07 PI-PAY-COUNT--NAME PIC X(20)
VALUE L-PI-PAY-COUNT-NAME.
07 PI-INV-RECORDS
OCCURS 1 TO MAX-PAYMENTS TIMES
DEPENDING ON PI-PAY-COUNT.
09 PI-INV-NUM PIC X(08).
09 PI-AMOUNT PIC X(20).
09 PI-NOTE PIC X(500).
05 OUTPUT-PARAMETERS.
07 PI-RESULT PIC X(80).
07 PI-TOTAL-PAYMENT PIC S9(06)V99.
07 PI-FAIL-COUNT PIC 9(03).
07 PI-FAILED-RECORDS
OCCURS 0 TO MAX-PAYMENTS TIMES
DEPENDING ON PI-FAIL-COUNT.
09 PR-INV-NUM PIC X(08).
07 PI-FAILED-RECORDS--COUNT PIC 9(03).

The WSDL seems to generate properly for SoapUI, and the xml file containing the request looks fine.  The data just never ends up in the program.

The request in SoapUI looks like this:

<soapenv:Envelope xmlns:soapenv="schemas.xmlsoap.org/.../" xmlns:pay="tempuri.org/.../">
  <soapenv:Header/>
  <soapenv:Body>
    <pay:PayInvoice>
      <PI-User-ID>?</PI-User-ID>
      <PI-Pay-Count>?</PI-Pay-Count>
      <pi-inv-records>
        <!--1 to 999 repetitions:-->
        <pi-inv-recordsItems>
          <!--You may enter the following 3 items in any order-->
          <pi-inv-num>?</pi-inv-num>
          <pi-amount>?</pi-amount>
          <pi-note>?</pi-note>
        </pi-inv-recordsItems>
      </pi-inv-records>
    </pay:PayInvoice>
  </soapenv:Body>
</soapenv:Envelope>

The wsdl looks like this in SoapUI

<!--This WSDL is automatically generated from a BIS Service Program. It should not be edited in this form.-->
<!--The web service defined by this WSDL is powered by Micro Focus Xcentrisity(tm).-->
<wsdl:definitions name="payinv" targetNamespace="http://tempuri.org/payinv/" tns:ignored="" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://tempuri.org/payinv/">
<wsdl:types>
<s:schema targetNamespace="http://tempuri.org/payinv/" id="schema" xmlns="http://www.w3.org/2001/XMLSchema">
<s:complexType name="PayInvoice_pi-inv-recordsArray">
<s:sequence>
<s:element minOccurs="1" maxOccurs="999" name="pi-inv-recordsItems" type="tns:PayInvoice_pi-inv-records"/>
</s:sequence>
</s:complexType>
<s:complexType name="PayInvoice_pi-inv-records">
<s:all>
<s:element name="pi-inv-num" type="s:string"/>
<s:element name="pi-amount" type="s:string"/>
<s:element name="pi-note" type="s:string"/>
</s:all>
</s:complexType>
<s:complexType name="PayInvoice_pi-failed-recordsArray">
<s:sequence>
<s:element minOccurs="0" maxOccurs="999" name="pi-failed-recordsItems" type="tns:PayInvoice_pi-failed-records"/>
</s:sequence>
</s:complexType>
<s:complexType name="PayInvoice_pi-failed-records">
<s:all>
<s:element name="pr-inv-num" type="s:string"/>
</s:all>
</s:complexType>
<s:complexType name="payinv.PayInvoice">
<s:sequence>
<s:element name="PI-User-ID" type="s:string"/>
<s:element name="PI-Pay-Count" type="s:decimal"/>
<s:element name="pi-inv-records" type="tns:PayInvoice_pi-inv-recordsArray"/>
</s:sequence>
</s:complexType>
<s:element name="PayInvoice" type="tns:payinv.PayInvoice"/>
<s:complexType name="payinv.PayInvoiceResponse">
<s:sequence>
<s:element name="pi-result" type="s:string"/>
<s:element name="pi-total-payment" type="s:decimal"/>
<s:element name="pi-fail-count" type="s:decimal"/>
<s:element name="pi-failed-records" type="tns:PayInvoice_pi-failed-recordsArray"/>
</s:sequence>
</s:complexType>
<s:element name="PayInvoiceResponse" type="tns:payinv.PayInvoiceResponse"/>
</s:schema>
</wsdl:types>
<wsdl:message name="payinv.PayInvoice">
<wsdl:part name="parameters" element="tns:PayInvoice"/>
</wsdl:message>
<wsdl:message name="payinv.PayInvoiceResponse">
<wsdl:part name="parameters" element="tns:PayInvoiceResponse"/>
</wsdl:message>
<wsdl:portType name="payinvSoapPort">
<wsdl:operation name="PayInvoice">
<wsdl:input message="tns:payinv.PayInvoice"/>
<wsdl:output message="tns:payinv.PayInvoiceResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="payinvSoapBinding" type="tns:payinvSoapPort">
<soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
<wsdl:operation name="PayInvoice">
<soap:operation soapAction="http://tempuri.org/action/payinv/.PayInvoice"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="payinv">
<wsdl:port name="payinvSoapPort" binding="tns:payinvSoapBinding">
<soap:address location="http://example.com/invoices/payinv.srf"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Does anyone have any thoughts?

0 Likes
3 Replies
Knowledge Partner
Knowledge Partner

RE: Pass an array into Xcentrisity service program

Please also post your test input document.

Tom Morrison
Consultant

0 Likes
Knowledge Partner
Knowledge Partner

RE: Pass an array into Xcentrisity service program

Please also post your test input document.

Tom Morrison
Consultant

0 Likes
buggabill Absent Member.
Absent Member.

RE: Pass an array into Xcentrisity service program

I threw the xml file in Visual Studio and applied the xsl file to it, and I have figured out what I was doing wrong.  This type of thing has bitten me in the past.  If you look above in my SOAP-REQUEST-RESPONSE section of my working storage, I have the following:


03 PAYINV--METHOD-NAME PIC X(20)
VALUE L-PAYINV-METHOD-NAME.
03 PAYINV--METHOD-PARAMETERS

The problem lies with prefix that I used here for the field/group names - PAYINV.  It did not match the value contained in the 78 level item L-PAYINV-METHOD-NAME which was "PayInvoice".  XBis did not know where to put the resulting fields.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.