The problem is this:

I need to create a client using a schema describing its request/response
types and others used by them.
No wsdl exists, so I created an empty one referencing this schema, ran
wsdl2java and it created Java
classes for all types described in the schema. However, 2 of the WS methods
have no arguments and
the request element declaration for them looks like this:
<xs:element name="myRequest"/>
So no request wrappers were generated for them.

Then I created a JAX-WS annotated interface using these classes and use it
to create WS clients at runtime. The 2 methods with no arguments have no
RequestWrapper annotation, like this:

@ResponseWrapper(localName = "myResponse", targetNamespace = "myNs",
className = "my.package.MyResponse")
@WebMethod
public void myRequest(
        @WebParam(mode = WebParam.Mode.OUT, name = "ret1", targetNamespace =
"myNs")
        Holder<java.lang.Integer> ret1,
        // ...other returned values
)


The other methods work fine, but for these 2 the generated request wrapper
element has has an xsi:type attribute:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope";>
    <soap:Body>
        <myRequest xmlns="myNs"
            xmlns:ns2="http://www.w3.org/2003/05/soap-envelope";
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
            xsi:type="myRequest" />
    </soap:Body>
</soap:Envelope>

which apparently causes the web service on the other side (hardware, not
running Java and CXF I
assume :) to fail.

Tried adding a RequestWrapper annotation to these methods and creating an
empty Java class to match
(with minimal annotations):
@XmlRootElement(name = "myRequest")
public class MyRequest {}


Same thing.


How do I handle this properly so the request doesn't have any unwanted
attributes?
Could somebody point me in the right direction, please?

-- 
View this message in context: 
http://www.nabble.com/Web-method-with-no-arguments%2C-request-wrapper-and-xsi%3Atype-tp20813685p20813685.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to