From Elixir, I am trying to call a SOAP Web Service with detergentex, which is a wrapper around the Erlang library detergent.
I can call the SOAP Web Service in the example on the detergent home page with no problems: http://www.webservicex.net/convertVolume.asmx?WSDL
Parameters:
wsdl_url = "http://www.webservicex.net/convertVolume.asmx?WSDL"
action = "ChangeVolumeUnit"
parameters = ["100","dry","centiliter"]
However when trying to call an Axis2 Java SOAP Web Service I am having some problems. Example: http://www.thomas-bayer.com/axis2/services/BLZService?wsdl
When calling "getBank" in the following way
wsdl_url = "http://www.thomas-bayer.com/axis2/services/BLZService?wsdl"
action = "getBank"
parameters = ["abc"]
wsdl = Detergentex.init_model(wsdl_url)
res = Detergentex.call(wsdl, action, parameters)
I get the following error message:
{:error, 'Struct doesn\'t match model: recordtype not expected: p:getBank'}
with the following stack trace
src/erlsom_write.erl:357: :erlsom_write.findAlternative/4
src/erlsom_write.erl:258: :erlsom_write.processSubType/5
src/erlsom_write.erl:241: :erlsom_write.processElementValues/7
src/erlsom_write.erl:132: :erlsom_write.struct2xml/6
src/erlsom_write.erl:323: :erlsom_write.processAlternativeValue/8
src/erlsom_write.erl:241: :erlsom_write.processElementValues/7
src/erlsom_write.erl:116: :erlsom_write.struct2xml/6
src/erlsom_write.erl:323: :erlsom_write.processAlternativeValue/8
src/erlsom_write.erl:241: :erlsom_write.processElementValues/7
src/erlsom_write.erl:45: :erlsom_write.write/2
src/detergent.erl:211: :detergent.call_attach/8
Any suggestions as to what I'm doing wrong?
According to the implementation a prefix is added on the
init_model
.I would suggest to add an empty prefix.
This code
in detergentex/lib/detergentex/client.ex should be replaced with
so you will avoid a bug with incorrect prefix. I don't know what is wrong because both versions seem legit.
Your code will not work anyway - a new error appears :/
I have a different errors with my code for the url:
The first one:
and after correcting:
So this time it looks like it is something wrong with encoding I suppose.