473,800 Members | 2,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error while developing touricoholidays webservice in PHP 5

4 New Member
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


Expand|Select|Wrap|Line Numbers
  1. <?php
  2. try{
  3.     class authentication_header 
  4.     {
  5.         private $username;
  6.         private $password;
  7.         private $culture;
  8.         private $version;
  9.  
  10.         public function __construct($username,$password,$culture,$version) 
  11.         {
  12.             $this->username=$username;
  13.             $this->password=$password;
  14.             $this->culture=$culture;
  15.             $this->version=$version;
  16.         }
  17.     }
  18.  
  19.     $wsdl = 'http://demo.touricoholidays.com/ws/HotelsService.asmx?WSDL';                  
  20.     $client = new SOAPClient($wsdl,array('trace'=> true));
  21.  
  22.     $parameter = array('sDestination' => 'NYC',
  23.                       'sHotelCityName' => '',
  24.                       'sHotelLocationName' => '',
  25.                       'sHotelName' => '',
  26.                       'dtCheckIn' => '2007-11-20',
  27.                       'dtCheckOut' => '2007-12-01',
  28.                       'roomsInformation' => $roominfo,
  29.                       'maxPrice' => 0,
  30.                       'starLevel' => 2,
  31.                       'fAvailableOnly' => 1);  
  32.  
  33.     $auth=new authentication_header('yanivy','111111','en_US','5.5');
  34.  
  35.     $authvalues=new SoapVar($auth,SOAP_ENC_OBJECT,'LoginHeader');
  36.  
  37.     $header=new SoapHeader("myURN","LoginHeader",$authvalues,false,"http://schemas.xmlsoap.org/soap/actor/next");
  38.  
  39.     $client->__call('SearchHotels', $parameter, null, $header);
  40. }
  41. catch(SOAPFault $f) 
  42. {
  43.     echo "<pre>";
  44.     print $f;
  45.     echo "</pre>";
  46. }
  47. ?>


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
Oct 18 '07 #1
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.
Oct 18 '07 #2
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]
Oct 18 '07 #3
jamesas
4 New Member
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
Oct 19 '07 #4
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.
Oct 19 '07 #5
jamesas
4 New Member
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
Oct 25 '07 #6
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.
Oct 25 '07 #7
jamesas
4 New Member
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));
Nov 12 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1882
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...
1
2112
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.
0
1126
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...
4
6215
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...
4
20489
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...
1
421
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
1
1743
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"...
0
1197
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" />
3
4429
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...
0
9691
marktang
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...
0
9551
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,...
0
10507
Oralloy
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...
0
10279
jinu1996
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...
0
10036
tracyyun
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...
1
7582
isladogs
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...
0
5473
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...
1
4150
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
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.