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

Colon in XML results in Error #143

Closed
chriskempson opened this issue Jan 26, 2011 · 8 comments
Closed

Colon in XML results in Error #143

chriskempson opened this issue Jan 26, 2011 · 8 comments

Comments

@chriskempson
Copy link

I seem to be having problems whenever there is a colon present in the XML e.g "xs:schema". Removing the colon sends the request fine. I've tried to isolate an example of this below.

Code:
response = client.request :action do
soap.xml = ':'
end

Result:
/Library/Ruby/Gems/1.8/gems/savon-0.8.4/lib/savon/soap/response.rb:75:in raise_errors': Savon::HTTP::Error from /Library/Ruby/Gems/1.8/gems/savon-0.8.4/lib/savon/soap/response.rb:16:ininitialize'
from /Library/Ruby/Gems/1.8/gems/savon-0.8.4/lib/savon/soap/request.rb:43:in new' from /Library/Ruby/Gems/1.8/gems/savon-0.8.4/lib/savon/soap/request.rb:43:inwith_logging'
from /Library/Ruby/Gems/1.8/gems/savon-0.8.4/lib/savon/soap/request.rb:25:in response' from /Library/Ruby/Gems/1.8/gems/savon-0.8.4/lib/savon/client.rb:78:inrequest'

I don't think this happened prior to version 0.8.4?

@rubiii
Copy link
Contributor

rubiii commented Jan 26, 2011

first of all, why are you sending only a colon? anyway ... i honestly don't think that's the problem. you're receiving an http error, which means your server response code is not within 200..299.

@chriskempson
Copy link
Author

I'm not sending just a colon. That was an example.

It happens whenever there is a colon in the XML. You're quite right the server's response was 400. However, I'm trying to figure out what is causing this bad request. For some reason it works fine when there is no colon in the XML.

@chriskempson
Copy link
Author

I used to do this:
response = client.request :ns, :login do
soap.body = {
'ns:username' => "chris"
}
end

With 0.8.4 I can do this which is great:

response = client.request :ns, :login do
   soap.body = {
      'username' => "chris"
   }
end

However, now I can't put a colon anywhere in the soap XML without that error being displayed. Meaning the first example now falls over.

@rubiii
Copy link
Contributor

rubiii commented Jan 26, 2011

could you please compare the xml generated for the request and check to see if both requests are actually the same?

@chriskempson
Copy link
Author

I have confirmed that the XML is the same as the XML I am sending using soapUI which returns a valid response.

@chriskempson
Copy link
Author

Never mind, downgraded to 0.8.3 and all works now.

@jkingdon
Copy link
Contributor

Not sure I completely follow the discussion above but this sounds like the elementFormDefault change in 0.8.4. See https://github.com/rubiii/savon/pull/155

@rubiii
Copy link
Contributor

rubiii commented Jul 8, 2011

this should be fixed with v0.9.6.

@rubiii rubiii closed this as completed Jul 8, 2011
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