Tickaroo / tikxml

Modern XML Parser for Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error: incompatible types: Object cannot be converted to RequestBody

mateovalencia opened this issue · comments

I'm trying to generate this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://consultartiposdedocumento.wsbeans.iseries/"> <soapenv:Header/> <soapenv:Body> <con:mtrtipdocc> <arg0> <I_TERMINAL>?</I_TERMINAL> <I_DIRECCIONIP>?</I_DIRECCIONIP> <I_TIMESTAMP>?</I_TIMESTAMP> <I_CANAL>?</I_CANAL> <I_LENGUAJE>?</I_LENGUAJE> <I_ENTIDADORIGEN>?</I_ENTIDADORIGEN> <I_INSTITUCION>?</I_INSTITUCION> </arg0> </con:mtrtipdocc> </soapenv:Body> </soapenv:Envelope>

I have this two classes:
`@Xml(
name = "soapenv:Envelope",
writeNamespaces = {
"soapenv=http://schemas.xmlsoap.org/soap/envelope/",
"con=http://consultartiposdedocumento.wsbeans.iseries/"
}
)
public class RequestEnvelope {
@element(name = "soapenv:Body")
private RequestBody requestBody;

public RequestEnvelope() {
    this.requestBody = new RequestBody();
}

public RequestEnvelope(RequestBody requestBody) {
    this.requestBody = requestBody;
}

public RequestBody getRequestBody() {
    return requestBody;
}

public void setRequestBody(RequestBody requestBody) {
    this.requestBody = requestBody;
}

}`

And this one:
`@Xml(name = "soapenv:Body")
public class RequestBody {
@element(name = "con:mtrtipdocc")
private RequestContent requestContent;

public RequestBody() {
}

public RequestBody(RequestContent requestContent) {
    this.requestContent = requestContent;
}

public RequestContent getRequestContent() {
    return requestContent;
}

public void setRequestContent(RequestContent requestContent) {
    this.requestContent = requestContent;
}

}`

Instead of @element, I tried with @ElementNameMatcher but it only generates this XML:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://consultartiposdedocumento.wsbeans.iseries/"/>

@sockeqwe

I'm closing this now. If it is still an issue feel free to reopen it.