[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] Optional XML Labels



It would not work for anything earlier than V7.2 I think Thomas - but the current support for creating your own null capable fields in RPG might lead to a possible solution.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

> On Mar 8, 2017, at 2:31 PM, Thomas Raddatz <thomas.raddatz@xxxxxxxxxxx> wrote:
> 
> Christian,
> 
> Sadly WSDL2RPG does not support NULL values, which equals a dropped
> element. The actual problem is that RPG does not support NULL values and
> it is not possible to define "special" values for recognizing a NULL
> value. For strings *BLANKS may work, but for example "0" or any other
> value does not work for numeric values. So actually you need an
> indicator for each nillable field. I did not yet enhanced WSDL2RPG to
> support NULL values, because that is a hell lot of work.
> 
> Therefore please change the generated stub by hand to meet your needs.
> 
> Here are some hints:
> 
> a) WSDL2RPG generates a "Serializer" procedure for each data structure
> of the request message. So if you do not want to generate a whole data
> structure, just return the serializer procedure immediately on a
> condition of your choice.
> 
> b) Inside the serializer procedure parts of the XML are assigned to
> field "g_requestBuffer". Then the content of "g_requestBuffer" is append
> to the request message buffer by calling
> OutputStream_appendGlobalRequestBuffer(). Afterwards the value of the
> XML element is "marshalled" by a type specific "Marshaller", e.g.
> Marshaller_toStringV6().
> 
> c) Just for your information: The request message buffer is a 4MB memory
> block (default value) to cache the request message. When the message
> exceeds 4MB it is dumped to an IFS file.
> 
> d) It is up to you to define the conditions when a field (XML element)
> or data structure (XML complex type) is not added to the request message.
> 
> e) You can safely add indicator field to the *_t template variables to
> indicate whether or not something shall be serialized. Make sure to
> compile everything of the stub after having changed a *_t field.
> 
> Regards,
> 
> Thomas.
> 
> Am 08.03.2017 um 14:16 schrieb larsenvalverde@xxxxxxxxx:
>> Hello.
>> 
>> I’m using WSDL2RPG  to generate the stubs to connect to a webservice.
>> 
>> I have a problem.
>> 
>> The XML that I have to send (generated by WSDL2RPG), have a lot of “optional labels”.  When I don’t use them, the result XML have a lot of sentences like this:
>> 
>> 
>> …
>> 	</LABEL1>
>> 	</LABEL2>
>> …
>> 
>> (because I cannot send the information of the LABEL1, LABEL2, …).
>> 
>> If I send this to the webservice, the server give me an error, because I’m not sending the information of that “optional” labels.
>> 
>> The question is… have I had to manually change the stubs generated by WSDL2RPG, or there another way to manage them??
>> 
>> 
>> Christian.
>> 
> -- 
> _______________________________________________
> Ftpapi mailing list
> Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> http://scottklement.com/mailman/listinfo/ftpapi

-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi