首页  >  问答  >  正文

php调java开发的web service接口 提示Fault occurred while processing

php调用java开发的webservice接口报soap:Server: Fault occurred while processing

请求的数据

Array ( [sTicket] => {"username":"3ab6e844ca851bf318294a4f30f4a03e","password":"449924A9471E628995E503E34E9F5C88"} [sMGoods] => {"goodsguid":"60698","goodssourceurl":"http://www.city-office.com.cn/goods.php?id=60698"} )

php调用接口引用nusoap类 用$client->call()方法

上一个接口用同样的方法访问可以 到这个方法就不行了为什么

    require_once('lib/nusoap.php');
    
    $client = new nusoap_client('http://220.191.208.229/gpmall/ws/MallService?wsdl', 'wsdl','','');
    
    $client->soap_defencoding = 'utf-8';
    $client->xml_encoding = 'utf-8';
    $client->decode_utf8 = false;
    $username = '3ab6e844ca851bf318294a4f30f4a03e';
    $pwd = '449924A9471E628995E503E34E9F5C88';
    
    
    $aa1= array('username'=>$username, 
                    'password'=>$pwd);
                    
                    
    $aa1=json_encode($aa1);
    
    
    //print_r($aa1);
    
    $goodsparams=array('goodsguid'=>'60698',
                       'goodssourceurl'=>'http://www.city-office.com.cn/goods.php?id=60698',  
                    
                    );
            $goodsparams=json_encode($goodsparams);
            
            //print_r($goodsparams);
            $arr=array('sTicket'=>"$aa1",'sMGoods'=>"$goodsparams");
            
            print_r($arr);
            
            $result = $client->call('exchangeGoodsURL',$arr, '', '', false, true);
            
            if  (!$err=$client->geterror()) {
                //echo '已交换';
                print_r($result);
                echo '</br>';
            } else {
                echo 'no';
    if ($err) {
                    // Display the error
                    echo '<h2>Error</h2><pre>' . $err . '</pre>';
                } else {
                    //print_r($result);
                    //echo $result['out'];
                    $ts=explode(',',$result['out']);
                    $ts1=explode(':',$ts[1]);
                    echo $i+1,":",$ts1[1],"</br>" ;
                
                }
            }
伊谢尔伦伊谢尔伦2734 天前888

全部回复(1)我来回复

  • 为情所困

    为情所困2017-05-16 13:08:32

    你不应该贴出你的nusoap_client类么,用try-catch去捕获异常。在输出错误之前$client->__getLastRequest(),去获取你请求的xml数据,并且打印错误有用信息getMessage。并且soap内部有封装getTrace去获取异常追踪信息。遇到这种问题一步一步调试就好了的。

    回复
    0
  • 取消回复