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

wrong namespace used when WSDL using camelcase insted of lower camelcase for definition #448

Closed
iuri-gg opened this issue May 12, 2013 · 5 comments

Comments

@iuri-gg
Copy link

iuri-gg commented May 12, 2013

usign following wsdl (https://secure.echosign.com/services/EchoSignDocumentService15?wsdl) I created :send_document SOAP request. in WSDL FileInfo and RecipientInfo definitions are CamelCase and not lower CamelCase. because of that when having a key in message hash :fileInfo or :FileInfo or :file_info results in a wrong namespace generated in SOAP request. I modified WSDL and changed those definition to lower CamelCase and Savon generated correct namespace in SOAP request.

Here is request generated using original WSDL that had wrong namespaces in SOAP request: https://gist.github.com/igagnidz/14764a71ca0b41354453

Here is request generated with WSDL that has lower CamelCase definition resulting in correct namespaces in SOAP request: https://gist.github.com/igagnidz/01cea3a81e405380a6e2

It looks like Savon uses correct namespace if WSDL uses only lower CamelCase convention.

@mariszin
Copy link

I have a similar problem - the namespace is not defined correctly in the request.
What is the code You use to generate the message?

@rubiii
Copy link
Contributor

rubiii commented May 15, 2013

i don't have much time, but maybe this helps: if you use snakecase symbols as hash keys, they're converted
using the global convert_request_keys_to option. this should be documented at: http://savonrb.com
strings are not translated and should match the original casing. i'm currently trying to make this "just work",
but it's quite a lot of work.

@iuri-gg
Copy link
Author

iuri-gg commented May 15, 2013

Thanks for the info about strings not getting converted. I did not know
that and did not see it in the documentation. I will try it later and see
if it will use correct namespace. As for convert_request_keys, when I use
snake case symbols, that method does not look up up correct namespace. Now
that I know that's the place where namespace lookup happens, I will look
into it and see if I can fix the bug. Thanks.

On Wed, May 15, 2013 at 5:40 AM, Daniel Harrington <[email protected]

wrote:

i don't have much time, but maybe this helps: if you use snakecase symbols
as hash keys, they're converted
using the global convert_request_keys_to option. this should be
documented at: http://savonrb.com
strings are not translated and should match the original casing. i'm
currently trying to make this "just work",
but it's quite a lot of work.


Reply to this email directly or view it on GitHubhttps://github.com//issues/448#issuecomment-17931371
.

@mariszin
Copy link

mariszin commented Jun 6, 2013

I solved my problem by defining the keys as strings:
In the schemas, there were elements with similar writing - paymentRequest and PaymentRequest. This caused savon not to find the correct namespace for the element, so the generated message was invalid.
Now that we define the message like this

      "paymentRequest" => {
        "PaymentRequest" => {
...

everything is OK.

@rubiii
Copy link
Contributor

rubiii commented Jun 29, 2013

glad this worked for you. properly solving this problem requires a lot of changes, so version 2 will continue to use this convention for backwards compatibility. version 3 will feature a proper type system which solves this problem.

@rubiii rubiii closed this as completed Jun 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants