2017-07-12 17 views
0

私はPHPのプロジェクトでsoapServerを書いています。私はPHPですべてsoapCallをOk.But .netの他の人が私のWSDLを使用すると、エラーがあります。 私はこれはpanel.wsdl.netは私のsoapServerを使うことができません

<?xml version="1.0" encoding="ISO-8859-1"?> 
<definitions 
     targetNamespace='urn:server' 
     xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
     xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
     xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:tns='urn:server' 
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
     xmlns="http://schemas.xmlsoap.org/wsdl/"> 


<types> 
     <xsd:schema targetNamespace='urn:server' xmlns="urn:server"> 
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> 
      <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" /> 
      <xsd:complexType name="getActiveServicesResponse"> 
       <xsd:complexContent> 
        <xsd:restriction base="SOAP-ENC:Array"> 
         <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]" minOccurs="1" maxOccurs="unbounded"/> 
        </xsd:restriction> 
       </xsd:complexContent> 
      </xsd:complexType> 
      <xsd:complexType name="getHistoryServicesResponse"> 
       <xsd:complexContent> 
        <xsd:restriction base="SOAP-ENC:Array"> 
         <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]" minOccurs="1" maxOccurs="unbounded"/> 
        </xsd:restriction> 
       </xsd:complexContent> 
      </xsd:complexType> 
      <xsd:complexType name="getHistoryServicesAllResponse"> 
       <xsd:complexContent> 
        <xsd:restriction base="SOAP-ENC:Array"> 
         <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]" minOccurs="1" maxOccurs="unbounded"/> 
        </xsd:restriction> 
       </xsd:complexContent> 
      </xsd:complexType> 
     </xsd:schema> 
    </types> 
    <message name="getActiveServicesRequest"> 
     <part name="username" type="xsd:string" /> 
     <part name="password" type="xsd:string" /> 
     <part name="mobileNum" type="xsd:string" /></message> 
    <message name="getActiveServicesResponse"> 
     <part name="services" type="tns:getActiveServicesResponse" /></message> 
    <message name="unsubscribeRequest"> 
     <part name="username" type="xsd:string" /> 
     <part name="password" type="xsd:string" /> 
     <part name="mobileNum" type="xsd:string" /> 
     <part name="serviceID" type="xsd:string" /></message> 
    <message name="unsubscribeResponse"> 
     <part name="result" /></message> 
    <message name="getHistoryServicesAllRequest"> 
     <part name="username" type="xsd:string" /> 
     <part name="password" type="xsd:string" /> 
     <part name="mobileNum" type="xsd:string" /> 
     <part name="FromDate" type="xsd:string" /> 
     <part name="ToDate" type="xsd:string" /></message> 
    <message name="getHistoryServicesAllResponse"> 
     <part name="history" type="tns:getHistoryServicesAllResponse" /></message> 
    <message name="getHistoryServicesRequest"> 
     <part name="username" type="xsd:string" /> 
     <part name="password" type="xsd:string" /> 
     <part name="mobileNum" type="xsd:string" /> 
     <part name="serviceID" type="xsd:string" /> 
     <part name="FromDate" type="xsd:string" /> 
     <part name="ToDate" type="xsd:string" /></message> 
    <message name="getHistoryServicesResponse"> 
     <part name="history" type="tns:getHistoryServicesResponse" /></message> 
    <portType name="iPanelPortType"> 
     <operation name="getActiveServices"> 
      <input message="tns:getActiveServicesRequest"/> 
      <output message="tns:getActiveServicesResponse"/> 
     </operation> 
     <operation name="unsubscribe"> 
      <input message="tns:unsubscribeRequest"/> 
      <output message="tns:unsubscribeResponse"/> 
     </operation> 
     <operation name="getHistoryServicesAll"> 
      <input message="tns:getHistoryServicesAllRequest"/> 
      <output message="tns:getHistoryServicesAllResponse"/> 
     </operation> 
     <operation name="getHistoryServices"> 
      <input message="tns:getHistoryServicesRequest"/> 
      <output message="tns:getHistoryServicesResponse"/> 
     </operation> 
    </portType> 
    <binding name="iPanelBinding" type="tns:iPanelPortType"> 
     <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> 
     <operation name="getActiveServices"> 
      <soap:operation soapAction="urn:server#getActiveServices" style="rpc"/> 
      <input><soap:body use="encoded" namespace="urn:server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> 
      <output><soap:body use="encoded" namespace="urn:server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> 
     </operation> 
     <operation name="unsubscribe"> 
      <soap:operation soapAction="urn:server#unsubscribe" style="rpc"/> 
      <input><soap:body use="encoded" namespace="urn:server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> 
      <output><soap:body use="encoded" namespace="urn:server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> 
     </operation> 
     <operation name="getHistoryServicesAll"> 
      <soap:operation soapAction="urn:server#getHistoryServicesAll" style="rpc"/> 
      <input><soap:body use="encoded" namespace="urn:server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> 
      <output><soap:body use="encoded" namespace="urn:server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> 
     </operation> 
     <operation name="getHistoryServices"> 
      <soap:operation soapAction="urn:server#getActiveServices" style="rpc"/> 
      <input><soap:body use="encoded" namespace="urn:server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input> 
      <output><soap:body use="encoded" namespace="urn:server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output> 
     </operation> 
    </binding> 
    <service name="iPanel"> 
     <port name="iPanelPort" binding="tns:iPanelBinding"> 
      <soap:address location="http://37.130.202.161/integratedPanel?wsdl"/> 
     </port> 
    </service> 
