Skip to content

Commit 391ef93

Browse files
committedOct 2, 2014
Addresses #75 - Allowing a 'null' argument for WSDL methods that take no arguments
1 parent 4015c02 commit 391ef93

File tree

9 files changed

+110
-0
lines changed

9 files changed

+110
-0
lines changed
 

‎.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ root = true
77
end_of_line = lf
88
insert_final_newline = true
99

10+
[*.xml]
11+
insert_final_newline = false
12+
1013
[*.js]
1114
indent_style = space
1215
indent_size = 2

‎lib/client.js

+2
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ Client.prototype._invoke = function(method, args, location, callback, options, e
140140
(method.inputSoap === 'encoded') && (encoding = 'soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ');
141141
} else if (typeof (args) === 'string') {
142142
message = args;
143+
} else if (args === null) {
144+
message = "<" + name + " />";
143145
} else {
144146
assert.ok(!style || style === 'document', 'invalid message definition for rpc style binding');
145147
// pass `input.$lookupType` if `input.$type` could not be found
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<xs:complexType name="DummyResult">
4+
<xs:sequence>
5+
<xs:element name="DummyList" type="tns:DummyList" minOccurs="0"/>
6+
</xs:sequence>
7+
<xs:attribute name="code" type="xs:string" use="optional"/>
8+
</xs:complexType>
9+
<xs:complexType name="Dummy">
10+
<xs:simpleContent>
11+
<xs:extension base="xs:string">
12+
<xs:attribute name="language" type="xs:language" use="optional"/>
13+
</xs:extension>
14+
</xs:simpleContent>
15+
</xs:complexType>
16+
<xs:complexType name="DummyList">
17+
<xs:sequence>
18+
<xs:element name="DummyElement" type="tns:Dummy" maxOccurs="unbounded"/>
19+
</xs:sequence>
20+
</xs:complexType>
21+
<xs:complexType name="DummyFilter">
22+
<xs:sequence>
23+
<xs:element name="DummyIntFilter" type="xs:string" minOccurs="0"/>
24+
<xs:element name="DummyStringFilter" type="xs:string" minOccurs="0"/>
25+
</xs:sequence>
26+
</xs:complexType>
27+
</xs:schema>
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<xs:import namespace="common.xsd" schemaLocation="common.xsd"/>
4+
<xs:element name="DummyRequest"></xs:element>
5+
<xs:element name="DummyResponse">
6+
<xs:complexType>
7+
<xs:sequence>
8+
<xs:element name="DummyResult" type="c:DummyResult"/>
9+
</xs:sequence>
10+
</xs:complexType>
11+
</xs:element>
12+
</xs:schema>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"DummyResult": {
3+
"DummyList": {
4+
"DummyElement": "Dummy Element Entry"
5+
}
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<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">
2+
<soap:Header></soap:Header>
3+
<soap:Body>
4+
<n:DummyResponse>
5+
<n:DummyResult>
6+
<c:DummyList xmlns:c="http://www.Dummy.com/Common/Types">
7+
<c:DummyElement>
8+
Dummy Element Entry
9+
</c:DummyElement>
10+
</c:DummyList>
11+
</n:DummyResult>
12+
</n:DummyResponse>
13+
</soap:Body>
14+
</soap:Envelope>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
3+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
4+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
5+
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">
6+
<wsdl:types>
7+
<xs:schema>
8+
<xs:import namespace="http://www.Dummy.com/Common/Types" schemaLocation="common.xsd"/>
9+
<xs:import namespace="http://www.Dummy.com/Name/Types" schemaLocation="name.xsd"/>
10+
</xs:schema>
11+
</wsdl:types>
12+
<wsdl:message name="DummyRequest">
13+
<wsdl:part name="DummyRequest" element="n:DummyRequest"/>
14+
</wsdl:message>
15+
<wsdl:message name="DummyResponse">
16+
<wsdl:part name="DummyResponse" element="n:DummyResponse"/>
17+
</wsdl:message>
18+
<wsdl:portType name="DummyPortType">
19+
<wsdl:operation name="Dummy">
20+
<wsdl:input message="tns:DummyRequest"/>
21+
<wsdl:output message="tns:DummyResponse"/>
22+
</wsdl:operation>
23+
</wsdl:portType>
24+
<wsdl:binding name="DummyBinding" type="tns:DummyPortType">
25+
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
26+
<wsdl:operation name="Dummy">
27+
<soap:operation soapAction="http://www.Dummy.com#Dummy" style="document"/>
28+
<wsdl:input>
29+
<soap:body use="literal"/>
30+
</wsdl:input>
31+
<wsdl:output>
32+
<soap:body use="literal"/>
33+
</wsdl:output>
34+
</wsdl:operation>
35+
</wsdl:binding>
36+
<wsdl:service name="DummyService">
37+
<wsdl:port name="DummyPortType" binding="tns:DummyBinding">
38+
<soap:address location="http://www.Dummy.com/"/>
39+
</wsdl:port>
40+
</wsdl:service>
41+
</wsdl:definitions>
42+

0 commit comments

Comments
 (0)
Please sign in to comment.