473,508 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to create simple SOAP request using PHP?

4 New Member
Hello,

I tried to create a SOAP request but could not succeed.
SOAP WADL url is http://www.mobipost.com.au/httpapi/Messaging.asmx?WSDL

AND request should be like:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  3.   <soap:Header>
  4.     <AuthenticationHeader xmlns="http://messaging.mobipostapi.thirdscreen.com.au/">
  5.       <UserName>SAMPLE_USER</UserName>
  6.       <Password>SAMPLE_PASS</Password>
  7.     </AuthenticationHeader>
  8.   </soap:Header>
  9.   <soap:Body>
  10.     <SendSMSToContacts xmlns="http://messaging.mobipostapi.thirdscreen.com.au/">
  11.       <oSMS>
  12.         <MessageText>THIS IS MESSAGE</MessageText>
  13.       </oSMS>
  14.       <ContactIDs>
  15.         <int>123456789</int>
  16.         <int>987654321</int>
  17.       </ContactIDs>
  18.     </SendSMSToContacts>
  19.   </soap:Body>
  20. </soap:Envelope>
  21.  

I tried:

Expand|Select|Wrap|Line Numbers
  1. $url = 'http://www.mobipost.com.au/httpapi/Messaging.asmx?WSDL';
  2. $client = new SoapClient($url);
  3. $result = $client->AuthenticationHeader(array('UserName' => 'SAMPLE_USER','Password' => 'SAMPLE_PASS'));
  4. $result = $client->SendSMSToContacts(array('MessageText' => 'THIS IS MESSAGE'));
  5. $result = $client->ContactIDs(array('123456789', '987654321'));
  6.  
But it shows Error:
Expand|Select|Wrap|Line Numbers
  1. Fatal error: Uncaught SoapFault exception: [Client] Function ("AuthenticationHeader") is not a valid method for this service in D:\xampp\htdocs\globalmobile\send_message_v2.php:26 Stack trace: #0 D:\xampp\htdocs\globalmobile\send_message_v2.php(26): SoapClient->__call('AuthenticationH...', Array) #1 D:\xampp\htdocs\globalmobile\send_message_v2.php(26): SoapClient->AuthenticationHeader(Array) #2 {main} thrown in D:\xampp\htdocs\globalmobile\send_message_v2.php on line 26
  2.  

Can you please help me to create valid SOAP request to communicate with WSDL server?


Thank you in advance.
May 8 '13 #1
1 15329
Luuk
1,047 Recognized Expert Top Contributor
There are some examples on the bottom of this page:
http://nl1.php.net/manual/en/soapheader.soapheader.php
May 12 '13 #2

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

Similar topics

1
13826
by: The Grand Admiral | last post by:
Question. I have a wsdl soap request structure as follows: <soap:Envelope xmlns:xsi="..." xmlns:xsd="..." xmlns:soap="..."> <soap:Header>... </soap:Header> <soap:Body> <SaveItem xmlns="...">...
0
3689
by: ramas | last post by:
Hi, I am new to PHP scripting and i am trying to connect to a soap server (as mentioned below) using the SOAP extension comesup with PHP. Now my requirement is to add my HTTP header fields along...
0
1832
by: nitin via DotNetMonster.com | last post by:
Hi I had developed a VB.NET desktop client application which act as a SOAP client. To invoke the web service method I am using MSSOAP(2.0)'s low level interfaces. i.e SoapSerializer,SoapReader and...
0
2926
by: Amar | last post by:
I am recieving the "The root element is missing" error from my soap extension while attempting to validate an incoming SOAP message request. I suspect the problem resides in the ChainStream method...
0
1445
by: bhu | last post by:
I have a simple helloworld web service , when i call this service from the client this is the message sent. -----SoapRequest at 6/7/2006 10:18:11 PM <?xml version="1.0"...
2
4210
by: Sasquatch | last post by:
I'm having trouble creating a simple login page using the asp:login control. I followed some instructions in a WROX book, "Beginning ASP.NET 2.0," and the instructions are very straight forward,...
4
5305
by: yoram.ayalon | last post by:
Hi, I need to create a multipart request to UPS manifest upload electronic service. UPS wants the request to consist of a series of headers and bodies, and its not clear how can I use the...
17
56574
by: vlsw | last post by:
I am new to soap and web services. I want to send an xml soap request to an existing web service created by outside party. how do i go about doing this and viewing the response. any help would be...
4
6837
HaLo2FrEeEk
by: HaLo2FrEeEk | last post by:
Why is it so difficult?!? Ok, Bungie has created an API for their new game, Halo Reach. The API allows you to access details stats and information about the game. There are two endpoints, JSON...
0
7114
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...
1
7034
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5045
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...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1544
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 ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.