I am using Apache CXF 3.0.2 for the client and server. There is a fairly simple web service on the server that accepts different parameters, one of which is the string array:
& lt; Xs: complex type name = "getThing" & gt; & Lt; XS: Sequence & gt; & Lt; Xs: element minOccurs = "0" name = "connection" type = "tns: connectionID" /> & Lt; Xs: element maxOccurs = "unbounded" minOccurs = "0" name = "type" type = "x: string" /> & Lt; / XS: sequence & gt; & Lt; / XS: complexType & gt;
When the customer says, it may be that he wants to pass a single value for the "types" and this is the place where I had to face problems . The SOAP message from the client looks like this:
& lt; Soaps: Envelope xmlns: Soap = "http://schemas.xmlsoap.org/soaf/envelope/" & gt; & Lt; Soaps: Body & gt; & Lt; Ns2: getThing xmlns: ns2 = "http: //serverl.url/" & gt; & Lt; Connection & gt; Connection Details .... & lt; / Connection & gt; & Lt; Type xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: nil = "true" /> & Lt; / Ns2: getThing & gt; & Lt; / Soap: body & gt; & Lt; / Soap: Envelope & gt;
I think this is correct, but CXF translates into an array with an empty string value on the server; An array with a null value causes not to cause various issues with the server code.
Does the interface of the server apply?
ThingResult getThing (@WebParam (name = "connection") ConnectionID connection, @ Vebparam (name = "type") string [] type) {code}
And if 'Nil =' right "'is not valid, then why is CXF generating it?
A null array works fine (client leaves the element from the message and the server interprets it as a null), but there is no array having a null value. Why is CXF behaving like this and how can I configure it so that server SOAP messaging is sent back to the customer correctly?
I have searched everywhere for the answer and I am sure some embarrassment is clear! In
Edit: Added code sample
I do not have the schema type element For the nillable = "true" attribute, type xsi: nil = "true" is not a valid value for that element.
Comments
Post a Comment