Home  >  Q&A  >  body text

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

reply all(1)I'll reply

  • 为情所困

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

    Shouldn’t you post your nusoap_client class and use try-catch to catch exceptions. Before outputting the error, $client->__getLastRequest() gets the xml data you requested and prints the useful error information getMessage. And there is an encapsulation getTrace inside soap to obtain exception tracking information. If you encounter this kind of problem, just debug it step by step.

    reply
    0
  • Cancelreply