Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
A field in database at server-side is defined as ENUM. A row of database is returned via a web service including the field. I have to define a type for the returned result. In PHP, I use NuSoap for this purpose. I use addComplexType function. How this function should be called? With what parameters? How the definition of the type should be? I prefer the produced code with Visual Studio, after I update the web references, include an enumeration for the field instead of a simple string or integer.
I hope I could explain what I need good.

What I have tried:

I used to map it to string, but translation from string to enum and from enum back to string at client-side is an overhead.
Posted
Updated 2-Dec-17 21:04pm

1 solution

Here is an example of the method for creating a new type of enum:
$server->wsdl->addSimpleType('ServerStatus', 'xsd:string', 'SimpleType', 'struct',
    array(‎
        'Off',
        'Stopped',
        'Running'
    ));


Then, in Server structure the following line defines the server's status:
'Status' => array('name' => 'Status', 'type'=> 'tns:ServerStatus')

When web references are updated at client side, ServerStatus is translated to enum.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900