I am wrote the coding for PHP 5 to access tourico holidays webservice. as follows.But it returns the error followed by the code .please help me - <?php
-
try{
-
class authentication_header
-
{
-
private $username;
-
private $password;
-
private $culture;
-
private $version;
-
-
public function __construct($username,$password,$culture,$version)
-
{
-
$this->username=$username;
-
$this->password=$password;
-
$this->culture=$culture;
-
$this->version=$version;
-
}
-
}
-
-
$wsdl = 'http://demo.touricoholidays.com/ws/HotelsService.asmx?WSDL';
-
$client = new SOAPClient($wsdl,array('trace'=> true));
-
-
$parameter = array('sDestination' => 'NYC',
-
'sHotelCityName' => '',
-
'sHotelLocationName' => '',
-
'sHotelName' => '',
-
'dtCheckIn' => '2007-11-20',
-
'dtCheckOut' => '2007-12-01',
-
'roomsInformation' => $roominfo,
-
'maxPrice' => 0,
-
'starLevel' => 2,
-
'fAvailableOnly' => 1);
-
-
$auth=new authentication_header('yanivy','111111','en_US','5.5');
-
-
$authvalues=new SoapVar($auth,SOAP_ENC_OBJECT,'LoginHeader');
-
-
$header=new SoapHeader("myURN","LoginHeader",$authvalues,false,"http://schemas.xmlsoap.org/soap/actor/next");
-
-
$client->__call('SearchHotels', $parameter, null, $header);
-
}
-
catch(SOAPFault $f)
-
{
-
echo "<pre>";
-
print $f;
-
echo "</pre>";
-
}
-
?>
Error:
-----------------------------------------------------------------------
SoapFault exception: [soap:Server] System.Web.Serv ices.Protocols. SoapException: Server was unable to process request. ---> TravelService.C ustomException. LoginFailedExce ption: Login failed. Check username and password.
at TravelService.B aseAuthService. ValidateLoginHe ader(LoginHeade r loginHeader, Boolean isCultureMandat ory, Boolean isVersionMandat ory, Boolean isAmendment)
at TravelService.B aseAuthService. Authenticate(Bo olean isCultureMandat ory, Boolean isVersionMandat ory, Boolean isAmendment)
at TravelService.B aseAuthService. Authenticate()
at TravelService.H otelsService.Se archHotels(Stri ng sDestination, String sHotelCityName, String sHotelLocationN ame, String sHotelName, DateTime dtCheckIn, DateTime dtCheckOut, RoomInfo[] roomsInformatio n, Decimal maxPrice, Decimal starLevel, Boolean fAvailableOnly)
--- End of inner exception stack trace --- in F:\xampp\htdocs \ico\mydemo2.ph p:39
Stack trace:
#0 F:\xampp\htdocs \ico\mydemo2.ph p(39): SoapClient->__call('Search Hotels', Array, NULL, Object(SoapHead er))
#1 {main}
-------------------------------------------------
Please Help me to solve the error
7 2931 Motoma 3,237
Recognized Expert Specialist
Well, it says you used a bad username/password combination. Check your username and password first, and if those are correct, check the documentation for the web service to ensure that you are properly giving them to the service.
pbmods 5,821
Recognized Expert Expert
Heya, James. Welcome to TSDN!
Please use CODE tags when posting source code:
[CODE=php]
PHP code goes here.
[/CODE]
Well, it says you used a bad username/password combination. Check your username and password first, and if those are correct, check the documentation for the web service to ensure that you are properly giving them to the service.
Hai Motoma,
I checked the username and password in PHP 4 it working properly
Motoma 3,237
Recognized Expert Specialist
Hai Motoma,
I checked the username and password in PHP 4 it working properly
The web service says otherwise: either you have the wrong username and password, or you have supplied them to the service incorrectly.
The web service says otherwise: either you have the wrong username and password, or you have supplied them to the service incorrectly.
hai,
now im corrected my script and it working properly now
Motoma 3,237
Recognized Expert Specialist
hai,
now im corrected my script and it working properly now
Care to elaborate on what the problem was? This will help others who have similar problems and see this thread.
Care to elaborate on what the problem was? This will help others who have similar problems and see this thread.
THIS is the sample header to pass to web service
$client = new SoapClient("htt p://demo.touricohol idays.com/ws/HotelsService.a smx?WSDL", array("trace" => true, "exceptions " => true, 'soap_version' => SOAP_1_1));
$x["username"]="";
$x["password"]="";
$x["culture"]="en_US";
$x["version"]='4.5';
$header=new SoapHeader('htt p://tourico.com/webservices/','LoginHeader' , $x);
$client->__setSoapHeade rs(array($heade r));
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Tom Leylan |
last post by:
I'd like to find/have a discussion about the various ways an application
server could be implemented. So the upsides and downsides can be discussed.
In case I'm using the term wrong by "app server" I mean a centralized
"business information service" that could be readily accessed by client
software. Initially this would be on a LAN but (like everything) the
requirements would likely grow to permitting general Internet access.
It...
|
by: Nalaka |
last post by:
Hi,
I am testing with Visual studio 2005, web projects.
Situation:
I have one solution with two web projects, created as file system projects.
(I am tesing using the built in server, not IIS)
First project is a webService.
Second consumes the webservices by the first.
|
by: Helios |
last post by:
Hello there,
I'm new to webservices and have trouble getting started. I've got to
develope a webservice which receives messages and in response to each message
sends a response back. The webservice has to conform to a given wsdl provided
to me. I've searched different articles and found many of them describing how
to use a wsdl to consume a webservice by generating proxy classes but not one
about how do i built a webservice which...
|
by: jf li |
last post by:
I have a Asp.net web application and a Asp.net Web service application. The
Web application is using HtmlInputFile to get a 50M size of file selected by
end user, read the data of this file and pass the data to the web service. I
already modified both web.config files and changed maxRequestLength to
60000(kb). When I debug the upload process, it seems the Web application can
get the 50M file and read the data without problem, but when the...
|
by: Matthew.DelVecchio |
last post by:
hello,
i am developing an ASP.NET web app that consumes a 3rd party vendor
webservice. it is my first one so while ive done my homework, im not an
expert on the matter.
our partner's webservice operates on SSL via an "https://" url. they
also gave me a .PFX certificate which ive installed via window's MMC
utility, into the "Computer account"'s Personal store; as indicated by
articles id found. i then export a .CER to the filesystem...
| |
by: Nick Gilbert |
last post by:
Hi,
I'm developing a webservice that will accept an Order and forward it to
a backend system, but I'm having a problem with transferring my "Order"
class over a webservice.
When I try and call the webservice and pass it an Order, I get the
following error message:
The type Wright.BusinessLogicLayer.OrderLine was not expected. Use the
|
by: mike |
last post by:
I have a WebApplication which is consuming a WebService.
Basically the problem I am facing is such that everything is working fine
when I am developing on my local machine. Then I do "Copy Project" from
withing the VS2003 to copy the project to a shared webserver. My project
references some web services. Upto here everything is withing our firewall.
Then in order to deploy it to the customer we upload those files from the
"Deployed"...
|
by: CAIBird |
last post by:
hi,
i've been developing a webservice on machine A and one WebMethod of this
webservice will connect to SQL Server2000 on machine B using a connect string
defined in Web.config as below:
<add key="sqlDbConn.ConnectionString" value="workstation
id="172.23.171.226";packet size=4096;integrated security=SSPI;data
source=172.23.171.226;persist security info=False;initial
catalog=RVLabeling_Joe" />
|
by: Lance Wynn |
last post by:
Hello,
I am receiving this error when trying to instantiate a webservice component.
I have 2 development machines, both are XP sp2 with VS 2008 installed. On
one machine, the code works fine. On the other machine I get the error upon
instantiating the service client. I add the reference by choosing Add
Service Reference from the project menu, and pointing to the remote wsdl
file. I can't seem to find what the difference between the two...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |