Hi,
I'm developping a small web service server with SOAP4R. I'd like this
web server to catch soap header and work with them.
I use a WSDL and generate all the necessary stuff with wsdl2ruby. It
works great, excpet when I want to support headers in my server (the
header are explicit in the WSDL and everything just work fine when I
remove them from the WSDL).
Here's the strange thing. When I generate the code, I get a*Service.rb
file (wsdl2ruby makes it for me). This file contains this :
[ "",
"searchDeclarations",
[
["in", "header", ["::SOAP::SOAPElement", "http://
fsb.belgium.be/v1_00", "SyncHeader"]],
["in", "body", ["::SOAP::SOAPElement", "
http://www.ibz.be/
aline/schema", "SearchDeclarationsRequest"]],
["out", "return", ["::SOAP::SOAPElement", "
http://www.ibz.be/
aline/schema", "ListOfDeclarations"]] ],
{ :request_style => :document, :request_use => :literal,
:response_style => :document, :response_use => :literal,
:faults => {} }
],
which looks just great : my headers appear as I expect (I may be
wrong, but it looks good to me).
When the client calls my server, the server comlpains that it doesn't
know the operation SearchDeclarationsRequest (error in the router).
When I read the router code, I see that the list of << recognized >>
operation is built using a special method :
def first_input_part_qname(param_def)
This method seems to be used to parse the array shown above. And, what
seems a bug to me is that it looks like this function takes the first
"in" for the first operation. Which is not correct because the first
"in" is my header, not the proper message SearchDeclarationsRequest.
I solve that bug by switching the two "ins", like this :
[
["in", "body", ["::SOAP::SOAPElement", "
http://www.ibz.be/
aline/schema", "SearchDeclarationsRequest"]
["in", "header", ["::SOAP::SOAPElement", "http://
fsb.belgium.be/v1_00", "SyncHeader"]]
],
This way, the first_input_part_qname takes the body and not the
header. Going from there, everything is just fine.
The question is : is that a bug ?
stF