简体   繁体   中英

Is it bad practice to provide a SOAP service without WSDL?

I'm using PHP's SoapClient to access a SOAP service. The provider of the service has told me that their WSDL is only for development and I shouldn't use it in production.

The SoapClient constructor expects the first argument to be the WSDL of the service, but also allows null, when working in non-WSDL mode.

I've been searching the RFCs and W3C for guidance, but haven't been able to find anything definitive on the use of WDSLs with SOAP.

Should someone who provides a SOAP service also provide a WSDL?

If someone who provides a SOAP service with a WSDL, is it correct to query that WSDL for each SOAP call?

Is it bad practice to provide a SOAP service without WSDL?

I wouldn't call it bad practice. It is a convention to provide a WSDL file at ?wsdl but you are not required to. There might be a reason why the provider doesn't want to expose the WSDL file, eg if it's a private web service.

The provider of the service has told me that their WSDL is only for development and I shouldn't use it in production.

So there is a WSDL file but it shouldn't be used? Now that sounds like a bad practice to me. IMO there should either be a valid WSDL file or no file at all. A file that doesn't reflect the actual web service will just cause confusion.

is it correct to query that WSDL for each SOAP call?

Yes the WSDL file is cached anyways and hence won't be queried every time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM