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

fix a problem about Multi-Byte character #1042

Merged
merged 4 commits into from Feb 8, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 52 additions & 0 deletions test/post-data-concat-test.js
@@ -0,0 +1,52 @@
'use strict';

var fs = require('fs');
var soap = require('..');
var assert = require('assert');
var http = require('http');


describe('post data concat test', function () {
it('should consider the situation about multi-byte character between two tcp packets', function (done) {
var check = function (a, b) {
if (a && b) {
assert(a === b);
done();
}
};

var wsdl = 'test/wsdl/default_namespace.wsdl';
var server = http.createServer(function (req, res) { });
var xml = fs.readFileSync(wsdl, 'utf8');
var service = {
MyService: {
MyServicePort: {
MyOperation: function (arg) {
console.log(arg);
check(arg, postdata);
return "0";
}
}
}
};

server.listen(51515);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move the server declaration/initialization to a before block, then in an after block tear it down?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.pls check if it is right.

soap.listen(server, '/wsdl', service, xml);

var postdata = "";
for (var i = 0; i < 20000; i++) {
postdata += "测试";
}

soap.createClient(wsdl, {
endpoint: 'http://localhost:51515/wsdl'
}, function (error, client) {
assert(!error);
client.MyOperation(postdata, function (error, response) {
server.close();
});
});

});
});