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

When there is Chinese in the soap body, Onvif Device Manager and wireshark will fail to parse it. #155

Open
xueqing opened this issue Mar 30, 2023 · 1 comment

Comments

@xueqing
Copy link

xueqing commented Mar 30, 2023

    // modify services/media_service.ts
    port.GetProfiles = (args, cb, headers) => {
      utils.log.info(`GetProfiles:`);
  
      const GetProfilesResponse = { Profiles: [] };
  
      let currentName = "中文";
  
      const profile = {
        Name: currentName,
        attributes: {
          token: 'currentToken'
        }
      };
      GetProfilesResponse.Profiles.push(profile);
      cb(GetProfilesResponse);
    };

ONVIF Device Test Tool will prompt an error message "An error occurred while receiving packet. Expected length: 642, received: 646". And wireshark will split soap response body with the second part showing “Unrecognized text”, while the “Unrecognized text” is exactly 4 bytes.

无标题

@xueqing xueqing changed the title When there is Chinese in the soap body, Onvif Device Manager may fail to parse it. When there is Chinese in the soap body, Onvif Device Manager and wireshark will fail to parse it. Mar 31, 2023
@RogerHardiman
Copy link
Collaborator

So it looks like the code that computes the length of the XML payload is incorrect.

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