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

  • Home
  • SEARCH
  • 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 6364905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:13:29+00:00 2026-05-25T00:13:29+00:00

I’m trying to create a PHP soap server based on a WSDL I was

  • 0

I’m trying to create a PHP soap server based on a WSDL I was given to modify for our purposes. The problem is coming in the form of the WSDL file, I think. When I bring it up to test it here: http://www.validwsdl.com/, the response dies out and tells me that the function isn’t present.

The idea is that the expected input is 4 items, those 4 items will be put into the function, used, and 4 other items will be returned. I cut out everything but the return in my sample here, but the idea should still work.

This is my PHP code:

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


function GetInventoryStatus($request) {
$dealerBranch = 1;//default branch to 1
$inStock = 0;//default in stock to 0
$cantTrack = 0; //used to check if branch is tracked
$estDeliveryTime = "";
$estDeliveryDate = "";
$deliveryLocation = "";


  return array(
          'InStock' => $inStock,
          'EstDeliveryDate' =>$estDeliveryDate,
          'EstDeliveryTime'=> $estDeliveryTime,
          'DeliveryLocation' => $dealerBranch
          );

}

And this is my wsdl file:

<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.elennox.net/server1.php/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://www.elennox.net/server1.php" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">  
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://www.elennox.net/server1.php">
      <s:element name="GetInventoryStatus">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="DealerCode" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="SupplierCode" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="PartNumber" type="s:string" />
            <s:element minOccurs="1" maxOccurs="1" name="Quantity" type="s:int" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="GetInventoryStatusResponse">       
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="InStock" type="s:int" />
            <s:element minOccurs="0" maxOccurs="1" name="EstDeliveryDate" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="EstDeliveryTime" type="s:string" />
            <s:element minOccurs="1" maxOccurs="1" name="DeliveryLocation" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
  </s:schema>
</wsdl:types>  
  <wsdl:message name="InventoryRequestRequest">
    <wsdl:part name="parameters" element="tns:GetInventoryStatus" />
  </wsdl:message>
  <wsdl:message name="InventoryRequestResponse">
    <wsdl:part name="parameters" element="tns:GetInventoryStatusResponse" />
  </wsdl:message>  
  <wsdl:portType name="InventoryStatusPortType">
    <wsdl:operation name="InventoryRequest">
      <wsdl:input message="tns:InventoryRequestRequest" />
      <wsdl:output message="tns:InventoryRequestResponse" />
    </wsdl:operation>
  </wsdl:portType>  
  <wsdl:binding name="InventoryStatusBinding" type="tns:InventoryStatusPortType">
    <soap:binding style='rpc' transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="InventoryRequest">
      <soap:operation soapAction="http://www.elennox.net/server1.php#InventoryStatus" style="document" />
      <wsdl:input>
        <soap:body use="literal" namespace="urn:InventoryStatus"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" namespace="urn:InventoryStatus"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>  
  <wsdl:service name="InventoryStatus">
    <wsdl:port name="InventoryStatusPort" binding="tns:InventoryStatusBinding">
      <soap:address location="http://www.elennox.net/server1.php" />
    </wsdl:port>
  </wsdl:service>      
</wsdl:definitions>

