Code Monkey home page Code Monkey logo

Comments (4)

piotrooo avatar piotrooo commented on May 23, 2024

What do you mean "global level"?

from wsdl-creator.

mohs8421 avatar mohs8421 commented on May 23, 2024

these elements are defined in types, where I would expect complex types to be defined, not elements of complex types

from wsdl-creator.

piotrooo avatar piotrooo commented on May 23, 2024

Could you provide some example, how are you generate the code.
Please give a code how you generate a XML. Current output and expected output.

from wsdl-creator.

mohs8421 avatar mohs8421 commented on May 23, 2024

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"
The code that generates this is translating from the old library I used to yours.
Essentially I create Node elements directly to circumvent going through the parsing process once more.
These are then passed to the parameters and they are passed to the methods, just as the constructor of Method defines.
Example for the "Filter_arr" parts, it looks like this:

$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.

from wsdl-creator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.