<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Obtaining the WSDL for an SCA component offering a Service as a Web service</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sca.examples.deploy.html">Deploying an SCA component</a></div> <div class="next" style="text-align: right; float: right;"><a href="sca.examples.understanding-wsdl.html">Understanding how the WSDL is generated</a></div> <div class="up"><a href="sca.examples.html">Examples</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="sca.examples.obtaining-wsdl" class="section"> <h2 class="title">Obtaining the WSDL for an SCA component offering a Service as a Web service </h2> <p class="para"> SCA components that expose a Web service interface (i.e. have an @binding.soap annotation) will return their WSDL definition in response to an HTTP request with a get parameter of "wsdl". The usual way to obtain this is with "?wsdl" on the end of a URL. The example below uses <span class="function"><a href="function.file-get-contents.html" class="function">file_get_contents()</a></span> to obtain WSDL from a service and writes it to a temporary file before then obtaining a proxy for the service in the usual way. You could of course also obtain the WSDL in a browser, or by some other means, and save the file yourself. </p> <p class="para"> <div class="example" id="example-5304"> <p><strong>Example #1 Generated WSDL </strong></p> <div class="example-contents"> <div class="xmlcode"><pre class="xmlcode"><?php $wsdl = file_get_contents('http://www.example.com/Services/Example.php?wsdl'); file_put_contents("service.wsdl",$wsdl); //write the wsdl to a file $service = SCA::getService('service.wsdl'); ?></pre> </div> </div> </div> </p> <p class="para"> NOTE: If the wsdl requires imported xsds, these will need to be fetched separately. </p> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sca.examples.deploy.html">Deploying an SCA component</a></div> <div class="next" style="text-align: right; float: right;"><a href="sca.examples.understanding-wsdl.html">Understanding how the WSDL is generated</a></div> <div class="up"><a href="sca.examples.html">Examples</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>