create a new web service function

Asked by fengqiang@mwi.com.sg

I am trying to create a new web service function, just follow everything for GetFile, I create everyting for a new service, getDeploy and create the following in the service.wsdl file
<message name="GetDeployRequest">
        <part name="serverKey" type="xsd:string" />
        <part name="hardwareKey" type="xsd:string" />
        <part name="version" type="xsd:string" />
    </message>
    <message name="GetDeployResponse">
        <part name="file" type="xsd:base64Binary" />
    </message>
....
 <operation name="GetDeploy">
            <documentation>Gets the deployment requested</documentation>
            <input message="tns:GetDeployRequest"/>
            <output message="tns:GetDeployResponse"/>
     </operation>
...
<operation name="GetDeploy">
            <soap:operation soapAction="urn:xmds#GetDeploy" 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>
...
 And I create the method in XMDSoap class:
 function GetDeploy($serverKey, $hardwareKey, $version)
    {
         Debug::logMessage("GetDeployment:***************************");
          // Return the Chunk size specified
          return null;
    }

It seems that I created everything correct, however, when I test using soapSonar, server process never come into this function, all existing function can get through.

Is there any other place I have to change in addition to these place?
...

Question information

Language:
English Edit question
Status:
Answered
For:
Xibo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Alex Harrington (alexharrington) said :
#1

There's some code in xmds.php to tell the service which code to execute for each webservice function.

You need to hook that.

Alex

This email carries a disclaimer, a copy of which may be read at http://learning.longhill.org.uk/disclaimer

Revision history for this message
fengqiang@mwi.com.sg (fengqiang) said :
#2

Hi Alex,

Thanks for your reply, in fact in xmds.php only got two lines of code, I didn't see the hook up in code services.php or xmds.inc.php.

is the hookup in database?

Best Regards
Feng Qiang

Revision history for this message
fengqiang@mwi.com.sg (fengqiang) said :
#3

Hi Alex,

Thanks for your reply, in fact in xmds.php only got two lines of code, I didn't see the hook up in code services.php or xmds.inc.php.

is the hookup in database?

Best Regards
Feng Qiang

Revision history for this message
Alex Harrington (alexharrington) said :
#4

Which blueprint are you working on? I don't recognise the method name you're talking about?

Alex

This email carries a disclaimer, a copy of which may be read at http://learning.longhill.org.uk/disclaimer

Revision history for this message
fengqiang@mwi.com.sg (fengqiang) said :
#5

I am working on server Version 1.2.0-rc1

Thanks

Revision history for this message
Alex Harrington (alexharrington) said :
#6

Sorry. I meant which of the project goals are you working on:
https://blueprints.launchpad.net/xibo

Or is this in a private version of Xibo you're developing for yourself? If it is, please be aware of the terms of the license and make sure that you or your company are distributing the changes to the source code you're making to your end users as is required.

Alex

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

There is nothing extra in services.php for adding a new method - the service
is registered with php-soap and that handles mapping requests to methods
(from the WSDL).

If your function never gets called I would imagine that the WSDL is not
correct - have you manually requested it and confirmed its contents?

Perhaps, as Alex suggests, if you contribute your code back to the project
and detail what you are working on in the blueprints section we could be of
greater assistance.

Revision history for this message
fengqiang@mwi.com.sg (fengqiang) said :
#8

Hello Alex and Dan,

Thanks for your reply, we are evaluating this product and will used for a small deployment if everything is OK. We will strictly follow the terms of license and publish the source code, and if it is useful, will contribute to your project.

for the WSDL, i manually changed in eclipse, however, seems that from soapsonar, I can see the service function and can send the request as other service. however, in the services.php. only can pass

 $soap = new SoapServer($serviceLocation . '?wsdl');
 $soap->setClass('XMDSSoap');

cannot pass:
                $soap->handle();
it does not go to the service function. I will re-look at the WSDL

Best Regards
Feng Qiang

Revision history for this message
fengqiang@mwi.com.sg (fengqiang) said :
#9

Hello Alex and Dan,

Thanks for your reply, we are evaluating this product and will used for a small deployment if everything is OK. We will strictly follow the terms of license and publish the source code, and if it is useful, will contribute to your project.

for the WSDL, i manually changed in eclipse, however, seems that from soapsonar, I can see the service function and can send the request as other service. however, in the services.php. only can pass

 $soap = new SoapServer($serviceLocation . '?wsdl');
 $soap->setClass('XMDSSoap');

cannot pass:
                $soap->handle();
it does not go to the service function. I will re-look at the WSDL

Best Regards
Feng Qiang

Can you help with this problem?

Provide an answer of your own, or ask fengqiang@mwi.com.sg for more information if necessary.

To post a message you must log in.