<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements. See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership. The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License. You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied. See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->

<wsdl:definitions targetNamespace="http://example"
	xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:tns="http://example"
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<wsdl:types>
		<schema elementFormDefault="qualified" targetNamespace="http://example"
			xmlns="http://www.w3.org/2001/XMLSchema"
			xmlns:apachesoap="http://xml.apache.org/xml-soap"
			xmlns:tns="http://example" xmlns:intf="http://example"
			xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
			
			<element name="withdraw">
				<complexType>
					<sequence>
						<element name="account" type="xsd:string"/>
						<element name="amount" type="xsd:int"/>
					</sequence>
				</complexType>
			</element>
			
			<element name="withdrawResponse">
				<complexType>
					<sequence>
						<element name="balance" type="xsd:int"/>
					</sequence>
				</complexType>
			</element>
			
			<element name="AccountNotExistFault">
				<complexType>
					<sequence>
						<element name="account" type="xsd:string"/>
					</sequence>
				</complexType>
			</element>
			
			<element name="InsufficientFundFault">
				<complexType>
					<sequence>
						<element name="account" type="xsd:string"/>
						<element name="balance" type="xsd:int"/>
						<element name="requestedFund" type="xsd:int"/>
					</sequence>
				</complexType>
			</element>
			
		</schema>
	</wsdl:types>
	
	<wsdl:message name="withdrawRequest">
		<wsdl:part element="tns:withdraw" name="parameters"/>
	</wsdl:message>
	
	<wsdl:message name="withdrawResponse">
		<wsdl:part element="tns:withdrawResponse" name="return"/>
	</wsdl:message>
	
	<wsdl:message name="InsufficientFundFaultMessage">
		<wsdl:part element="tns:InsufficientFundFault" name="fault"/>
	</wsdl:message>
	
	<wsdl:message name="AccountNotExistFaultMessage">
		<wsdl:part element="tns:AccountNotExistFault" name="fault"/>
	</wsdl:message>
	
	<wsdl:portType name="Bank">
		<wsdl:operation name="withdraw">
			<wsdl:input message="tns:withdrawRequest" name="withdrawRequest"/>
			<wsdl:output message="tns:withdrawResponse" name="withdrawResponse"/>
			<wsdl:fault message="tns:AccountNotExistFaultMessage" name="AccountNotExistException"/>
			<wsdl:fault message="tns:InsufficientFundFaultMessage" name="InsufficientFundException"/>
		</wsdl:operation>
		
	</wsdl:portType>
	
	<wsdl:binding name="BankSoapBinding" type="tns:Bank">
		<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="withdraw">
			<wsdlsoap:operation soapAction=""/>
			<wsdl:input name="withdrawRequest">
				<wsdlsoap:body use="literal"/>
			</wsdl:input>
			<wsdl:output name="withdrawResponse">
				<wsdlsoap:body use="literal"/>
			</wsdl:output>
			<wsdl:fault name="InsufficientFundException">
				<wsdlsoap:fault name="InsufficientFundException" use="literal"/>
			</wsdl:fault>
			<wsdl:fault name="AccountNotExistException">
				<wsdlsoap:fault name="AccountNotExistException" use="literal"/>
			</wsdl:fault>
		</wsdl:operation>
	</wsdl:binding>
	
	<wsdl:service name="BankService">
		<wsdl:port binding="tns:BankSoapBinding" name="Bank">
			<wsdlsoap:address location="http://localhost:8080/bank/services/Bank"/>
		</wsdl:port>
	</wsdl:service>
	
</wsdl:definitions>