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

CHECK THE PHONE NUMBER FOR "IMPORTABILITY" does not work with Java Iris SDK #25

Closed
feanor07 opened this issue Aug 21, 2020 · 1 comment

Comments

@feanor07
Copy link
Contributor

When I try to check the phone number for importability as advised in the documentation at https://dev.bandwidth.com/numbers/guides/hostedMessaging.html#check-for-importability I always get the following exception:

com.bandwidth.iris.sdk.IrisClientException: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><ImportTnCheckerResponse><ResponseStatus><ErrorCode>5070</ErrorCode><Description>Telephone number is invalid.</Description></ResponseStatus></ImportTnCheckerResponse>
	at com.bandwidth.iris.sdk.IrisClient.executeRequest(IrisClient.java:178)
	at com.bandwidth.iris.sdk.IrisClient.post(IrisClient.java:100)
	at com.bandwidth.iris.sdk.IrisClient.post(IrisClient.java:91)
	at com.bandwidth.iris.sdk.model.ImportTnChecker.Check(ImportTnChecker.java:9)
....

After debugging I found that this is the xml payload generated via using ImportTnChecker's Check method as in the documentation:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ImportTnCheckerPayload>
    <TelephoneNumbers>
        <TelephoneNumber>
            <FullNumber>5554443333</FullNumber>
        </TelephoneNumber>
    </TelephoneNumbers>
</ImportTnCheckerPayload>

This does not match with the example provided in the HTTP part of the documentation; the correct XML should have been:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ImportTnCheckerPayload>
    <TelephoneNumbers>
        <TelephoneNumber>5554443333</TelephoneNumber>
    </TelephoneNumbers>
</ImportTnCheckerPayload>

which I tested with postman and it works.

TLDR; when we use ImportTnChecker as described in the documentation it simply fails due to incorrect xml marshalling!

@jchavez443
Copy link
Contributor

We have resolved this issue in version 1.12 thank you for the catch!

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