小编Lau*_*tiu的帖子

Eurotours XML接口SOAP HTTP未经授权

我尝试从Eurotours XML接口做一个例子,但所有SOAP函数调用都给了我

PHP致命错误:未捕获SoapFault异常:[HTTP]未经授权

这是我的代码:

$soapClient = new SoapClient("https://ws.eurotours.at/accommodation/development/AccommodationService?wsdl",array('trace' => true));
$functions = $soapClient -> __getFunctions();
$soapClient -> getLanguages(array("Client"=>"TESTXMLB2B"));
Run Code Online (Sandbox Code Playgroud)

它只是来自测试文档的客户端,我不知道我是否错了.

这是我的完全例外,我想知道是否真的是一个授权问题,或者只是因为我在拨打电话时犯了一个错误:

object(SoapFault)#2 (9) {
  ["message":protected]=>
  string(12) "Unauthorized"
  ["string":"Exception":private]=>
  string(0) ""
  ["code":protected]=>
  int(0)
  ["file":protected]=>
  string(34) "/home/laurentiu/teste/testswap.php"
  ["line":protected]=>
  int(5)
  ["trace":"Exception":private]=>
  array(3) {
    [0]=>
    array(4) {
      ["function"]=>
      string(11) "__doRequest"
      ["class"]=>
      string(10) "SoapClient"
      ["type"]=>
      string(2) "->"
      ["args"]=>
      array(5) {
        [0]=>
        string(224) "<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ws.eurotours.at/"><SOAP-ENV:Body><ns1:getLanguages/></SOAP-ENV:Body></SOAP-ENV:Envelope>
"
        [1]=>
        string(74) "https://ws.eurotours.at:443/accommodation/development/AccommodationService"
        [2]=>
        string(0) ""
        [3]=>
        int(1)
        [4]=>
        int(0)
      }
    }
    [1]=>
    array(6) { …
Run Code Online (Sandbox Code Playgroud)

php xml soap

6
推荐指数
1
解决办法
5182
查看次数

谷歌地图显示来自 json 的路线

我有下一个问题来显示来自基本 JSON 的路由。

  1. 我在后端打了一个电话: curl to https://maps.googleapis.com/maps/api/directions/json
  2. 我将响应 json 发送回前端
  3. 在前端,我尝试仅出于视觉目的渲染路由,为什么我不使用 google v3 API 来获取 routeResponse 对象是因为我不想复制与后端使用相同的配置并在前端转换为 requestObejct
  4. 我尝试基于来自 googleapi 的后端 json 创建 routeResponse json:
data.overviewRouteDirectionSteps.bounds = new google.maps.LatLngBounds(
data.overviewRouteDirectionSteps.bounds.southwest,data.overviewRouteDirectionSteps.bounds.northeast);

data.overviewRouteDirectionSteps.overview_path=google.maps.geometry.encoding.decodePath(data.overviewRouteDirectionSteps.overview_polyline.points);

data.overviewRouteDirectionSteps.overview_polyline = data.overviewRouteDirectionSteps.overview_polyline.points;

directionsDisplay.setDirections({
    request: {
        travelModel: 'DRIVING'
    },
    routes: [data.overviewRouteDirectionSteps]
});
Run Code Online (Sandbox Code Playgroud)

问题是我看到了开始和结束标记 + 腿点,但没有看到这条线:

在此处输入图片说明

我应该怎么做才能有正确的显示路线?与流程代码类似:

directionsService.route(request, function(response, status) {
    if (status === 'OK') {
        console.log(response);
        directionsDisplay.setDirections(response);
    } else {
        console.log('Directions request failed due to ' + status);
    }
})
Run Code Online (Sandbox Code Playgroud)

javascript google-maps google-maps-api-3

3
推荐指数
1
解决办法
2445
查看次数

ContainerAwareCommand with get doctrine

我尝试在cron作业中使用doctrine,我尝试从堆栈中遵循一些建议并找到使用

ContainerAwareCommand

但是内核似乎有问题,每次都找不到他,这里是我简单的cron命名空间Site\Bundle\AdminBundle\Services\Cron;

class EuropatourCron extends \Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand
{
    protected function configure() {
        parent::configure();
        $this->setName("updateInfo")
                ->setDescription("Update db with offert from Europatours.at")
                ->addArgument('install');
    }

    protected function execute(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) {
        $toDo = $this->getContainer()->get('doctrine')->getRepository('SiteAdminBundle:Europatoursofertacron')->findBy(array(
            'status' => 0
        ));

        $output->writeln(\Doctrine\Common\Util\Debug::dump($toDo));
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我的测试文件:

// application.php
require_once 'vendor/autoload.php';
require_once 'src/Site/Bundle/AdminBundle/Services/Crons/EuropatourCron.php';
use Site\Bundle\AdminBundle\Services\Cron\EuropatourCron;
use Symfony\Component\Console\Application;

$application = new Application();
$application->add(new EuropatourCron);
$application->run();
Run Code Online (Sandbox Code Playgroud)

我试着找到了这个错误的共鸣但没有找到:

PHP致命错误:在第42行的/var/www/europatur/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerAwareCommand.php中调用未定义的方法Symfony\Component\Console\Application :: getKernel()

php cron doctrine symfony doctrine-orm

1
推荐指数
1
解决办法
2281
查看次数