IT Community - Software Programming, Web Development and Technical Support

Error : PHP and SOAP to consume a .net webservice

This is a discussion on Error : PHP and SOAP to consume a .net webservice within the PHP Programming forums, part of the Web Development category; Hi All, Greetings I am new to XML and Web Services. I want to consume a .NET webservice using php ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 02-03-2009, 09:41 PM
azy777 azy777 is offline
D-Web Trainee
 
Join Date: Feb 2009
Posts: 1
azy777 is on a distinguished road
Default Error : PHP and SOAP to consume a .net webservice

Hi All,

Greetings

I am new to XML and Web Services. I want to consume a .NET webservice using php and SOAP. It is a CV parsing system where the CV has to be sent in a base64 format and the parsed response is supposed to be sent back by the system.

I get an error message saying:

"HTTP/1.1 100 Continue HTTP/1.1 200 OK
Date: Wed, 04 Feb 2009 07:19:11 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727
Cache-Control: private,
max-age=0 Content-Type: text/xml;
charset=utf-8
Content-Length: 400
Incorrect password. Message changed - 03/02/2009"

Could anyone please tell me what could be wrong ?... Any help would get me out a hole

Please find the code I have used below :

include_once("lib/nusoap.php");

$soapClient = new nusoap_client('http://www.example.com/webservice.asmx?WSDL', 'wsdl');

$Password = 'password';

$file = "test.doc";

$contents = base64_encode(file_get_contents($file));

$header = '
<ServiceAuthHeader xmlns="http://www.example.com">
<Password>' . $Password . '</Password>
</ServiceAuthHeader>';

$soapClient->setHeaders($header);

$getAuth = array('DocArray' => $contents, 'CandidateID' => '234528345', 'FileName' => 'test.doc', 'Password' => 'password');

$err = $soapClient->getError();
if ($err) {
echo '<p><b>Constructor error: ' . $err . '</b></p>';
}
else{
$result = $soapClient->call('SoapAction', array('parameters' => $getAuth), 'http://www.example.com/', 'http://www.example.com/SoapAction', false, true);
if ($client->fault) {
echo '<p><b>Fault: ';
print_r($result);
echo '</b></p>';
echo '<p><b>Request: <br>';
echo htmlspecialchars($soapClient->request, ENT_QUOTES) . '</b></p>';
echo '<p><b>Response: <br>';
echo htmlspecialchars($soapClient->response, ENT_QUOTES) . '</b></p>';
echo '<p><b>Debug: <br>';
echo htmlspecialchars($soapClient->debug_str, ENT_QUOTES) . '</b></p>';
} else {
$err = $soapClient->getError();
if ($err) {
echo '<p><b>Error: ' . $err . '</b></p>';
echo '<p><b>Request: <br>';
echo htmlspecialchars($soapClient->request, ENT_QUOTES) . '</b></p>';
echo '<p><b>Response: <br>';
echo htmlspecialchars($soapClient->response, ENT_QUOTES) . '</b></p>';
echo '<p><b>Debug: <br>';
echo htmlspecialchars($soapClient->debug_str, ENT_QUOTES) . '</b></p>';
} else {
print_r($result);
}
}
}

Thanks in Advance
Regards
Abdul Aziz

Last edited by azy777 : 02-04-2009 at 12:20 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Overcoming an error in the Webservice Sathish Kumar C# Programming 5 09-30-2008 03:53 AM
What is Webservice? can some one explain about the SOAP? senraj PHP Programming 2 12-06-2007 06:06 AM
why the "InvalidOperationException" error when returning array value in webservice? leoraja8 ASP and ASP.NET Programming 7 11-14-2007 09:39 PM
Error in webservice Sathish Kumar C# Programming 7 09-20-2007 03:55 AM
Webservice – Xml & Soap Karpagarajan XML and SOAP 1 08-31-2007 10:45 PM


All times are GMT -7. The time now is 04:29 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0