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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:31:21+00:00 2026-05-30T13:31:21+00:00

I am trying to create a web service with PHP. The following is my

  • 0

I am trying to create a web service with PHP. The following is my code –

Web Server –

require 'inventory_functions.php';

ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
$server = new SoapServer("inventory.wsdl");
$server->addFunction("getItemCount");
$server->handle();

Inventory_functions.php –

function getItemCount($upc){
    //in reality, this data would be coming from a database
    $items = array('12345'=>5,'19283'=>100,'23489'=>'234');
    return $items[$upc];
}

My Client Test –

ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
$client = new SoapClient("http://www.xxx.co.uk/service/inventory.wsdl");
$return = $client->getItemName('12345');
print_r($return);

When I run this everythign is OK. the number “5” will output in my browser. WhatI really need is some help in how to go about sending data via XML to the SOAP server, from their I will add this data to MySQL.

How would I send the XML vie the client test?

Thanks

  • 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-30T13:31:22+00:00Added an answer on May 30, 2026 at 1:31 pm

    I’m not sure I understand your question. You want to know what XML input you should give your web-service in order to send for instance the value “5”?

    In order to do that you should first analyse the wsdl file that is generated, then, depending on your programming language of choice for the client, you may generate a client Stub to interact with the Web-Service itself.

    Alternatively, you may issue an HTTP POST with the XML directly to the web-service (should look something like this):

    POST /service/mywebservice.php HTTP/1.1
    Host: www.xxx.co.uk
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "<your.webservice.namespace>/getItemCount"
    
    <?xml version="1.0" encoding="utf-8"?>
    <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/">
      <soap:Body>
        <getItemCount xmlns="<your.webservice.namespace>">
          <value>5</value>
        </getItemCount>
      </soap:Body>
    </soap:Envelope>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a php web service using nusoap lib. My code
I'm trying to consume the following web service http://ipinfodb.com/ip_location_api.php this web service returns an
We are trying to create a web-service that we plan to pass a variable
I've been trying to create a stable web service application for the last 2-3
I'm trying to create a small web service to convert PDF files to a
I'm trying to create a soap connection to Magento's web services, however I'm getting
I'm trying to create web service with message security. Here is a config: <system.serviceModel>
I am trying to create a web service client using RAD 7.5 using JAX-WS
I'm trying to create a simple web Service in the 4.0 framework, but the
I am trying to create a new web application in Web service. I am

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.