从php连接Nav Web服务 [英] Connecting Nav web services from php
本文介绍了从php连接Nav Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我试图从php连接导航网络服务后跟(这个博客 [ ^ ]。
但它返回错误。
错误:
SOAP-ERROR:解析WSDL:无法从'http:// localhost:7047 / DynamicsNAVPMS / WS / SystemService'加载:开始预期标记,'<'未找到
我的PHP代码是:
//Client.php
Hi all,
Iam trying to connect the nav web service from php followed by (this blog[^]).
but it's returning an error.
Error:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:7047/DynamicsNAVPMS/WS/SystemService' : Start tag expected, '<' not found
my php code is:
//Client.php
<?php
require_once("NTLMStream.php");
require_once("NTLMSoapClient.php");
try
{
// we unregister the current HTTP wrapper
stream_wrapper_unregister('http');
// we register the new HTTP wrapper
stream_wrapper_register('http', 'NTLMStream') or die("Failed to register protocol");
// Initialize Soap Client
$baseURL = 'http://localhost:7047/DynamicsNAVPMS/WS/';
$client = new NTLMSoapClient($baseURL.'SystemService');
// Find the first Company in the Companies
$result = $client->Companies();
$companies = $result->return_value;
echo "Companies:<br>";
if (is_array($companies)) {
foreach($companies as $company) {
echo "$company<br>";
}
$cur = $companies[0];
}
else {
echo "$companies<br>";
$cur = $companies;
}
}
catch(Exception $ex)
{
echo $ex->getMessage();
}
?>
可以你告诉我哪里出错了?
提前感谢.........
Could you tell me where I went wrong?
thanks in advance.........
推荐答案
baseURL = ' http:// localhost:7047 / DynamicsNAVPMS / WS /';
baseURL = 'http://localhost:7047/DynamicsNAVPMS/WS/';
client = new NTLMSoapClient(
client = new NTLMSoapClient(
baseURL。' SystemService');
// 查找公司中的第一家公司
< span class =code-sdkkeyword>
baseURL.'SystemService'); // Find the first Company in the Companies
这篇关于从php连接Nav Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文