Woody
Posts: 0
Joined: Thu Dec 04, 2014 2:37 pm

"TypeError: undefined is not a function" when mapping to a service

I have a service to a e-signing service, HelloSign. I test it from the service definition panel and it works fine.

Image

When I hard-code values in mapping the service works.
Image

When I drag and connect values from Storage (or anywhere for that matter), I get an error in weinre:
TypeError: undefined is not a function.

Image

I don't know where to look, what to try at this point.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

"TypeError: undefined is not a function" when mapping to a service

Hello Woody,

1) Could you please try using the proper name first :
instead "signers[0][email_address]" use "signers_email_address"
instead "signers[0][name]" use "signers_name"
instead "file_url[]" just "file_url"
2) Could you please clarify have you tried to test our service on a test tab for your service properties?
3) Could you please open tester in your browser and call that service with opened console and send us a screenshot of the error, with lines where the error appeared?

Woody
Posts: 0
Joined: Thu Dec 04, 2014 2:37 pm

"TypeError: undefined is not a function" when mapping to a service

Evgene

1) I tried that but HelloSign expects the []

They send me a 400 when I use your suggestion.
{"error":{"error_msg":"Invalid parameter: signers_name","error_name":"bad_request"}}

2) I have tested in the test tab in service properties and it works fine.

3) Here is the screenshot of the error

Image

Woody
Posts: 0
Joined: Thu Dec 04, 2014 2:37 pm

"TypeError: undefined is not a function" when mapping to a service

Image of successful test

Image

Again the service works fine and it works on the page as well but only if I don't use MAPPING, i.e., works when I type values in the box just like in the test tab. As soon as I map anything I get the error.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

"TypeError: undefined is not a function" when mapping to a service

Woody,

Could you please show the whole line with line in the code and file name, where it fails?

Woody
Posts: 0
Joined: Thu Dec 04, 2014 2:37 pm

"TypeError: undefined is not a function" when mapping to a service

Evgene

Appreciate your help.

I don't know how to do what you asked. Can you explain?

Perhaps I'm not using weinre properly, to its full potential?

Woody
Posts: 0
Joined: Thu Dec 04, 2014 2:37 pm

"TypeError: undefined is not a function" when mapping to a service

When I debug running from the appery.io Tester app for Android, I still get an error but it says:

TypeError: Object #div class="video-container"object has no method 'replace'/object

Woody
Posts: 0
Joined: Thu Dec 04, 2014 2:37 pm

"TypeError: undefined is not a function" when mapping to a service

Evgene

I bet your hunch is right. It's probably something to do with the fact that the parameters have weird names like "sender[0][name]" and your mapping javascript breaks.

Is there anyway to circumvent the mapping? I tried (probably incorrectly) to call the service from javascript and override the parameters but that probably uses the same javascript under the hood.

Also possibly relevant: Although this is a POST, the service expects these parameters as query string parameters -- not in the body. See first image in original post

Woody
Posts: 0
Joined: Thu Dec 04, 2014 2:37 pm

"TypeError: undefined is not a function" when mapping to a service

Evgene

As a matter of fact your first suggestion "proved' that it is the parameter names that is causing the issue. When I changed the parameter names the mapping didn't complain -- the call was made and the server service complained.

Still, would love your help to find a work around.

Woody
Posts: 0
Joined: Thu Dec 04, 2014 2:37 pm

"TypeError: undefined is not a function" when mapping to a service

Evgene

Is there anyway to manipulate the parameter names AFTER mapping?

Can I access the REQUEST after mapping and do a replace?

Return to “Issues”