Hey Gary,

Yeah, looking at your example, the

    @ResponseWrapper(localName = "echoVoidResponse", targetNamespace = 
"TestWebServiceNS", className = "testwebservicens.EchoVoidResponse")

is directly projected to boi.getOutput().getMessageParts(), it looks like a 
metadata part (?).
The resList is the actual response, which I believe is "null" since method 
returns void, and the
exception is raised due to the conditional logic you pointed out ... Why is 
that is not clear to me, 
guys, any thoughts?

Best Regards,
    Andriy Redko

GG> In the debugger, for "boi.getOutput().getMessageParts()" I get one part:


GG> boi.getOutput().getMessageParts()
GG>          (java.util.ArrayList<E>) [[MessagePartInfo 
name={TestWebServiceNS}parameters, 
ConcreteName={TestWebServiceNS}echoVoidResponse]


GG> boi.getOutput().getMessageParts().get(0)
GG>          (org.apache.cxf.service.model.MessagePartInfo) [MessagePartInfo 
name={TestWebServiceNS}parameters, 
ConcreteName={TestWebServiceNS}echoVoidResponse


GG> Thoughts?


GG> Gary
GG> On Fri, Mar 22, 2019 at 9:11 AM Gary Gregory <[email protected]> wrote:

GG> Hi Andriy,


GG> Thank you for your prompt reply :-)


GG> I am not convinced just yet. To confirm we both see this the same way now:
GG> - If resList is null, then there is no response defined in the schema? 
(which matches my app's "echo void" test)


GG> My echo void test looks like this; I believe this was generated by some CXF 
tooling:


GG> package testwebservicens;


GG> import javax.xml.bind.annotation.XmlAccessType;
GG> import javax.xml.bind.annotation.XmlAccessorType;
GG> import javax.xml.bind.annotation.XmlType;




GG> /**
GG>  * <p>Java class for echoVoidResponse complex type.
GG>  * 
GG>  * <p>The following schema fragment specifies the expected content 
contained within this class.
GG>  * 
GG>  * <pre>
GG>  * &lt;complexType name="echoVoidResponse">
GG>  *   &lt;complexContent>
GG>  *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType";>
GG>  *       &lt;sequence>
GG>  *       &lt;/sequence>
GG>  *     &lt;/restriction>
GG>  *   &lt;/complexContent>
GG>  * &lt;/complexType>
GG>  * </pre>
GG>  * 
GG>  * 
GG>  */
GG> @XmlAccessorType(XmlAccessType.FIELD)
GG> @XmlType(name = "echoVoidResponse")
GG> public class EchoVoidResponse {




GG> }


GG> This is referred by another class generated by CXF like this:


GG>     @RequestWrapper(localName = "echoVoid", targetNamespace = 
"TestWebServiceNS", className = "testwebservicens.EchoVoid")
GG>     @WebMethod(action = "lde:echoVoid")
GG>     @ResponseWrapper(localName = "echoVoidResponse", targetNamespace = 
"TestWebServiceNS", className = "testwebservicens.EchoVoidResponse")
GG>     public void echoVoid();




GG> - Then if "!boi.getOutput().getMessageParts().isEmpty()" evaluates to false 
then there is actual data on the wire? Would there be no "data" for "void"?


GG> Thank you,
GG> Gary

GG> On Thu, Mar 21, 2019 at 8:17 PM Andriy Redko <[email protected]> wrote:

GG> Hey Gary,

GG>  I think the interpretation is different. The if 
(!boi.getOutput().getMessageParts().isEmpty()) states the
GG>  expecations that response should not be empty. The resList variable (which 
comes from resList =
GG> CastUtils.cast(inMsg.getContent(List.class)) a few statements above) is the 
response indicator, if it is null (no response)
GG>  but boi.getOutput().getMessageParts().isEmpty() is "false", it means 
response is expected but was not received.
GG>  I think the code is correct. Thank you.

GG>  Best Regards,
GG>      Andriy Redko



 GG>> In master, at
 GG>> org.apache.cxf.endpoint.ClientImpl.processResult(ClientImpl.java:663), we
 GG>> throw a IllegalEmptyResponseException where I see:

 GG>>             if (!boi.getOutput().getMessageParts().isEmpty()) {
 GG>>                 //we were supposed to get some output, but didn't.
 GG>>                 throw new IllegalEmptyResponseException("Response message
 GG>> did not contain proper response data."
 GG>>                     + " Expected: " +
 GG>> boi.getOutput().getMessageParts().get(0).getConcreteName());
 GG>>             }

 GG>> The test does not seem right:

 GG>> !boi.getOutput().getMessageParts().isEmpty()

 GG>> Should the "!" really be there if we want an error is there is no 
response?

 GG>> Gary




Reply via email to