Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Variable XMLOptional attribute ignored?  (Read 14693 times)
Mark W.
Posts: 17


« 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.
Reuben B.
Four Js
Posts: 1116


« Reply #1 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?

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Mark W.
Posts: 17


« Reply #2 on: December 02, 2013, 07:33:59 am »

Thanks--it works in DOCStyle.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines