Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/191.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java POJO对象(XML)android的RequestBody实现_Java_Android_Soap_Retrofit_Okhttp - Fatal编程技术网

Java POJO对象(XML)android的RequestBody实现

Java POJO对象(XML)android的RequestBody实现,java,android,soap,retrofit,okhttp,Java,Android,Soap,Retrofit,Okhttp,嗨,我想为我的soap服务器制作api,用php为android编写,并带有改装库 我已经创建了一个接口 public interface SoapApi { @Headers({ "Content-Type: application/soap+xml", "Accept-Charset: utf-8" }) @POST("/index.php") public DeviceCredentials test(@Bod

嗨,我想为我的soap服务器制作api,用php为android编写,并带有改装库

我已经创建了一个接口

public interface SoapApi {
    @Headers({
            "Content-Type: application/soap+xml",
            "Accept-Charset: utf-8"
    })
    @POST("/index.php")
    public DeviceCredentials test(@Body RequestEnvelope body);
}
和每个api请求的RequestEnvelope

@Root(name = "Envelope")
@NamespaceList({
        @Namespace(reference = "http://www.w3.org/2001/XMLSchema", prefix = "s"),
        @Namespace(reference = "http://schemas.xmlsoap.org/soap/encoding/", prefix = "soapenc"),
        @Namespace(reference = "http://schemas.xmlsoap.org/wsdl/soap/", prefix = "soap"),
        @Namespace(reference = "http://schemas.xmlsoap.org/wsdl/", prefix = "wsdl")
})
public class RequestEnvelope {

    @Element(name = "Body")
    private RequestBody aBody;

    public RequestBody getBody(){
        return aBody;
    }

    public void setBody(RequestBody body){
        aBody = body;
    }
}
还有我的POJO班

@Root(name = "DeviceCredentials")
public class DeviceCredentials {

    @Element(name="UUID")
    public String UUID;

    @Element(name="OSType")
    public String OSType;
}
我想将DeviceCredentials类设置为requestEnvelope的主体,但我不知道如何创建RequestBody实现来发出正确的请求

你能帮我吗