SOAP-ERROR:解析WSDL:调用SAP PI时,PHP SoapClient中的未知必需WSDL扩展'http://schemas.xmlsoap.org/ws/2004/09/policy' [英] SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension 'http://schemas.xmlsoap.org/ws/2004/09/policy' in PHP SoapClient while calling SAP PI

查看:155
本文介绍了SOAP-ERROR:解析WSDL:调用SAP PI时,PHP SoapClient中的未知必需WSDL扩展'http://schemas.xmlsoap.org/ws/2004/09/policy'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现在SAP PI系统上运行的Web服务.我得到的WSDL看起来像这样:

I'm trying to implement a Web Service running on an SAP PI system. The WSDL I got looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="request_SO" targetNamespace="http://company.ch/orstest/jason_test" xmlns:p1="http://company.ch/orstest/jason_test" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:documentation/>
    <wsp:UsingPolicy wsdl:required="true"/>
    <wsp:Policy wsu:Id="OP_request_SO"/>
    <wsdl:types>
        <xsd:schema targetNamespace="http://company.ch/orstest/jason_test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://company.ch/orstest/jason_test">
            <xsd:element name="request" type="request"/>
            <xsd:element name="response" type="response"/>
            <xsd:complexType name="request">
                <xsd:annotation>
                    <xsd:appinfo source="http://sap.com/xi/VersionID">a8b7948ac2e211e2b2380000001f0d6a</xsd:appinfo>
                </xsd:annotation>
                <xsd:sequence>
                    <xsd:element name="body" type="xsd:string"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:complexType name="response">
                <xsd:annotation>
                    <xsd:appinfo source="http://sap.com/xi/VersionID">bf49af09c36c11e299790000001f0d6a</xsd:appinfo>
                </xsd:annotation>
                <xsd:sequence>
                    <xsd:element name="body" type="xsd:string"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="request">
        <wsdl:documentation/>
        <wsdl:part name="request" element="p1:request"/>
    </wsdl:message>
    <wsdl:message name="response">
        <wsdl:documentation/>
        <wsdl:part name="response" element="p1:response"/>
    </wsdl:message>
    <wsdl:portType name="request_SO">
        <wsdl:documentation/>
        <wsdl:operation name="request_SO">
            <wsdl:documentation/>
            <wsp:Policy>
                <wsp:PolicyReference URI="#OP_request_SO"/>
            </wsp:Policy>
            <wsdl:input message="p1:request"/>
            <wsdl:output message="p1:response"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="request_SOBinding" type="p1:request_SO">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
        <wsdl:operation name="request_SO">
            <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
            <wsdl:input>
                <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="request_SOService">
        <wsdl:port name="HTTP_Port" binding="p1:request_SOBinding">
            <soap:address location="http://qa1100ap601.company.car.web:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=BS_ORS&amp;receiverParty=&amp;receiverService=&amp;interface=request_SO&amp;interfaceNamespace=http://company.ch/orstest/jason_test" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
        </wsdl:port>
        <wsdl:port name="HTTPS_Port" binding="p1:request_SOBinding">
            <soap:address location="https://qas.soa.subcompany.company.ch/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=BS_ORS&amp;receiverParty=&amp;receiverService=&amp;interface=request_SO&amp;interfaceNamespace=http://company.ch/orstest/jason_test" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

我的PHP文件如下所示(目前仅此内容):

My PHP file looks like this (nothing more in it currently):

<?php 
$client = new SoapClient('test.wsdl');
?> 

运行脚本时,抛出以下错误:

When I'm running my script, I get the following error thrown:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension 'http://schemas.xmlsoap.org/ws/2004/09/policy' in /srv/www/htdocs/wsdl.php:2 Stack trace: #0 /srv/www/htdocs/wsdl.php(2): SoapClient->SoapClient('test.wsdl') #1 {main} thrown in /srv/www/htdocs/wsdl.php on line 2

我尝试在google和StackOverflow上搜索错误,还检查了php.net上的注释,但是我似乎无法弄清楚为了使此服务运行而必须进行的更改.我还尝试打开W​​SDL扩展URL,它似乎存在.

I tried searching for the error on google and StackOverflow, and also checked the comments on php.net, but I can't seem to figure out what I'd have to change in order to get this Service running. I also tried to open the WSDL extension URL, it seems to exist.

有人可以在这里扔我一块骨头吗?我尝试删除扩展URL,这导致以下错误:

Can someone throw me a bone here? I tried removing the extension URL, that results in the following error:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <UsingPolicy> in /srv/www/htdocs/wsdl.php:2 Stack trace: #0 /srv/www/htdocs/wsdl.php(2): SoapClient->SoapClient('test.wsdl') #1 {main} thrown in /srv/www/htdocs/wsdl.php on line 2

推荐答案

我唯一想到的解决方案是更新您的UsingPolicy标签:

The only solution I can think of at this point is to update your UsingPolicy tag:

更改标签:

<wsp:UsingPolicy wsdl:required="true"/> 

对此:

<wsp:UsingPolicy wsdl:required="false"/>

这篇关于SOAP-ERROR:解析WSDL:调用SAP PI时,PHP SoapClient中的未知必需WSDL扩展'http://schemas.xmlsoap.org/ws/2004/09/policy'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