2011-12-15 4 views
0

SOAP 요청을 SAP PI 웹 서비스에 보냅니다. 그런이 서비스 반환 SOAP 오류가 :PHP SOAP이 SAP PI/XI SOAP 오류를 catch하지 않습니다.

$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); 

그것은 를 인쇄,하지만 난 출력 동일한 XML (경우 예외

thow한다 : PHP에서

<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> 

은 내가 따라 할 비누 잘못) 내 웹 서비스에 난 괜찮아 잡을.

답변

0

문제는 WSDL에서 출력 태그에 있었다. 이 태그를 추가하여 문제가 해결되었습니다.

<wsdl:portType name="..."> 
    <wsdl:operation name="..."> 
     ... 
     <wsdl:input message="..."/> 
     <wsdl:output message="..."/> <!--- that tag--> 
    </wsdl:operation> 
</wsdl:portType> 
0

try/catch 블록이 없기 때문입니다.

이 시도 :

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

try{ 
    $result = $client->some_funtion("bla-bla-bla"); 
} catch (SoapFault $e){ 
    exit('caught soap fault'); 
} 
+0

아니요, 문제가 아닙니다. 시도/catch doens't 도움. 예외는 PHP 비누 클라이언트를 던져야하지만, 그런 일은 일어나지 않습니다. –