Re: SOAP-Server don't validate request

[email protected] (Ammarmar)
Newsgroups php.soap
Message-ID <[email protected]>
> 	<wsdl:binding name="HelloWorldBinding" type="tns:HelloWorldType">
> 		<soap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
> 		<wsdl:operation name="HelloWorld">
> 			<soap:operation soapAction="dhd:#HelloWorld"/>
> 			<wsdl:input>
> 				<soap:body use="literal" wsdl:required="true"/>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal"/>
> 			</wsdl:output>
> 		</wsdl:operation>
> 	</wsdl:binding>

First of all - at the moment validation in SOAP Server is worth zilch. It  
is practically non-existent.

_Always_ validate manually everything in PHP.

SOAP Client is able to do some more, e.g. it is able to detect missing  
fields in ComplexTypes.

As for missing parameters, I'm not sure if this is the problem, but  
binding section in your WSDL file is missing parts declaration (specifies  
part names and order). Try to use such code:

<wsdl:input>
	<soap:body use="literal" parts="FirstName SurName" />
</wsdl:input>

(similarly for output)

As for validating params type or such luxurious things like enumerations  
or regexps (yes, XML Schema supports regexps, too) - forget it. Do it  
yourself in your PHP code.

Hope this helps a bit.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.