Click here to Skip to main content
15,904,926 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
<?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.........
Posted

Hi all,

sorry guys what ever they provide Freedy Blog[^] obviously correct. I had small mistake in my credential Page, So it's working fine

thanks for all..
 
Share this answer
 
Your code looks okay (some minor syntax issues, but nothing that looks like it'll break the script), so the issue could be with the returned data from the call to $client->Companies();.

Use this as a guide to check the XML returned from the Web Service to make sure it's not sending an empty character or anything that would break the parser: http://stackoverflow.com/questions/15764748/start-tag-expected-not-found-in-sitemap-xml-not-sure-whats-wrong[^].

Most of the time I see errors coming back from Web Services it's related to malformed XML that "looks okay" but there's a hidden character somewhere that's blowing it all up.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900