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

Specifying number as long int when calling method #136

Open
iggi- opened this issue Sep 18, 2016 · 1 comment
Open

Specifying number as long int when calling method #136

iggi- opened this issue Sep 18, 2016 · 1 comment

Comments

@iggi-
Copy link

iggi- commented Sep 18, 2016

When connecting to our java xmlRPC server, we're noting an issue where our javascript numbers are being converted to type int and then the xmlRPC looks up the method, it does not find a method that matches since it is expecting a long.

I see support for i8 tags have been added, but I'm not seeing a way in the code to use them when making a call, only on the return.

How can we make calls with variables sent as a Long?

@iggi-
Copy link
Author

iggi- commented Sep 18, 2016

Was able to add this functionality in a fairly hacked up way.

After line 24 in Serialize.js add:
.att("xmlns:ex", "http://ws.apache.org/xmlrpc/namespaces/extensions")

After Line 180 in Serialize.js replace with:

    if(/<ex:i8>(.*?)<\/ex:i8>/g.exec(value)){
      value = value.replace(/(<([^>]+)>)/ig,"");
      xml.ele('ex:i8').raw(value)
    } else {
      xml.ele('string').d(value)
    }

then just use the<ex:i8></ex:i8>tag in a string (yuck) to cast it as a long.

Again, this is a hack to get this to work with a tomcat xmlrpc servlet, but I wanted to note this for anyone else having the problem and maybe this can be implemented upstream sometime.

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

1 participant