Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
添加授权角色以使用xsl访问XML(WSDL)文件_Xml_Xslt_Xsd_Wsdl_Mule - Fatal编程技术网

添加授权角色以使用xsl访问XML(WSDL)文件

添加授权角色以使用xsl访问XML(WSDL)文件,xml,xslt,xsd,wsdl,mule,Xml,Xslt,Xsd,Wsdl,Mule,我有一个WSDL,我想对其添加权限,使所有人都无法看到其上的所有方法: <wsdl:types> ... </wsdl:types> <wsdl:message> ... </wsdl:message> <wsdl:portType name="countrySoap"> <wsdl:operation name="GetCountryByCountryCode">

我有一个WSDL,我想对其添加权限,使所有人都无法看到其上的所有方法:

     <wsdl:types>
    ...
  </wsdl:types>

  <wsdl:message>
    ...
  </wsdl:message>

  <wsdl:portType name="countrySoap">
     <wsdl:operation name="GetCountryByCountryCode">
         <wsdl:documentation>Get country name by country code</wsdl:documentation>
         <wsdl:input message="tns:GetCountryByCountryCodeSoapIn" />
         <wsdl:output message="tns:GetCountryByCountryCodeSoapOut" />
     </wsdl:operation>
    <wsdl:operation name="GetISD">
        <wsdl:documentation>Get International Dialing Code </wsdl:documentation>
        <wsdl:input message="tns:GetISDSoapIn" />
        <wsdl:output message="tns:GetISDSoapOut" />
    </wsdl:operation>
    ...
  </wsdl:portType>

...
...
按国家代码获取国家名称
获取国际拨号代码
...

现在我想限制对WSDL这一部分的访问:

<wsdl:operation name="GetISD">
    <wsdl:documentation>Get International Dialing Code </wsdl:documentation>
    <wsdl:input message="tns:GetISDSoapIn" />
    <wsdl:output message="tns:GetISDSoapOut" />
</wsdl:operation>

获取国际拨号代码
这意味着:我希望CLient-X有这个角色来查看这个方法,但是CLient-Y没有足够的角色来查看这个方法

如何使用xsl语言在.xslt文件中使用此问题?

  • 在Mule中,使用
    mulexml:context属性
    了解XSL的用户权限
  • 在XSL中,用于根据用户权限信息控制
    wsdl:operation
    元素的输出

当然,根据用户权限以不同方式呈现WSDL是问题的一半:您还必须拒绝未经授权的SOAP请求。

我认为在考虑XSLT之前,您需要弄清楚如何在WSDL中做到这一点。一旦您知道了这一点,下一步就是使用XSLT进行必要的修改。我想根据客户机的IP地址重新对其进行排序?我认为正确的设计应该是基于请求的IP限制您的web服务,而不仅仅是对WSDL隐藏接口。即使调用者看不到WSDL中的方法,他们仍然可以调用它,这是一个安全漏洞。XSLT没有检索发出web请求的人的IP的固有功能。如果要基于IP地址执行逻辑,则需要将IP地址作为参数传入,或者定义一个扩展函数来检索它。