首页 > 解决方案 > 我如何在 php 中使用肥皂服务?

问题描述

服务测试链接为:https ://efatura-test.uyumsoft.com.tr/Services/Integration 。我试过这个:

    try {

    $server = new SoapClient('https://example.com?wsdl');
    $auth = new stdClass();
    $auth->Username = 'foo';
    $auth->Password = 'bar';

    $header = new SoapHeader('https://example.com/', 'Auth', $auth, false);
    $server->__setSoapHeaders($header);
    $response = $server->IsEInvoiceUser("9000068418");
} catch (Exception $exc) {

    echo $exc->getMessage();
}

但输出这样的错误:验证消息的安全性时发生错误。 我做错了什么?

标签: phpasp.net.netapisoap

解决方案


推荐阅读