Four Js Development Tools Forum

Discussions by product => GWS => Topic started by: Mark W. on November 29, 2013, 08:16:25 am



Title: Variable XMLOptional attribute ignored?
Post by: Mark W. on November 29, 2013, 08:16:25 am
Hi all,

I have a web service where some of the variables must be optional.  I changed the globals definition to include 'attribute (XMLOptional)' as descibed in the manual:--
Code
  1. globals
  2.  
  3.   define
  4.  
  5.      g_ws_gr_complete_in    record
  6.         bill_of_lading      like imp_cst_line.bill_of_lading,
  7.         container_no        like imp_cst_line.cont_no attribute(XMLOptional),
  8.         pack_list_id        integer attribute(XMLOptional),
  9.         order_no            integer attribute(XMLOptional),
  10.         payment_ref_no      like imp_cst_line.payment_ref_no attribute(XMLOptional),
  11.         sap_key             string,
  12.         del_reason1         like bol_hdr.del_reason1 attribute(XMLOptional),
  13.         del_reason2         like bol_hdr.del_reason2 attribute(XMLOptional),
  14.         del_reason_code     smallint attribute(XMLOptional)
  15.      end record,
  16.  

It compiles fine, but when I get the WSDL, I find that the attributes have been ignored:--
Quote
- <wsdl:message name="GR_Completion">
  <wsdl:part name="bill_of_lading" type="fjs:GR_Completion_bill_of_lading" />
  <wsdl:part name="container_no" type="fjs:GR_Completion_container_no" />
  <wsdl:part name="pack_list_id" type="xsd:int" />
  <wsdl:part name="order_no" type="xsd:int" />
  <wsdl:part name="payment_ref_no" type="fjs:GR_Completion_payment_ref_no" />
  <wsdl:part name="sap_key" type="xsd:string" />
  <wsdl:part name="del_reason1" type="fjs:GR_Completion_del_reason1" />
  <wsdl:part name="del_reason2" type="fjs:GR_Completion_del_reason2" />
  <wsdl:part name="del_reason_code" type="xsd:short" />
And when I test with null values, an error is returned:--

Quote
dcdev5:D:5.5.6 Development 2.02.06:/home/mark/dcs/mf_int/XWX2IB.4gs/test>fglrun test_client.42r MVDCPT070000055 "" "" "" "" D "MARK TEST" ">
         -1
XML Element 'container_no': Element cannot not be null

How do I fix this?

Thanks in advance.


Title: Re: Variable XMLOptional attribute ignored?
Post by: Reuben B. on December 01, 2013, 09:42:11 pm
Is this a RPC or DocStyle WebService?  If RPC try with DocStyle.

Is the 2.02.06 I can see an indicator of Genero version in use?


Title: Re: Variable XMLOptional attribute ignored?
Post by: Mark W. on December 02, 2013, 07:33:59 am
Thanks--it works in DOCStyle.