dongwupu5991 2013-08-29 17:07
浏览 163

使用soapClient时SOAP操作错误

i am getting this error when trying to make a soap call.

The SOAP action specified on the message, '', does not match the HTTP SOAP Action. 

When i call $service->SearchTouristItems($sti); (this function is further below) i get the above error and i have no idea why.

The below is the code i am using.

// i used http://www.urdalen.no/wsdl2php/ to create TCS2Service which extends SoapClient

$service = new TCS2Service() ;

$sd = new ServiceDescriptor;
$sd->UniqueIdentifier = 'xxxxxxxxx-xxxxx-xxxx-xxxxx-xxxxxx';

$stic = new SearchTouristItemCriteria;
$stic->SearchString = array ('dublin') ;    

$sti = new SearchTouristItems;

$sti->searchTouristItemCriteria = $sd;
$sti->serviceDescriptor = $stic;

$result = $service->SearchTouristItems($sti);

    echo "<pre>";
    print_r($result);
    echo "</pre>";



SearchTouristItems looks like this  
  /**
   *  
   *
   * @param SearchTouristItems $parameters
   * @return SearchTouristItemsResponse
   */
  public function SearchTouristItems(SearchTouristItems $parameters) {
    return $this->__soapCall('SearchTouristItems', array($parameters),       array(
            'uri' => 'http://tempuri.org/',
            'soapaction' => ''
           )
      );
  }

this is the initilization of the client

public function TCS2Service($wsdl = "http://www.example.com/services/TCS2Service.svc", $options = array( 'soap_version'  => SOAP_1_2, 
          'exceptions'    => true, 
          'trace'         => 1, 
          'cache_wsdl'    => WSDL_CACHE_NONE,)) {
  foreach(self::$classmap as $key => $value) {
    if(!isset($options['classmap'][$key])) {
      $options['classmap'][$key] = $value;
    }
  }
  parent::__construct($wsdl, $options);
}
  • 写回答

3条回答 默认 最新

  • donoworuq450547191 2013-08-31 20:38
    关注

    Not sure though but what is the value of 'soapaction' => '' in your code is replaced with the provided parameter. I do not have that experience calling web services with PHP so just gave it a thought.

    评论

报告相同问题?

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程