Web Service & API Fundamentals

hi all

i need your help i diodn’t get the idea from question in the Web Services Description Language (WSDL) module, any help

If you should think of the operation object in WSDL as a programming concept, which of the following is closer in terms of the provided functionality? Answer options (without quotation marks): “Data Structure”, “Method”, “Class”

Hey @m1ram, welcome to the community!

That is a great question, let me give you my understanding of what they mean. I compared it to Python scripting because that is the only language that I am semi-proficient with. Remember that I am not a professional programmer so this may be a bit crude haha, but in Python a Class is a bundle of Methods, whereas, a Method is an object within a Class. A Data Structure would be something like a list or a dictionary contained in a Method. So if I was to compare them I would say:

  • Class = <wsdl:binding name="HacktheboxServiceSoapBinding" type="tns:HacktheBoxSoapPort"></wsdl:binding>
  • Method = <wsdl:operation name="Login"></wsdl:operation>
  • Data Structure = <wsdl:input><soap:body use="literal"/></wsdl:input>

Look below and see that the Class(binding) above contains the Method(operation object), which then contains the Data Structure.

<wsdl:binding name="HacktheboxServiceSoapBinding" type="tns:HacktheBoxSoapPort">
		<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
		<!-- SOAP Login Action -->
		<wsdl:operation name="Login">
			<soap:operation soapAction="Login" style="document"/>
			<wsdl:input>
				<soap:body use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
		<!-- SOAP ExecuteCommand Action -->
		<wsdl:operation name="ExecuteCommand">
			<soap:operation soapAction="ExecuteCommand" style="document"/>
			<wsdl:input>
				<soap:body use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>

Take a look at some python methods and compare them: Difference between Method and Function in Python - GeeksforGeeks

Actually, I also wrote a lengthy post on SOAP request structures somewhere else in here to. The more you understand about the structure, the better off you will be later down the road. Hope this helps.
-onthesauce

1 Like