Forums / Extensions / ggwebservices - call to external server from template

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

eZ debug

Timing: Jan 29 2025 13:43:53
Script start
Timing: Jan 29 2025 13:43:53
Module start 'content'
Timing: Jan 29 2025 13:43:53
Module end 'content'
Timing: Jan 29 2025 13:43:53
Script end

Main resources:

Total runtime0.1727 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 588.0781180.8203
Module start 'content' 0.00610.0046 768.898498.5703
Module end 'content' 0.01080.1619 867.4688527.1094
Script end 0.1726  1,394.5781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00321.8783200.0002
Check MTime0.00130.7353200.0001
Mysql Total
Database connection0.00100.586510.0010
Mysqli_queries0.128774.51801410.0009
Looping result0.00130.74091390.0000
Template Total0.161693.610.1616
Template load0.00070.386210.0007
Template processing0.160993.161110.1609
Override
Cache load0.00040.255410.0004
Sytem overhead
Fetch class attribute can translate value0.00070.381510.0007
XML
Image XML parsing0.00030.163310.0003
General
dbfile0.00341.9740200.0002
String conversion0.00000.002330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs