ggwebservices - call to external server from template

Author Message

Anaya P

Wednesday 15 December 2010 10:23:18 am

Hi there,

I have installed ggwebservices extension to consume external webservice in EZ Publish 4.3.

In debugger section, how can I check that I am able to connect to external server and get the methods of web service?Under Remote Servers section (in left column), remote server name is grayed out, it is not a link.

Below are the settings I have for remote server in wsproviders.ini.append.php

[trx]
providerType=PhpSOAP
providerUri=https://services.resx.com/xapi/v9.0/xapi.asmx
providerUsername=username provided by webservice provider
providerPassword=password provided by webservice provider

ProxyServer=proxyname:port

Location of wsproviders.ini.append.php file - settings/override

I do not understand what I am missing here?

Can you please advise?

Thanks

Anaya

Because of soapui I definitely know that SOAP request/response is sent ok.

Gaetano Giunta

Wednesday 15 December 2010 12:49:31 pm

I am sorry, but the debugger is currently (version 0.5) limited to debugging xmlrpc and jsonrpc services. That's why you see the name of your target server grayed out in the right column.

The next version, due for release before the end of the week, will support debugging ezjscore webservices too.

For soap debugging, you will most likely have to wait until version 0.7 or maybe even later...

Principal Consultant International Business
Member of the Community Project Board

Anaya P

Wednesday 15 December 2010 1:28:37 pm

Thanks for your quick reply.

But if I am not wrong I can call external soap web service in a template using this extension, right?

So i tried below fetch function to fetch one of the webservice methods -

{def $ws = fetch('wsdl path', 'method name', 'paramaters')}

{$ws.responseParameter}

in wsproviders.ini.append.php file

[trx]
providerType=PhpSOAP
providerUri=https://services.resx.com/xapi/v9.0/xapi.asmx
providerUsername=username provided by webservice provider
providerPassword=password provided by webservice provider

No wsdl specified in the wsproviders.ini.append.php

But this function is not returning anything?

Please let me know if I have missed anything here?

Thanks

Anaya

Gaetano Giunta

Thursday 16 December 2010 2:00:31 am

Yes, you can do what you want with this extension.

I think you have it slightly wrong: you should put the path to the wsdl in the ini file and the name of the operation in the template call.

[trx]
providerType=PhpSOAP
providerUri=
WSDL=https://services.resx.com/xapi/v9.0/xapi.asmx?WSDL
providerUsername=username provided by webservice provider
providerPassword=password provided by webservice provider

then

{def $ws = fetch('webservices', 'send', hash('server', 'trx', 'method', $method_name', 'paramaters', $params))}

Principal Consultant International Business
Member of the Community Project Board

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:52:20
Script start
Timing: Jan 18 2025 02:52:20
Module start 'layout'
Timing: Jan 18 2025 02:52:20
Module start 'content'
Timing: Jan 18 2025 02:52:21
Module end 'content'
Timing: Jan 18 2025 02:52:21
Script end

Main resources:

Total runtime1.2850 sec
Peak memory usage4,096.0000 KB
Database Queries61

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.1953152.6406
Module start 'layout' 0.00600.0032 741.835939.4844
Module start 'content' 0.00921.2744 781.3203559.4766
Module end 'content' 1.28360.0014 1,340.796912.1250
Script end 1.2850  1,352.9219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2680160.0002
Check MTime0.00140.1082160.0001
Mysql Total
Database connection0.00110.086810.0011
Mysqli_queries1.222095.0931610.0200
Looping result0.00070.0526590.0000
Template Total1.241896.620.6209
Template load0.00220.172220.0011
Template processing1.239596.460220.6198
Template load and register function0.00030.024810.0003
states
state_id_array0.00170.132610.0017
state_identifier_array0.00190.144520.0009
Override
Cache load0.00190.1482520.0000
Sytem overhead
Fetch class attribute can translate value0.00060.048920.0003
Fetch class attribute name0.00270.210650.0005
XML
Image XML parsing0.00120.094520.0006
class_abstraction
Instantiating content class attribute0.00000.001360.0000
General
dbfile0.00110.0868160.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 9

Time used to render debug report: 0.0001 secs