Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4550040
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:26:34+00:00 2026-05-21T16:26:34+00:00

I am new to the world of PHP and coding as those have helped

  • 0

I am new to the world of PHP and coding as those have helped me answer a number of questions I have posted know. I have the opportunity to jump into the deep end however seeing I have no clue about PHP and web services, I am seeking your help. I would appreciate it if you could point me in the right direction as I have not been able to find any examples nor detailed information regarding it.

Effectively there is a PHP page that needs to pass certain values to a .NET web service i.e. name, email, mobile number and upon the receipt of such information the web service sends out a text message. This is information I have so far

The Allocation service uses a basic HTTP binding and TransportWithMessageCredential security.

Sample C# code using a reference generated with Visual Studio tooling
Allocation.AllocationServiceV3Client Client = new Allocation.AllocationServiceV3Client();
Allocation.AllocateResult Result;
string VoucherCode;
DateTime ExpiryDate;
string DisplayMessageText;
Client.ClientCredentials.UserName.UserName = ? ;
Client.ClientCredentials.UserName.Password = ? ;
 Result = Client.AllocateToConsumerMobileAndSendSMS(out VoucherCode,
                                                               out ExpiryDate,
                                                               out DisplayMessageText,
                                                               ClientID,
                                                               ClientReference,
                                                               CampaignID,
                                                               ActivityID,
                                                               MobileNumber);
if (Result != Allocation.AllocateResult.Success)
{
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T16:26:35+00:00Added an answer on May 21, 2026 at 4:26 pm

    I have no clue about PHP and web services

    First things first, pick your brain up out of the C# soup and sit it out to dry off for a few hours. PHP is a simple language for simple things. If you’re new to it, you don’t want to try and make it do complex things, and you certainly don’t want to try writing C# style code in PHP.

    Let’s take "web services" as an example of a "complex" thing. In some circles, this means horribly designed monstrosities like SOAP. VS makes it relatively easy to build SOAP bindings to your existing classes, so it’s not a painful solution for you.

    SOAP is a very painful solution for PHP.

    Effectively there is a PHP page that needs to pass certain values to a .NET web service

    It sounds like you have an existing web service set up then, correct?

    You could try and use the built in SOAP client, but it’s an undebuggable and unconfigurable binary blob of horrors that will make you want to kill someone if it doesn’t work for you immediately.


    Edit: The section below was written incorrectly assuming that both sides were under your control. As this is not the case, you can disregard the rest of the answer. I’m leaving it up because it may be valuable to others.

    I would advise a different approach. Set up an endpoint (URL) in your .NET application that expects the data you’ve specified as POST values, and have PHP POST the data. This has the distinct advantage of being incredibly simple. Because you’re new to PHP, simple is a big win.

    (In other words, ditch the "web service" — or make a parallel copy if other things consume that service already.)

    PHP comes with a service called PEAR, a repository of helpful classes. You can use HTTP_Request2 to quickly build the HTTP POST request. Chances are that it’s already installed. If it isn’t, it’s easy to install either at the system level using the pear command, or locally in your project.

    Here’s some quick example code copied straight out of the reference guide:

    $request = new HTTP_Request2('http://www.example.com/your/endpoint/url.foo');
    $request->setMethod(HTTP_Request2::METHOD_POST)
        ->addPostParameter('name', '...')
        ->addPostParameter('email', '...')
        ->addPostParameter('mobile', '...');
    $response = $request->send();
    

    You can then read the response as needed.

    Now, this isn’t a perfect solution. Your C# code mentions a username and password, which I suppose could be included in the POST data. You could also use HTTP authentication (supported by HTTP_Request2) instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to the world of coding, PHP and object oriented programming. I
I am new to php and have coding experience in java and C. So
I'm new to C world (coming from PHP). I'm playing with strings (I know
I am new to php and am asking for some coding help. I have
I'm new to php world (actually not so much, but pretty much). I make
I'm new to PHP world, what I'm trying to do is to send 3
I'm self teaching myself to do MySQL and PHP. It is a new world
I am new to the world of coding and am having a hard time
I'm new to xpath and am running into troubles with PHP's ancient XPath implementation.
I'm new to django and am coming from the MAMP and PHP world. How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.