Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom { field: "missing field soap:Body" } when colon used #185

Open
MrMarnic opened this issue Sep 15, 2022 · 0 comments
Open

Custom { field: "missing field soap:Body" } when colon used #185

MrMarnic opened this issue Sep 15, 2022 · 0 comments
Assignees

Comments

@MrMarnic
Copy link

MrMarnic commented Sep 15, 2022

I am trying to decode this xml message:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><AuthenticateUserResponse xmlns="http://oneclickforapp.dpag.de/V3"><userToken>USERTOKEN</userToken><walletBalance>100000</walletBalance><showTermsAndConditions>true</showTermsAndConditions></AuthenticateUserResponse></soap:Body></soap:Envelope>

This is my code:

#[derive(Serialize,Deserialize)]
struct XMLEnvelope {
    #[serde(rename = "soap:Body")]
    pub body: XMLSoapBody
}
#[derive(Serialize,Deserialize)]
struct XMLSoapBody {
    #[serde(rename = "AuthenticateUserResponse")]
    pub response: XMLAuthenticateUserResponse
}
#[derive(Serialize,Deserialize)]
struct XMLAuthenticateUserResponse {
    pub userToken: String
}

But it results in this error: Err value: Custom { field: "missing field soap:Body" }'

If I change soap:Body to soapBody. (int the code and xml file). Then it works without a problem. The problem seems to be the colon (:).

@punkstarman punkstarman self-assigned this Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants