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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:53:34+00:00 2026-05-28T05:53:34+00:00

I am building a web service using the Zend Framework. I am using the

  • 0

I am building a web service using the Zend Framework. I am using the Zend_Soap_AutoDiscover class for the generation of my WSDL. I am using various complex type in this web service form example:

StockItemEntity Class

class StockItemEntity {
    /** @var string */
    public $sStockCode;
    /** @var string */
    public $sQty;

    public function __construct($sStockCode, $sQty){
        $this->sStockCode = $sStockCode;
        $this->sQty = $sQty;
    }   
}

WSDL Definition

<xsd:complexType name="StockItemEntity">
  <xsd:all>
    <xsd:element name="sStockCode" type="xsd:string" nillable="true"/>
    <xsd:element name="sQty" type="xsd:string" nillable="true"/>
  </xsd:all>
</xsd:complexType>

From what I understood from reading over the web the nillable=”true” is there because properties of any object can be set to null. Thus the nillable=”true” is need to maintain a valid XML document even if the StockItemEntity object has all its properties set to null.

My concern is that those two properties must always be passed to the web method. Is it possible to remove the “nillable=true” to sort of force the properties not to be null? Or else is there any way to force non null values in those properties. I was hoping to avoid having to validate them on the webservice side.

Thanks

Kind Regards

Gabriel

  • 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-28T05:53:35+00:00Added an answer on May 28, 2026 at 5:53 am

    At some stage between Zend Framework 1.10.7 and 1.11.0, they introduced a piece of code that uses reflection to check if there’s a default value defined for an attribute of a class and, if not, it decides that the class is “nillable” and adds nillable=”True” to the attribute definition in the WSDL. This is apparently meant to improve interoperability with some flaky version of .Net.

    To stop Zend Framework from adding the nillable flag, just initialize those properties when they are declared, eg.

    /** @var string */
    public $sStockCode = '';
    /** @var string */
    public $sQty = '';
    

    Hope that helps.

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

Sidebar

Related Questions

I am working on building a web service (using c#) and this web service
I am building a Web service using WCF as a way to provide access
I'm building a traditional ASP.NET Web Service -- the style built using asmx. It's
I am building a small website for fun/learning using a fairly standard Web/Service/Data Access
I' am building some RSS web service in ASP.net (using IIS as the web
I'm building a MVC web application (using the Spring MVC framework), and I'm a
I am building a web service using php core SOAP classes, and need to
I'm building a RESTful web service using Jersey that relies on MongoDB for persistence.
I am building a web service API, using JSON as the data language. Designing
I'm building this client for a web service. Pretty much everything makes requests to

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.