使用PHP表单更新SOAP值

时间:2019-04-12 05:52:15

标签: php soap soapui soap-client

我有一个php表单来更新wsdl中的SOAP值,如果使用SOAPUI,则可以在此示例帖子中正常工作:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:sub="http://subscriberprovisioning.ws.domain.com/">
   <soap:Header/>
   <soap:Body>
      <sub:wsUpdateSubscriberProfile>
         <!--Optional:-->
         <subscriberProfile>
            <!--Zero or more repetitions:-->
            <entry>
               <!--Optional:-->
               <key>RSID</key>
               <!--Optional:-->
               <value>12346</value>
            </entry>
         </subscriberProfile>
         <!--Optional:-->
         <subscriberID>123456</subscriberID>
      </sub:wsUpdateSubscriberProfile>
   </soap:Body>
</soap:Envelope>

但是当我尝试使用php表单时,此参数未传递给wsdl,这是我的代码process.php:

 <?php  
    $rsid= $_POST['RSID'];  
    $number= $_POST['subscriberID'];   
    $soap_exception_occured = false;

    $wsdl_path = 'http://ipnumber:80/services/SubscriberProvisioningService?wsdl';
    $response = '';
    ini_set('soap.wsdl_cache_enabled', '0'); 
    error_reporting(0);
    @ini_set('display_errors', 0);
    try {
        $client = new SoapClient($wsdl_path);
        }
    catch(SoapFault $exception) {
        $soap_exception_occured = true;
        $response .= '\nError occoured when connecting to the SOAP Server!';
        $response .= '\nSoap Exception: '.$exception;
        } 
    $subscriberID=$_POST['subscriberID'];
    $subscriberID = array("RSID" => $rsid, "subscriberID" => $number);
    $profile = new stdClass(); 
    $profile = $client->wsUpdateSubscriberProfile($subscriberID); 
    ?>

和表格:

<form method="POST" action="process.php">
        <div class="inner-form">
          <div class="input-field first-wrap">
              <input name="RSID" id="RSID" type="text" placeholder="Type RSID" />
          </div>
          <div class="input-field second-wrap">
            <input name="subscriberID" id="subscriberID" type="text" placeholder="Type Subscriber ID" />
          </div>
          <div class="input-field third-wrap">
            <button class="btn-search" type="submit">

            </button>
          </div>
        </div>
      </form>

任何人都建议如何通过此操作:

<subscriberProfile>
    <!--Zero or more repetitions:-->
    <entry>
       <!--Optional:-->
       <key>RSID</key>
       <!--Optional:-->
       <value>12346</value>
    </entry>
 </subscriberProfile>

谢谢

0 个答案:

没有答案