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

How to define minOccurs from the soap_action? #10

Closed
arrk-shoba opened this issue Mar 9, 2012 · 6 comments
Closed

How to define minOccurs from the soap_action? #10

arrk-shoba opened this issue Mar 9, 2012 · 6 comments

Comments

@arrk-shoba
Copy link

In my controller I have a method 'upload_program'. The soap action is defined as follows:
soap_action "upload_program",
:args => { :import_request => { :programmes => { :program => [{ :id => :string, :program_name => :string,
:jacs_code => :string, :school_name => :string, :faculty_name => :string,
:study_type => :string, :record_type => :string }] } } },
:return => :xml
def upload_program
...
end
I am testing using SoapUI and all the elements are treated as 'required=true'. I want to know how can I define any of the elements as non-mandatory. Foe example the 'faculty_name' might not be sent in the SOAP request

@arrk-shoba
Copy link
Author

I tried defining the soap_action as:
soap_action "upload_program",
:args => { :import_request => { :programmes => { :program => [{ :id => :string, :program_name => [:string],
:jacs_code => [:string], :school_name => [:string], :faculty_name => [:string],
:study_type => [:string], :record_type => :string }] } } },
:return => :xml
def upload_program
...
end

The wsdl showed minOccurs=0 correctly as expected. However, I still get fault response

Server Required SOAP parameter 'program_name' is missing

What else I need to declare in soap_action to get rid of the fault messages?

@inossidabile
Copy link
Owner

The latter case will define all the parameters as arrays. There's no way to define non-required parameter in wash_out atm 😢. Let me allow that for you.

@inossidabile
Copy link
Owner

Fixed in 0.3.2

@arrk-shoba
Copy link
Author

Hi,

I am stuck with couple of more issues. I am new to Ruby & Rails hence there are some other of problems too.
I took the gem update & have wash-out 0.3.2. However, my request xml is tightly coupled to the args defined for soap_action. As mentioned above, my request xml is a complex structure. I can have 1 or many program nodes with programmes. However, if I send a SOAP request with only 1 program node, it fails with the following error:

NoMethodError (undefined method `with_indifferent_access' for ["id", "1001"]:Array):

When I send request with multiple program nodes, it works well.

Second issue is, I had raised Issue 10 - you have closed it - however, if a tag is missing in the request, it still throws Required SOAP parameter 'program_name' is missing

Only if the data is missing within the tag, it passes and reaches my controller code.

@inossidabile
Copy link
Owner

Please don't post to closed issues with additional requests. Create new issues. For the first part I'll need some of your code to reproduce it. For the last part we've got a unit test and it's green. So I'll probably need a code too.

@arrk-shoba
Copy link
Author

Apologies for the inconvenience. Added another issue.

-----Original Message-----
From: Boris Staal [mailto:reply@reply.github.com]
Sent: 14 March 2012 13:49
To: arrk-shoba
Subject: Re: [wash_out] How to define minOccurs from the soap_action? (#10)

Please don't post to closed issues with additional requests. Create new issues. For the first part I'll need some of your code to reproduce it. For the last part we've got a unit test and it's green. So I'll probably need a code too.


Reply to this email directly or view it on GitHub:
https://github.com/roundlake/wash_out/issues/10#issuecomment-4493839

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants