Skip to content

Commit

Permalink
Addresses vpulim#75 - Allowing a 'null' argument for WSDL methods tha…
Browse files Browse the repository at this point in the history
…t take no arguments
  • Loading branch information
cklosowski committed Oct 2, 2014
1 parent 4015c02 commit 391ef93
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ root = true
end_of_line = lf
insert_final_newline = true

[*.xml]
insert_final_newline = false

[*.js]
indent_style = space
indent_size = 2
Expand Down
2 changes: 2 additions & 0 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ Client.prototype._invoke = function(method, args, location, callback, options, e
(method.inputSoap === 'encoded') && (encoding = 'soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ');
} else if (typeof (args) === 'string') {
message = args;
} else if (args === null) {
message = "<" + name + " />";
} else {
assert.ok(!style || style === 'document', 'invalid message definition for rpc style binding');
// pass `input.$lookupType` if `input.$type` could not be found
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:tns="http://www.Dummy.com/Common/Types" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.Dummy.com/Common/Types" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="DummyResult">
<xs:sequence>
<xs:element name="DummyList" type="tns:DummyList" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="code" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="Dummy">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="language" type="xs:language" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="DummyList">
<xs:sequence>
<xs:element name="DummyElement" type="tns:Dummy" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="DummyFilter">
<xs:sequence>
<xs:element name="DummyIntFilter" type="xs:string" minOccurs="0"/>
<xs:element name="DummyStringFilter" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:c="http://www.Dummy.com/Common/Types" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.Dummy.com/Name/Types" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="common.xsd" schemaLocation="common.xsd"/>
<xs:element name="DummyRequest"></xs:element>
<xs:element name="DummyResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="DummyResult" type="c:DummyResult"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.Dummy.com" xmlns:n="http://www.Dummy.com/Name/Types"><soap:Header></soap:Header><soap:Body><n:DummyRequest xmlns:n="http://www.Dummy.com/Name/Types" xmlns="http://www.Dummy.com/Name/Types"></n:DummyRequest></soap:Body></soap:Envelope>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"DummyResult": {
"DummyList": {
"DummyElement": "Dummy Element Entry"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://www.Dummy.com" xmlns:n="http://www.Dummy.com/Name/Types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header></soap:Header>
<soap:Body>
<n:DummyResponse>
<n:DummyResult>
<c:DummyList xmlns:c="http://www.Dummy.com/Common/Types">
<c:DummyElement>
Dummy Element Entry
</c:DummyElement>
</c:DummyList>
</n:DummyResult>
</n:DummyResponse>
</soap:Body>
</soap:Envelope>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.Dummy.com" xmlns:n="http://www.Dummy.com/Name/Types" xmlns:ns="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://www.Dummy.com">
<wsdl:types>
<xs:schema>
<xs:import namespace="http://www.Dummy.com/Common/Types" schemaLocation="common.xsd"/>
<xs:import namespace="http://www.Dummy.com/Name/Types" schemaLocation="name.xsd"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="DummyRequest">
<wsdl:part name="DummyRequest" element="n:DummyRequest"/>
</wsdl:message>
<wsdl:message name="DummyResponse">
<wsdl:part name="DummyResponse" element="n:DummyResponse"/>
</wsdl:message>
<wsdl:portType name="DummyPortType">
<wsdl:operation name="Dummy">
<wsdl:input message="tns:DummyRequest"/>
<wsdl:output message="tns:DummyResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DummyBinding" type="tns:DummyPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Dummy">
<soap:operation soapAction="http://www.Dummy.com#Dummy" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DummyService">
<wsdl:port name="DummyPortType" binding="tns:DummyBinding">
<soap:address location="http://www.Dummy.com/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

0 comments on commit 391ef93

Please sign in to comment.