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 7039293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:46:48+00:00 2026-05-28T01:46:48+00:00

Despite being a PHP developer for a while, I’m just now getting my first

  • 0

Despite being a PHP developer for a while, I’m just now getting my first taste of web services. I was hoping to get a little help, as the book I am using is not much help. One of the companies we are doing business with gave me an XML document in the format in needs to be in (I’ll post a chunk of it). Due to my inexperience in this particular subject, I’m not really sure what to do. I need to know how to send this message to their live POST page, how to receive the response, and do I need to create any sort of WSDL page? Any help or direction would be so greatly appreciated, and please, don’t just send a link to the php manual. I’ve obviously been there, as it is typically the go-to place for help.

POST /sample/order.asmx HTTP/1.1
Host: orders.sample.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthenticationHeader xmlns="http://sample/">
      <Username>string</Username>
      <Password>string</Password>
    </AuthenticationHeader>
    <DebugHeader xmlns="http://sample/">
      <Debug>boolean</Debug>
      <Request>string</Request>
    </DebugHeader>
  </soap12:Header>
  <soap12:Body>
    <AddOrder xmlns="http://sample/">
      <order>
        <Header>
          <ID>string</ID>
          <EntryDate>dateTime</EntryDate>
          <OrderEntryView>
            <SeqID>int</SeqID>
            <Description>string</Description>
          </OrderEntryView>
          <ReferenceNumber>string</ReferenceNumber>
          <PONumber>string</PONumber>
          <Comments>string</Comments>
          <IpAddress>string</IpAddress>
        </Header>
      </order>
    </AddOrder>
  </soap12:Body>
</soap12:Envelope>

Above is the AddOrder XML document I was given (I removed most of the body). Please let me know if anymore detail is needed, as I want to be specific as possible so I’m able to figure out how send this

  • 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-28T01:46:48+00:00Added an answer on May 28, 2026 at 1:46 am

    You have a couple of options! You could use soap objects to create the request which, based upon a WSDL will know the correct way to talk to the remote server. You can see how to do this at the PHP manual.

    Alternatively, you can use CURL to do the work. You’ll need to know where to post the data to (which it looks like is in the example above), then you can just do something like this:

    $curlData = "<?xml version="1.0" encoding="utf-8"?>... etc";
    $url='http://wherever.com/service/';
    $curl = curl_init();
    
    curl_setopt ($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl,CURLOPT_TIMEOUT,120);
    curl_setopt($curl,CURLOPT_ENCODING,'gzip');
    
    curl_setopt($curl,CURLOPT_HTTPHEADER,array (
        'SOAPAction:""',
        'Content-Type: text/xml; charset=utf-8',
    ));
    
    curl_setopt ($curl, CURLOPT_POST, 1);
    curl_setopt ($curl, CURLOPT_POSTFIELDS, $curlData);
    
    $result = curl_exec($curl);
    curl_close ($curl);
    

    You then should have the result in the $result var. You can then try to convert it to an XML doc, although sometimes I’ve found due to encoding this doesn’t work:

    $xml = new SimpleXMLElement($result);
    print_r($xml);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First let me state that, despite being a fairly new practitioner of TDD, I'm
Despite primarily being a windows user, I am a huge fan of rsync. Now,
Despite being in the /public directory, if I visit http://site.example.com/favicon.ico I get the 404
This has been bugging me for awhile now. In a deployed PHP web application
<?=include(inc/c.php)?> Spits out 1 despite it being full of strings and no echo.
Despite this being one of the best error messages I've ever seen (second only
When running the below code a type is never returned, despite there being a
Despite enabling WSE 3.0 on client projects in Visual Studio 2005, web references I
Despite using PHP for years, I've never really learnt how to use expressions to
I'm working on a messy PHP page by another developer and I was analyzing

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.