解决方案 »

  1.   

    先看看都有什么$client = new SoapClient('http://183.63.194.18:2000/TTS/Services/CodeService.svc?wsdl');
    //print_r($client);
    echo '<xmp>';
    echo "提供的方法\n";
    print_r( $client->__getFunctions ()); 
    echo "相关的数据结构\n";
    print_r($client->__getTypes () ); 
    echo '</xmp>';
    print_r($client->saveInter(array()));
      

  2.   

    由 GetCodeBatchesResponse GetCodeBatches(GetCodeBatches $parameters) 可知,需要传递一个 GetCodeBatches 结构的参数
    struct GetCodeBatches {
     string codeId;
    }$client->GetCodeBatches(array( 'codeId' => ?));
    具体值该是多少,只有你知道
      

  3.   

    __getFunctions ()  这个可以得到所有动作的列表还有你是如何链接的会报错??贴出代码
      

  4.   

    报错了,具体报错如下:我的代码是这样的:
    <?php
    header("Content-type:text/xml;charset=utf-8");
    $client = new SoapClient('http://183.63.194.18:2000/TTS/Services/CodeService.svc?wsdl');
    /*//print_r($client);
    echo '<xmp>';
    echo "提供的方法\n";
    print_r( $client->__getFunctions ()); 
    echo "相关的数据结构\n";
    print_r($client->__getTypes () ); 
    echo '</xmp>';
    print_r($client->saveInter(array()));*/
    $parameters = "208x6XBJ140000080";
    $client->GetCodeBatches(array( 'codeId' => $parameters));
    ?>
    如果我不加那个header的话,报错就会变成这样:
      

  5.   

    设置 SoapClient 的第二个参数为
    array(
      'trace' => true,
      'cache_wsdl' => WSDL_CACHE_NONE,
      'soap_version'   => SOAP_1_2,
    )
    错误信息为
    Fatal error: Uncaught SoapFault exception: [s:Sender] The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'http://tempuri.org/ICodeService/GetCodeBatches'.
    意思是说不符合 http://tempuri.org/ICodeService/GetCodeBatches 的约束,如何处理就不知道了
      

  6.   

    我刚刚设置了soap的版本也出现这个报错,我看到有的资料说需要从接口那边下载一个什么代理类,什么的,表示各种看不懂,谷歌也没查出什么问题.
      

  7.   

    在谷歌查了,查了一下跟我同样问题的提问,最后代码改成这样了
    <?php
    $client = new SoapClient('http://183.63.194.18:2000/TTS/Services/CodeService.svc?wsdl',array('soap_version' => SOAP_1_2,"trace" => "1"));
    $actionHeader = new SoapHeader('http://www.w3.org/2005/08/addressing',
                                   'Action',
                                   'http://tempuri.org/ICodeService/GetCodeBatches');
    $client->__setSoapHeaders($actionHeader);
    $parameters = "208x6XBJ140000080";
    $client->__call('GetCodeBatches',array( 'codeId' => $parameters));
    ?>
    现在之前的报错没有了,但是报其他的错误