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

Issue with Wsld Namespace #49

Closed
ghost opened this issue Mar 16, 2010 · 4 comments
Closed

Issue with Wsld Namespace #49

ghost opened this issue Mar 16, 2010 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 16, 2010

I am not sure if I am doing something wrong or missing something:

but the following

response = client.search_jobs do |soap, wsse|
soap.header = "<AuthHeader xmlns="http://www.hiredesk.net/WebServices/DataExchangeServices/\">" +
{:sCompanyShortName => 'com' ,:sUserName => 'user' , :sPassword => 'pass'}.to_soap_xml +
""
soap.namespaces['xmlns:xsi'] = "http://www.w3.org/2001/XMLSchema-instance"
soap.namespaces['xmlns:xs'] = "http://www.w3.org/2001/XMLSchema"
soap.namespaces['xmlns:wsdl'] = client.wsdl.namespace_uri
soap.body = {:searchCriteria => "<HDCommand>\x0a <SearchJobs>\x0a <AddedAfter>2010-01-01</AddedAfter>\x0a </SearchJobs>\x0a </HDCommand>"}
end

generate this payload

<env:Envelope xmlns:wsdl="http://www.hiredesk.net/WebServices/DataExchangeServices/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">env:Headeruserpasscomp/env:Headerenv:Bodywsdl:SearchJobs<HDCommand>
<SearchJobs>
<AddedAfter>2010-01-01</AddedAfter>
</SearchJobs>
</HDCommand>/wsdl:SearchJobs/env:Body/env:Envelope

but the webservice on the other end does not like unless I add the following in front of the searchCriteria

wsdl:searchCriteria

So is there a way to do that in Savon automatically? Or Am I missing something in the namespace declaration? Not sure why I have to add wsdl to that searchCriteria tag..

@konung
Copy link

konung commented Mar 17, 2010

seatmanu,
actually I just had the same problem, look at the last comment of issue #39 - http://github.com/rubiii/savon/issues/closed#issue/39 - for my solution.

The thing is that wsdl is actully forced in to_xml method of soap.rb in savon lib on line 160. I fixed it by making xml_body tag accessible publicly. I will suggest to ruby to add this in the next release, but for now you can override it yourself.

@rubiii
Copy link
Contributor

rubiii commented Mar 17, 2010

added a fix for this for the next release: http://github.com/rubiii/savon/commit/93535eb7d1acb257a4ed8ece9630bc3ad3f30fe4

@rubiii
Copy link
Contributor

rubiii commented Mar 21, 2010

renamed the accessor to just "xml". commit at: http://github.com/rubiii/savon/commit/8c82ade65640a4b67ca906d2384a19f8f768c83f#L1L213

@rubiii
Copy link
Contributor

rubiii commented Mar 21, 2010

released version 0.7.6 containg a fix for this problem. please update.

calamitas pushed a commit to calamitas/savon that referenced this issue Jun 7, 2011
added an attr_accessor for :xml_body to the soap object. so you can now specify your very own request xml as a string and savon won't force you to use it's conventions.
This issue was closed.
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

2 participants