Skip to content

Commit

Permalink
Test fails without fix
Browse files Browse the repository at this point in the history
This test is based on a simplified real world wsdl
  • Loading branch information
Lukas Oberhuber committed Dec 4, 2019
1 parent a822f9a commit 369ff9a
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
43 changes: 43 additions & 0 deletions spec/fixtures/wsdl/elements_in_types.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="www.example.com/XML" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s1="http://microsoft.com/wsdl/types/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="www.example.com/XML" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="www.example.com/XML">
<s:complexType name="Transaction" abstract="true">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Qualified" type="s:string" />
</s:sequence>
</s:complexType>
<s:complexType name="TopLevelTransaction">
<s:complexContent mixed="false">
<s:extension base="tns:Transaction">
</s:extension>
</s:complexContent>
</s:complexType>
<s:element name="TopLevelTransaction">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="TopLevelTransaction" type="tns:TopLevelTransaction" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="TopLevelTransactionSoapIn">
<wsdl:part name="parameters" element="tns:TopLevelTransaction" />
</wsdl:message>
<wsdl:portType name="XMLTESoap">
<wsdl:operation name="TopLevelTransaction">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">TopLevelTransaction.</wsdl:documentation>
<wsdl:input message="tns:TopLevelTransactionSoapIn" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="XMLTESoap12" type="tns:XMLTESoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="TopLevelTransaction">
<soap12:operation soapAction="www.example.com/XML/TopLevelTransaction" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>
11 changes: 11 additions & 0 deletions spec/savon/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,17 @@ def to_s
expect(response.http.body).to include("<user>lea</user>")
expect(response.http.body).to include("<password>top-secret</password>")
end

it "qualifies elements embedded in complex types" do
client = new_client(:endpoint => @server.url(:repeat),
:wsdl => Fixture.wsdl(:elements_in_types))
msg = {":TopLevelTransaction"=>{":Qualified"=>"A Value"}}

response = client.call(:top_level_transaction, :message => msg)

expect(response.http.body.scan(/<tns:Qualified>/).count).to eq(1)
end

end

context "global :env_namespace" do
Expand Down

0 comments on commit 369ff9a

Please sign in to comment.