</definitions> 

機能

あり、ここで

Error for .net

SoapUi error

を誤り、WSDL、SoupUi結果とfunctions.Thankful.enterイメージの説明を添付しました

<?php 
namespace App\Http\Controllers; 
use Illuminate\Http\Request; 
use Exception; 
use App\Notification; 
use App\LogNotification; 
use Log; 
class ServiceBinding extends Controller 
{ 

    public function getActiveServices($username,$password,$mobilNum) 
    { 
return "hello"; 
    } 

    public function unsubscribe($username,$password,$mobilNum,$serviceID) 
    { 
return "hello"; 
    } 

    public function getHistoryServicesAll($username,$password,$mobilNum,$toDate,$fromDate) 
    { 
return "hello"; 
    } 

    public function getHistoryServices($username,$password,$mobilNum,$serviceID,$toDate,$fromDate) 
    { 
return "hello"; 
    } 
} 
?> 

アクションソープ

<?php 

namespace App\Http\Controllers; 

use Illuminate\Http\Request; 
use Exception; 
use Log; 

class IntegratedPanelController extends Controller 
{ 

    public function soap() { 

     try{ 
      ini_set('soap.wsdl_cache_enabled', 0); 
      ini_set('soap.wsdl_cache_ttl', '0'); 

      $server = new \SoapServer('/home/sysadmin/VAS_mci/public/wsdl/panel.wsdl', array('cache_wsdl' => WSDL_CACHE_NONE)); 
      $server->setClass("App\Http\Controllers\ServiceBinding"); 
      try { 
       $server->handle(); 
      } 
      catch (Exception $e) { 
       echo 'IntegratedPanelController.........'. $e->getMessage(); 
       log::info($e->getMessage()); 
       $server->fault('Sender', $e->getMessage()); 
      } 
//   echo "SOAP Server started"; 
     } 
     catch (Exception $exception){ 
      echo 'IntegratedPanelController.........'.$exception->getMessage(); 
      log::info($exception->getMessage()); 
      return $exception->getMessage(); 
     } 
    } 


} 

答えて

0

標準についての素晴らしい点は、選択肢が非常に多いことです。 XMLに関しては、.NETとJavaはすべて異なる標準を持っています。 XMLは柔軟性があるので、新しい標準を作成することは簡単です。 1つは他の標準と互換性がありません。

WSDLはWSIに準拠していないため、ツールキットの外部で動作する保証はありません。 WSIはXMLの標準であり、SOAP呼び出しでどのように表現されるかによって、サービスがWSIの苦情であることを確認するために必要なすべてのもので動作するようにしたい場合に使用します。

SOAP UIでWSI準拠テストを実行しましたが、失敗しました。また、いくつかの意見では古いタイプのRPCタイプの呼び出しを使用しています。したがって、このような頭痛を避けるために、WSDLファイルが可能な限りWSIに準拠していることを確認する必要があります。

私たちがなぜそれを行うのかを簡単な例で説明します。プログラミングにおけるnullのコンセプトは、nullが定義されていないということです。 XMLでNO VALUEを指定するにはどうすればよいですか?

名前だけを持つ顧客のXMLがあるとします。 NULL Nameの値を指定するにはどうすればよいですか?

例1:

<customer> 
    <name/> 
</customer> 

例2:

<customer/> 

例3:だから

<customer> 
    <name nullable="true" /> 
</customer> 

あなたは私たちがここに見ることができるように私には、次のいずれかを行うことができますXMLでNULLを表現する3つの標準はどれですか?それらはすべて何らかの形で正しいです。それをどのように解釈するかによって異なります。

非常に奇妙なことの1つは、配列の定義方法です。

<xsd:complexType name="getHistoryServicesResponse"> 
      <xsd:complexContent> 
       <xsd:restriction base="SOAP-ENC:Array"> 
        <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]" maxOccurs="unbounded"/> 
       </xsd:restriction> 
      </xsd:complexContent> 
     </xsd:complexType> 

これは、次のエラーを生成します:私は液体のXMLスタジオで無効に以下の行をあなたのWSDLを開いたときに

(15:9) Critical The 'maxOccurs' attribute is not supported in this context. 
(15:9) Critical The 'minOccurs' attribute is not supported in this context. 

は私が最小値と最大値の出現を削除してから、私は別のエラーを打ちます。これは、主な問題は何であったか含まれている:

Schema Error Undefined complexType 'http://schemas.xmlsoap.org/soap/encoding/:Array' is used as a base for complex type restriction. 

基本的にはPHPの有効なは、.NETまたはJavaなど他の言語には有効ではありませんしながら、あなたがあなたのWSDLを定義する方法。問題は、配列を定義する方法にあります。

この質問にはError Consuming a RPC/Encoded SOAP web service in .NETが表示されます。私はこれがあなたが探している答えではないことを認識していますが、うまくいけば、問題が解決されるのを助けるでしょう。

関連する問題