Home Help Center

std::string in interface

dthompsondthompson Member Don ThompsonOrganization: Digital Federal Credit UnionProject: credit card fraud monitoring
Hi,
I have numerous interfaces which use sequence of records which contains string fields.
They have all worked for months, and now I wrote another which delivers garbage back to the client. It seems to have valid data misalligned, with a few low value bytes sprinkled in.
I have added clean database data to make sure it's not a database record problem. The data fields of the record on the server side are clean just before being pushed onto the vector.

I was reading a recient message here -- Casting char* to std::string which refers to using sequence<byte> to handle string data. My assumption in reading this was that it refered to cases where binary data might be contained in the string. Am I correct in that string data with text data should be handled properly in interface definitions?

I am seeing this error from a PHP client, which receives an array of records which contains string fields.

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Don,

    It would really help us to see an example of what your application is doing, such as the Slice types involved and some sample PHP code. Do the strings that you're transmitting use plain ASCII?

    You are correct in that you should use strings to handle text data, and sequence<byte> to handle binary blobs.

    As always, we also need to know the exact versions of Ice, PHP, operating system and compiler. Some users put this information in their signature, which is handy for us. :)

    Take care,
    - Mark
Sign In or Register to comment.