-
Notifications
You must be signed in to change notification settings - Fork 615
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
Nested Attributes #433
Comments
you have to add the message: {
authenticate_request: {
user_id: "test", password: "test", service_account_no: "12345"
}
} ps. notice the snakecase |
Thanks for responding so quickly! Here is the code I changed: @response = client.call(:authenticate, message: { authenticate_request: { user_id: "test", password: "test", service_account_no: "12345" } }) After trying that, I get: <soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:global-rr="http://gsxws.apple.com/services/core/asp/am" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<global-rr:Authenticate>
<authenticateRequest>
<userId>test</userId>
<password>test</password>
<serviceAccountNo>12345</serviceAccountNo>
</authenticateRequest>
</global-rr:Authenticate>
</soapenv:Body>
</soapenv:Envelope> which does give me the nested "AuthenticateRequest" (although the case is wrong, but I can fix that later). Unfortunately I'm still getting I even pasted in the full XML produced by Savon into SoapUI (with the correct capitalization) and it still returns the same error. Here's what I figured out toying with SoapUI: SoapUI generates xmlns:glob="http://gsxws.apple.com/elements/global" where Savon generates xmlns:global-rr="http://gsxws.apple.com/services/core/asp/am" If I submit in SoapUI the following: <soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:global-rr="http://gsxws.apple.com/elements/global" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<global-rr:Authenticate>
<AuthenticateRequest>
<userId>test</userId>
<password>test</password>
<serviceAccountNo>12345</serviceAccountNo>
</AuthenticateRequest>
</global-rr:Authenticate>
</soapenv:Body>
</soapenv:Envelope> (changed the URI in xmlns:global-rr) I get the expected "Invalid User ID/Password from my SOAP service. So it seems that Savon is pulling the wrong URI from the WSDL or I'm missing an option I need to set. Thanks again for your help and your Gem! EDIT: I just set Now all I need to do is get "authenticateRequest" to be "AuthenticateRequest" and all is well! |
try the global namespace_identifier option. i'll take a look at the wsdl and why savon uses edit: didn't see your "edit" ;) that should work as well. |
See the edit at the end of my comment, I was able to get the namespace set with Thanks for taking the time to look at this! I was beating my head against a wall all day yesterday. EDIT: Looks like I've got a response! @response = client.call(:authenticate) do
message "AuthenticateRequest" => { user_id: "test", password: "test", service_account_no: "12345" }
end I think I can get it working from here, thanks for the assistance! |
so, i used your wsdl to see why savon uses the wrong namespace and it's because the wsdl doesn't define any types |
My WSDL is located at:
https://gsxwsit.apple.com/wsdl/amAsp/gsx-amAsp.wsdl
I'm attempting to do the "Authenticate" request, passing along a username, password, and service account number as requested.
SoapUI works normally, giving me a token that I can use for later commands.
With Savon, I get:
(S:Client) Cannot find dispatch method for {http://gsxws.apple.com/services/core/asp/am}Authenticate
It seems that Savon produces XML like this:
but my SOAP endpoint wants it like this (from SoapUI):
Notice I have an extra nested attribute for "AuthenticateRequest" inside of "glob:Authenticate".
Here's my code:
The text was updated successfully, but these errors were encountered: