Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elixir call Axis2 Java SOAP Web Service with detergentex and detergent

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?

like image 289
Svein Fidjestøl Avatar asked Oct 14 '15 21:10

Svein Fidjestøl


1 Answers

According to the implementation a prefix is added on the init_model.

def init_model(wsdl_url, prefix \\ 'p') do
   Detergentex.Client.init_model(wsdl_url, prefix)
end

I would suggest to add an empty prefix.

like image 76
ipinak Avatar answered Oct 18 '22 13:10

ipinak