the value of parameter add in php web service function is null

Asked by waertf

I wan to add a new parameter to the file,xmdssoap.class.php, in funtion ,RegisterDisplay.
like
public function RegisterDisplay($serverKey, $hardwareKey, $displayName,$version)
to
public function RegisterDisplay($serverKey, $hardwareKey, $displayName,$version,$test)

And the c# client have pass a string to new parameter.
After check the value of $test pass by, figure out it value is always null.
Did anyone encounter the issue and solve this?

Thank you

Question information

Language:
English Edit question
Status:
Solved
For:
Xibo Edit question
Assignee:
No assignee Edit question
Solved by:
Dan Garner
Solved:
Last query:
Last reply:
Revision history for this message
Dan Garner (dangarner) said :
#1

You will need to also regenerate the WSDL file, and tell Visual Studio (if you are using the windows client) to regenerate its XMDS class based on the new WSDL.

Revision history for this message
waertf (waertf-register) said :
#2

I only add a line to service.wsdl
=====================================
<message name="RegisterDisplayRequest">
        <part name="serverKey" type="xsd:string" />
        <part name="hardwareKey" type="xsd:string" />
        <part name="displayName" type="xsd:string" />
        <part name="version" type="xsd:string" />
        <part name="test" type="xsd:string" />
   </message>
====================================
and regenerate xmds by wsdl location on server

but still get null value from $test

Revision history for this message
Dan Garner (dangarner) said :
#3

Its hard to understand why that doesnt work... how are you determining that the variable is NULL?

You could try logging it and seeing if its null right at the beginning of the method?

Debug::LogEntry($db, 'error', 'Test: ' . $test);

Revision history for this message
waertf (waertf-register) said :
#4

Because I tried to force server function ,RegisterDisplay , to return null and get the same issue information
Here is my develop environment below:
Client/Server application install in the same machine
xibo version:1.2.1.1

Revision history for this message
waertf (waertf-register) said :
#5

By the way , after add new function in web service and call it.
I get the error information in client side,"Client found response content type of 'text/html', but expected 'text/xml'".
source code below:

#xmdssoap.class.php
public function getTerm($term)
    {

        $active = 'Display is awaiting licensing approval from an Administrator.';

        return $active;
    }

#service.wsdl
<message name="getTermRequest">
          <part name="term" type="xsd:string"/>
        </message>

        <message name="getTermResponse">
          <part name="value" type="xsd:string"/>
        </message>

<portType name="xmdsPortType">
<operation name="getTerm">
    <input message="tns:getTermRequest"/>
    <output message="tns:getTermResponse"/>
  </operation>
    </portType>

<binding name="xmdsBinding" type="tns:xmdsPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getTerm">
     <soap:operation soapAction="urn:xmds#getTerm" style="rpc"/>
     <input><soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
     <output><soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
  </operation>
    </binding>

Revision history for this message
Best Dan Garner (dangarner) said :
#6

What are you actually trying to do?

Some of the changes you are making is breaking the WSDL generation, or breaking the SOAP service. I recommend downloading a tool to test SOAP services, and using that tool to work out what is happening.

Revision history for this message
waertf (waertf-register) said :
#7

Thanks Dan Garner, that solved my question.