Question

I am using Savon 2.3 to call a web service with a wsdl file, but my wsdl file is divided into three files binding, operations and definition where the three reference each other like this binding -> operations -> definition.

In binding.wsdl I have following line which imports operations.wsdl:

<wsdl:import location="operations.wsdl" namespace="http://site.com"/>

and in my operations.wsdl I have the following which imports definition.wsdl :

<wsdl:import location="definition.wsdl" namespace="http://site.com/">

but when I call operations with Savon.client object, the operation defined in wsdl file is not returned with client.operations but when I am combine the three files :authenticate_user, which is defined in the wsdl file, is returned in the array like this:

1.9.3p448 :014 > client = Savon.client(wsdl: "binding.wsdl", wsse_auth: ["Username","Password"])
1.9.3p448 :014 > client_combined = Savon.client(wsdl: "combined.wsdl", wsse_auth: ["Username","Password"])

1.9.3p448 :016 > client.operations
 => [] 
1.9.3p448 :017 > client_combined.operations
 => [:authenticate_user] 

My questions is why is Savon not importing the corresponding wsdl files into one and then using it or am I missing something.

This question is pretty similar to this, but as I read Ivan's comment that it behaves differently from version to version and I am using Savon 2.3.0., I thought it would be better to ask this separately.

Was it helpful?

Solution

As per Vimsha's comment Savon 2.3.0 does not support xsd/wsdl: import, this is because the parser used by Savon is very basic and lacks the feature to resolve imports. Savon uses wasabi for parsing.

This has been resolved in Savon 3, please see this thread.

If you still have problem with imports in Savon 3 you can see this question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top