I’m quite new to this web services in general, and I’m having a heck of a time with this. Any tips or help would be greatly appreciated. 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-25T00:13:30+00:00Added an answer on May 25, 2026 at 12:13 am

    As @ghostJago noted, you should use use “document” style not “rpc” (“document/literal” is the preffered style).

    But also watch your namespaces (I see you use urn:InventoryStatus and http://www.elennox.net/server1.php. Which one is it?).

    I think something like this is what your are looking for:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <wsdl:definitions 
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:s="http://www.w3.org/2001/XMLSchema" 
        targetNamespace="http://www.elennox.net/server1.php"
        xmlns:tns="http://www.elennox.net/server1.php" 
        name="InventoryStatusService">
    
        <wsdl:types>
            <s:schema elementFormDefault="qualified" targetNamespace="http://www.elennox.net/server1.php">
                <s:element name="GetInventoryStatus">
                    <s:complexType>
                        <s:sequence>
                            <s:element minOccurs="0" maxOccurs="1" name="DealerCode" type="s:string" />
                            <s:element minOccurs="0" maxOccurs="1" name="SupplierCode" type="s:string" />
                            <s:element minOccurs="0" maxOccurs="1" name="PartNumber" type="s:string" />
                            <s:element minOccurs="1" maxOccurs="1" name="Quantity" type="s:int" />
                        </s:sequence>
                    </s:complexType>
                </s:element>
                <s:element name="GetInventoryStatusResponse">
                    <s:complexType>
                        <s:sequence>
                            <s:element minOccurs="0" maxOccurs="1" name="InStock" type="s:int" />
                            <s:element minOccurs="0" maxOccurs="1" name="EstDeliveryDate" type="s:string" />
                            <s:element minOccurs="0" maxOccurs="1" name="EstDeliveryTime" type="s:string" />
                            <s:element minOccurs="1" maxOccurs="1" name="DeliveryLocation" type="s:string" />
                        </s:sequence>
                    </s:complexType>
                </s:element>
            </s:schema>
        </wsdl:types>
        <wsdl:message name="InventoryRequestRequest">
            <wsdl:part name="parameters" element="tns:GetInventoryStatus" />
        </wsdl:message>
        <wsdl:message name="InventoryRequestResponse">
            <wsdl:part name="parameters" element="tns:GetInventoryStatusResponse" />
        </wsdl:message>
        <wsdl:portType name="InventoryStatusPortType">
            <wsdl:operation name="InventoryRequest">
                <wsdl:input message="tns:InventoryRequestRequest" />
                <wsdl:output message="tns:InventoryRequestResponse" />
            </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="InventoryStatusBinding" type="tns:InventoryStatusPortType">
            <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
            <wsdl:operation name="InventoryRequest">
                <soap:operation soapAction="http://www.elennox.net/server1.php#InventoryStatus" style="document" />
                <wsdl:input>
                    <soap:body use="literal" />
                </wsdl:input>
                <wsdl:output>
                    <soap:body use="literal" />
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="InventoryStatus">
            <wsdl:port name="InventoryStatusPort" binding="tns:InventoryStatusBinding">
                <soap:address location="http://www.elennox.net/server1.php" />
            </wsdl:port>
        </wsdl:service>
    </wsdl:definitions>
    

    This will produce the following request/response:

    <soapenv:Envelope 
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
        xmlns:ser="http://www.elennox.net/server1.php">
       <soapenv:Body>
          <ser:GetInventoryStatus>
             <!--Optional:-->
             <ser:DealerCode>...</ser:DealerCode>
             <!--Optional:-->
             <ser:SupplierCode>...</ser:SupplierCode>
             <!--Optional:-->
             <ser:PartNumber>...</ser:PartNumber>
             <ser:Quantity>...</ser:Quantity>
          </ser:GetInventoryStatus>
       </soapenv:Body>
    </soapenv:Envelope>
    
    <soapenv:Envelope 
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
        xmlns:ser="http://www.elennox.net/server1.php">
       <soapenv:Body>
          <ser:GetInventoryStatusResponse>
             <!--Optional:-->
             <ser:InStock>...</ser:InStock>
             <!--Optional:-->
             <ser:EstDeliveryDate>...</ser:EstDeliveryDate>
             <!--Optional:-->
             <ser:EstDeliveryTime>...</ser:EstDeliveryTime>
             <ser:DeliveryLocation>...</ser:DeliveryLocation>
          </ser:GetInventoryStatusResponse>
       </soapenv:Body>
    </soapenv:Envelope>
    

    Also, it is good etiquette 😀 to declare faults to your operations (which will contain details in case something goes wrong).

    Good luck!

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

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I am currently running into a problem where an element is coming back from
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.