-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
duplicate element definitions #48
Comments
What do you mean "global level"? |
these elements are defined in types, where I would expect complex types to be defined, not elements of complex types |
Could you provide some example, how are you generate the code. |
Current output is something like this: <?xml version="1.0" encoding="UTF-8"?>
<definitions name="Product namesService" targetNamespace="http://redacted.com/wsdl/" xmlns:tns="http://redacted.com/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://redacted.com/wsdl/"><script xmlns="" id="custom-useragent-string"/>
<types>
<xsd:schema targetNamespace="http://redacted.com/wsdl/" xmlns="http://redacted.com/wsdl/">
<xsd:element name="login" type="xsd:string"/>
<xsd:element name="password" type="xsd:string"/>
<xsd:element name="start_transactionResponse" type="xsd:string"/>
<xsd:element name="end_transactionResponse" type="xsd:boolean"/>
<xsd:element name="login" type="xsd:string"/>
<xsd:element name="password" type="xsd:string"/>
<xsd:element name="filter_arr" type="ns:Filter_arr"/>
<xsd:complexType name="Filter_arr">
<xsd:sequence>
<xsd:element name="column" type="xsd:string"/>
<xsd:element name="value" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="filter_arr" type="ns:Filter_arr"/>
<xsd:complexType name="Filter_arr">
<xsd:sequence>
<xsd:element name="column" type="xsd:string"/>
<xsd:element name="value" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="filter_arr" type="ns:Filter_arr"/>
<xsd:complexType name="Filter_arr">
<xsd:sequence>
<xsd:element name="column" type="xsd:string"/>
<xsd:element name="value" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="name" type="xsd:string"/>
</xsd:schema>
</types>
<message name="start_transactionRequest">
<part name="login" element="ns:login"/>
<part name="password" element="ns:password"/>
</message>
<message name="start_transactionResponse">
<part name="start_transactionResponse" element="ns:start_transactionResponse"/>
</message>
<message name="end_transactionRequest"/>
<message name="end_transactionResponse">
<part name="end_transactionResponse" element="ns:end_transactionResponse"/>
</message>
<message name="start_license_transactionRequest">
<part name="login" element="ns:login"/>
<part name="password" element="ns:password"/>
</message>
<message name="start_license_transactionResponse">
<part name="start_license_transactionResponse" element="ns:start_license_transactionResponse"/>
</message>
<message name="get_usersRequest">
<part name="filter_arr" element="ns:filter_arr"/>
</message>
<message name="get_usersResponse">
<part name="get_usersResponse" element="ns:get_usersResponse"/>
</message>
<portType name="Product namesServicePortType">
<operation name="start_transaction">
<input message="tns:start_transactionRequest"/>
<output message="tns:start_transactionResponse"/>
</operation>
<operation name="end_transaction">
<input message="tns:end_transactionRequest"/>
<output message="tns:end_transactionResponse"/>
</operation>
<operation name="get_users">
<input message="tns:get_usersRequest"/>
<output message="tns:get_usersResponse"/>
</operation>
</portType>
<binding name="Product namesServiceBinding" type="tns:Product namesServicePortType">
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="start_transaction">
<soap12:operation soapAction="http://redacted.com/wsdl//#start_transaction"/>
<input>
<soap12:body use="literal" namespace="http://redacted.com/wsdl/"/>
</input>
<output>
<soap12:body use="literal" namespace="http://redacted.com/wsdl/"/>
</output>
</operation>
<operation name="end_transaction">
<soap12:operation soapAction="http://redacted.com/wsdl//#end_transaction"/>
<input>
<soap12:body use="literal" namespace="http://redacted.com/wsdl/"/>
</input>
<output>
<soap12:body use="literal" namespace="http://redacted.com/wsdl/"/>
</output>
</operation>
<operation name="get_users">
<soap12:operation soapAction="http://redacted.com/wsdl//#get_users"/>
<input>
<soap12:body use="literal" namespace="http://redacted.com/wsdl/"/>
</input>
<output>
<soap12:body use="literal" namespace="http://redacted.com/wsdl/"/>
</output>
</operation>
</binding>
<service name="Product namesServiceService">
<port name="Product namesServicePort" binding="tns:Product namesServiceBinding">
<soap12:address location="redacted/index.php"/>
</port>
</service>
</definitions> I removed a lot of duplicates and unimportant details for you, just imagine, that this filter_arr example is used by many operations provided, the same goes for the simple element "login" $elements[] = new Node('string', 'column', false);
$elements[] = new Node('string', 'value', false);
…
$parameter = new Parameter(new Node($parameter_type, $parameter_name, $is_array, $elements));
// imagine $out_parameter being constructed the same way
$method = new Method($function, $parameters, $out_parameter);
$wsdl_builder->setMethod($method); What I would expect is not having simple string message parts defined as their own elements, and not to have duplicate definitions. |
I am currently investigating, whether I can replace the outdated nusoap library with yours.
However I find one thing alarming in my test implementation.
The application is rather large, so there are many functions available to soap, some have the same parameter names.
The generated wsdl looks like this:
<xsd:element name="login" type="xsd:string"/> <xsd:element name="password" type="xsd:string"/> <xsd:element name="login" type="xsd:string"/> <xsd:element name="password" type="xsd:string"/>
So I have elements defined multiple times, hopefully all of them with the same type, so it might not cause a real problem. But it might also mean, that I cannot use this library for my purpose.
Wouldn't it be better to not define simple types on a global level?
The text was updated successfully, but these errors were encountered: