Skip to content

Commit

Permalink
Add tests for behavior PR #38 fixes
Browse files Browse the repository at this point in the history
Huge thanks to @dabooze for being patient while we sorted out the
fiasco with the regression from several months ago and fixed this
up. So glad that this has been resolved now.
  • Loading branch information
tjarratt committed Dec 19, 2013
1 parent b9e029c commit 64fe56a
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 56 deletions.
138 changes: 82 additions & 56 deletions spec/fixtures/no_message_parts.wsdl
Original file line number Diff line number Diff line change
@@ -1,59 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:article="http://example.com/article"
xmlns:actions="http://example.com/actions"
targetNamespace="http://example.com/actions">
<types>
<s:schema elementFormDefault="qualified" targetNamespace="http://example.com/actions">
<s:element name="Save">
<s:complexType>
<s:sequence>
<s:element name="article" type="article:Article"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
<s:schema elementFormDefault="qualified" targetNamespace="http://example.com/article">
<s:complexType name="Article">
<s:sequence>
<s:element minOccurs="0" name="Author" type="s:string"/>
<s:element minOccurs="0" name="Title" type="s:string"/>
</s:sequence>
</s:complexType>
</s:schema>
</types>
<message name="SaveSoapIn"/>
<message name="SaveSoapOut">
<part name="parameters" element="actions:SaveResponse"/>
</message>
<portType name="ArticleSoap">
<operation name="Save">
<input message="actions:SaveSoapIn"/>
<output message="actions:SaveSoapOut"/>
</operation>
</portType>
<binding name="ArticleSoap" type="actions:ArticleSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="Save">
<soap:operation soapAction="http://example.com/actions.Save" style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="StudyMDL">
<port name="StudyMDLSoap" binding="actions:StudyMDLSoap">
<soap:address location="http://example.com:1234/soap"/>
</port>
</service>
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:article="http://example.com/article"
xmlns:actions="http://example.com/actions"
targetNamespace="http://example.com/actions">
<types>
<s:schema elementFormDefault="qualified" targetNamespace="http://example.com/actions">
<s:element name="Save">
<s:complexType>
<s:sequence>
<s:element name="article" type="article:Article"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Delete">
<s:complexType>
<s:sequence>
<s:element name="article" type="article:Article"/>
</s:sequence>
</s:complexType>
</s:element>

</s:schema>
<s:schema elementFormDefault="qualified" targetNamespace="http://example.com/article">
<s:complexType name="Article">
<s:sequence>
<s:element minOccurs="0" name="Author" type="s:string"/>
<s:element minOccurs="0" name="Title" type="s:string"/>
</s:sequence>
</s:complexType>
</s:schema>
</types>
<message name="SaveSoapIn"/>
<message name="SaveSoapOut">
<part name="parameters" element="actions:SaveResponse"/>
</message>
<message name="DeleteSoapIn"/>
<message name="DeleteSoapOut">
<part name="parameters" element="DeleteResponse"/>
</message>

<portType name="ArticleSoap">
<operation name="Save">
<input message="actions:SaveSoapIn"/>
<output message="actions:SaveSoapOut"/>
</operation>
<operation name="Delete">
<input message="DeleteSoapIn"/>
<output message="DeleteSoapOut"/>
</operation>
</portType>
<binding name="ArticleSoap" type="actions:ArticleSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="Save">
<soap:operation soapAction="http://example.com/actions.Save" style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="Delete">
<soap:operation soapAction="http://example.com/actions.Delete" style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="StudyMDL">
<port name="StudyMDLSoap" binding="actions:StudyMDLSoap">
<soap:address location="http://example.com:1234/soap"/>
</port>
</service>
</definitions>
6 changes: 6 additions & 0 deletions spec/wasabi/parser/no_message_parts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@
it 'falls back to using the namespace ID in the port element' do
subject.operations[:save][:namespace_identifier].should == 'actions'
end

it 'gracefully handles port messages without a colon' do
subject.operations[:delete][:input].should == 'Delete'
subject.operations[:delete][:output].should == 'DeleteResponse'
subject.operations[:delete][:namespace_identifier].should be_nil
end
end
end

0 comments on commit 64fe56a

Please sign in to comment.