Variable length fields.

Hi,

I am not too sure whether this question has been asked before or not, but basically I have an application which requests information from the mainframe. The link is via WebServices through EntireX/RPC to Natural.

The WSDL created the following;
…xsd:element name=“OUTPUTRETURNMESSAGE”>

  • <xsd:restriction base=“xsdtring”>
    <xsd:length value=“80” />
    </xsd:restriction>

    </xsd:element>
    This being an error message field, will contain varying length values, as well as null, if no error message has been returned. The field is defined as fixed within Natural, i.e. 80 bytes
    On applying the WSDL and trying use it, the front end application responds with a Length error, implying that the field is not 80 bytes. Is there a way round this?

verify that the field is marked as “OUT” and not “OUT IN” (in the IDL). If it is IN or OUT IN, you need to supply a variable when sending the request.

If it is an OUT field already (it will only be on the response document if so), then you’ll need to supply some more details - what versions of EntireX and Natural are you dealing with, what is the front end application…

It is very common to have a fixed length string returned by Natural and the content may vary from all blanks to all filled in, so it is not likely an issue with the EntireX web service. There are options when you generate the XML mapping to specify trimming and suppression of empty elements that you may want to review.

Thanks for you response.

To expand the issue, we are using Natural 4.2.7, EntireX 8.0.1 and Eclipse 3.3.

We use Eclipse to generate the IDL which as you suggested does actually contain the INOUT specification, but this has been generated automatically.

Where would I change this to OUT only? Speaking with the technical department, they strongly suggest that it is not amended manually (so to speak), as it is aimed at producing distributed software.

At the application end, they use a Java process, (Apache Axis was mentioned but I am not familiar with this), which is connected to the Webservices Stack, which in turn is connected to EntireX/RPC.

You also mentioned about the use of Trim or Suppression, where would I find those options?

Regards
Alan

As an update to this posting,
I discovered a school boy error, in that I created my /*IN and /*OUT at an 02 level and not 01 level. This resulted in multiple input and output areas created. I have since corrected that issue but now I still get a problem with the Length (expected 80, but since it is null, no error) the script fails.

Please find the Client code generated using AXIS based on the new wsdl file. If the OUTPUTRETURNMESSAGE is less than 80, it throws exception.

/**

  • Auto generated setter method
  • @param param OUTPUTRETURNMESSAGE_type0
    */
    public void setOUTPUTRETURNMESSAGE_type0(java.lang.String param){
    if (org.apache.axis2.databinding.utils.ConverterUtil.convertToString(param).length() == 80 ) { this.localOUTPUTRETURNMESSAGE_type0=param;
    }
    else { throw new java.lang.RuntimeException();
    }
    }
    Is there any advice you can give?

Thanks

Define the field as a variable length field in Natural (DYNAMIC).