Closed silviucpp closed 4 years ago
Both WSDLs use SOAP encoding. The SOAP framework only supports WSDLs that are compliant with WS-I basic profile, which means that only literal encoding is supported.
Is xsd:enumeration supported? I noticed that the following wsdl did not work.
<xsd:simpleType name="Color">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="BLUE" />
<xsd:enumeration value="RED" />
<xsd:enumeration value="GREEN" />
</xsd:restriction>
</xsd:simpleType>
Unfortunately, no. soap
uses erlsom
for processing XML, and according to https://github.com/willemdj/erlsom/blob/master/README.md#xml-schema-elements enumerations are
Ignored (all restrictions on simple types are ignored - those types are treated as ‘string’)
Not sure how difficult it would be to support it. @willemdj ?
What do you mean exactly when you say that the "wsdl did not work"?
The enumeration should not be a reason for it not to work. You should be able to process the WSDL, and the client or server should be able to send/process requests. But you will not get a parsing error when you send/receive a value that is outside the range, so if you care about that your application will have to take care of it.
What do you mean exactly when you say that the "wsdl did not work"?
There is no compilation failure for definition of simpleType per-say but the type is reported as unknown when used elsewhere.
==> Generated file SomeService_client.erl
** exception throw: {error,"Type not found",'P4:Color'}
in function erlsom_example_value:from_type/3 (_build/default/lib/erlsom/src/erlsom_example_value.erl, line 64)
in call from erlsom_example_value:from_alternative/4 (_build/default/lib/erlsom/src/erlsom_example_value.erl, line 192)
in call from erlsom_example_value:'-from_element/4-lc$^0/1-0-'/4 (_build/default/lib/erlsom/src/erlsom_example_value.erl, line 136)
in call from erlsom_example_value:from_element/4 (_build/default/lib/erlsom/src/erlsom_example_value.erl, line 136)
in call from erlsom_example_value:from_elements/5 (_build/default/lib/erlsom/src/erlsom_example_value.erl, line 90)
in call from erlsom_example_value:from_type2/3 (_build/default/lib/erlsom/src/erlsom_example_value.erl, line 72)
in call from erlsom_example_value:from_alternative/4 (_build/default/lib/erlsom/src/erlsom_example_value.erl, line 192)
in call from erlsom_example_value:'-from_element/4-lc$^0/1-0-'/4 (_build/default/lib/erlsom/src/erlsom_example_value.erl, line 136)
The usage is as follows:
<xsd:complexType name="someStatus">
<xsd:sequence>
<xsd:element name="arg0" nillable="true" type="xsd:long" />
<xsd:element name="arg1" nillable="true" type="ns0:Color" />
</xsd:sequence>
</xsd:complexType>
The code for client is generated only when I get rid of usage for the simpleType (see below).
<xsd:element name="arg1" nillable="true" type="xsd:string" />
Can you provide a complete example? That is, the WSDL (and possibly imported files)? Something that shows how ns0
is imported/included in the WSDL, at least, because there seems to be a problem with that.
Hmm.. I made this up because the WSDL is not in public domain. I'll have to spend some time to build a complete example.
@neeraj9 is this still an issue for you?
@cmullaparthi The auto-gen code treats enumeration as string, but that is alright for now after I changed the WSDL a bit. Must say this project is a saviour, while helping me spread Erlang in my current organization because moving a legacy system which uses SOAP doesn't go away so easily :)
Thanks for making it open source.
Hello,
I have the following wsdl files:
https://sandbox-api.didww.com/api2/index.php?wsdl https://api.didww.com/api2/?wsdl
But I'm not able to generate the client.
Silviu