Unable to read the validation errors in the java service

Hello All,
Please help me to resolve this issue! i am using webmethod IS 9.8 version.
I want to read the validation errors produced by “wm.b2b.edi:convertToValues” service in to a java service and take the necessary action. But when I access the pipeline variable “errors” in the java service, it’s giving null. Even though the pipeline out contains “errors” key.
I am using the following steps

  1. Pub.file.getFile
  2. Wm.b2b.edi:convertToValues
    I turned the validate flag to true.
    I tried creating an document type myErrors and map the “errors” service out to that document(myErrors) but it did not work out.
    What is the alternate way to read the validation errors in the java service and take the action. Any suggestion is appreciated.

Hi,

What all other i/p params you are setting in the convertToValues apart from validate=true?

HTH,
RMG

hello,
I am giving the following input parameter
1.edidata–The input as bytes (edi data as a txt file)
2.EDIFFSchema–fully qualified name of D95b schema (for DESADV), generated from SEF parser. i.e. using wm.b2b.edi.SEFParse
3.delimeters–record=’
field=+
subfield=:
release=*
4.validate=true

Thanks
siraj

Apart from the above inputs you should also set and the output you should see errors (docList with all the syntax errors) for you to capture.

EDIFFSchema (make sure you set the path with the actual EDI Schema full path name)
returnErrors=asArray
maxErrors =-1

HTH,
RMG

1 Like

Hello,

Thanks for your reply…
The issue is resolved by setting the following input parameters
returnErrors=asArray
maxErrors =-1

Thanks

1 Like

Sounds good and thanks for updating back the results! :smiley:

HTH,
RMG

Siraja – Is it necessary to set maxErrors =-1 ? Can you please check what is the result if you don’t set it.

Thanks,

Mr,

It isn’t mandatory but for some reason when output array list is too big it may not show the entire error’s with the full list unless specified.

Also what is wrong having with setting -1?

HTH,
RMG

Hello MR,

As per the documentation maxErrors means Maximum number of errors that you want returned when validate is set to true. By setting the maxErrors to -1 will ensure that it will list all the errors if the error list is big.
But as per your request i removed the maxErrors parameter and tested the flow service, it is working fine. It is listing all the validation errors (14 errors and some additional 8 childErrors) even though the maxErrors is not set to -1

regards
siraj

Thanks Siraja for your confirmation, I asked you this because i had the same for some service without setting it and it working fine.

Thanks,

It’s good to have set it to -1, just to cover all bases even though it works!

HTH,
RMG

I agree RMG, as human beings we are pre-cautious to be more safe :stuck_out_tongue:

Thanks,

you bet :smiley: