1

SAP PI Web サービスへの SOAP リクエストを行います。このサービスは、次のような SOAP エラーを返します。

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP:Body>
          <SOAP:Fault>
             <faultcode>SOAP:Server</faultcode>
             <faultstring>Server Error</faultstring>
             <detail>
                <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
                   <context>XIAdapter</context>
                   <code>ADAPTER.JAVA_EXCEPTION</code>
                   <text>com.sap.aii.af.service.cpa.CPAObjectNotFoundException: Couldn't retrieve binding for the given channelId: Binding:CID=null;
        at com.sap.aii.af.service.cpa.impl.lookup.AbstractLookupManager.getBindingByChannelId(AbstractLookupManager.java:173)
        at com.sap.aii.adapter.soap.web.MessageServlet.doPost(MessageServlet.java:449)
        ....
        at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:327)</text>
                </s:SystemError>
             </detail>
          </SOAP:Fault>
       </SOAP:Body>
</SOAP:Envelope>

PHPでは、次のことを行います。

$client = new SoapClient('path/to/wsdl', array(
            'cache_wsdl' => WSDL_CACHE_NONE,
            'exceptions' => true,
            'login' => 'some_login',
            'password' => 'some_password',
        ));
$result = $client->some_funtion("bla-bla-bla");
var_dump($result);

nullを出力しますが、例外をスローする必要があります

自分の Web サービスで同じ xml (soap fault) を出力すると、問題なくキャッチできます。

4

2 に答える 2

1

問題は WSDL の出力タグにありました。このタグを追加して問題を解決しました

<wsdl:portType name="...">
     <wsdl:operation name="...">
         ...
         <wsdl:input message="..."/>
         <wsdl:output message="..."/> <!--- that tag-->
     </wsdl:operation>
</wsdl:portType>
于 2012-01-12T13:59:07.907 に答える