WebServices: Access denied for SOAP Operation

Any issue about installation and configuration of the Cyclos software

Moderators: hugo, alexandre, rmvanarkel

Post Reply
cycloshost
Posts: 578
Joined: Mon Jan 30, 2012 8:12 am
Contact:

WebServices: Access denied for SOAP Operation

Post by cycloshost »

Hi,

we are testing the SMS WebService with the simulator and almost all works fine (Cyclos 3.6.1 and SMS Module 1.0). We can login in the simulator:

Code: Select all

2012-07-22 15:46:50 DEBUG DwrService - The celPhone 017610203041 has logged in for session UAP0VHSrm3F53u2KEYb3KyHWGyj/e1bYKyj-0N47bySpv
2012-07-22 15:46:51 DEBUG DwrService - The celPhone 017610203041 is enabled to send messages
When we send a message, for example help, the message is sent to the Controller:

Code: Select all

2012-07-22 15:47:07  INFO ToControllerMessageProcessor - Sending message to controller: Driver Message: 
   trace        = 2913107180490
   provider     = simulatorDriverEngine
   from         = 017610203041
   to           = 9999
   words        = 1
   text         = *****
   driverId     = aioDriver
then the service:

Code: Select all

2012-07-22 15:47:07 DEBUG ControllerServiceLocalLocatorImpl - Returning local instance of ControllerService...
2012-07-22 15:47:07  INFO ControllerFacade - Message has arrived from driver. Driver Message: 
   trace        = 2913107180490
   provider     = simulatorDriverEngine
   from         = 017610203041
   to           = 9999
   words        = 1
   text         = *****
   driverId     = aioDriver
The command is executed OK:

Code: Select all

2012-07-22 15:47:07  INFO Command - Command to execute: help
   Cyclos       = demo
   Message      = 
      trace        = 2913107180490
      provider     = simulatorDriverEngine
      from         = 017610203041
      to           = 9999
      words        = 1
      text         = *****
      driverId     = aioDriver

2012-07-22 15:47:07  INFO HelpCommand - Executing command: help
   Cyclos       = demo
   Message      = 
      trace        = 2913107180490
      provider     = simulatorDriverEngine
      from         = 017610203041
      to           = 9999
      words        = 1
      text         = *****
      driverId     = aioDriver

   Parameters   = 
      command      = null
And the message that should be received is even shown in the log:

Code: Select all

2012-07-22 15:47:07  INFO ControllerFacade - Sending message to cyclos instance with id 'demo' (trace=2913107180490, smsType=HELP). Target: 017610203041, toCharge: 017610203041, text: For information about SMS operations. Send a message with the word help followed by one of the following operation commands: acinfo, pay, rq, reg, info
But unfortunately not on the simulator. It resolves the WAN IP of the server and the local IP of the cyclos instance:

Code: Select all

2012-07-22 15:47:07  WARN AccessControlInterceptor - Resolved IP: 80.20.X.X
2012-07-22 15:47:07  WARN CyclosInstanceValidationInterceptor - Access denied for SOAP Operation (remote address: 192.168.0.1): {http://sms.external.webservices.cyclos.strohalm.nl/}send for cyclos instance [demo]
But the access is denied for that ip. We have configured the Cyclos URLs as the external urls, that means http://cyclos.domain.com instead of http://192.168.0.1:8080 in the simulatorDriverConfig.properties & config.xml

We receive this error also but we do not see anything in the Cyclos logs:

Code: Select all

2012-07-22 15:47:08 ERROR ControllerFacade - Error sending message (traceData: 2913107180490) to cyclos instance with id 'demo': SEND_ERROR, cyclos smsLogId: 9 (to: 017610203041). Check Cyclos errors log page, log files or target member sms logs.
cycloshost.com
Cyclos administration and hosting

alexandre
Posts: 862
Joined: Wed Sep 06, 2006 9:06 am

Re: WebServices: Access denied for SOAP Operation

Post by alexandre »

Hi

Inside cyclos, on webservices clients you must configure this ip (192.168.0.1) to use the sms channel.

See the wiki page http://project.cyclos.org/wiki/index.ph ... figuration fro more information.

Regards.
Alexandre Caurrinhos
Cyclos development team.

cycloshost
Posts: 578
Joined: Mon Jan 30, 2012 8:12 am
Contact:

Re: WebServices: Access denied for SOAP Operation

Post by cycloshost »

Hi,

yes, we have read the wiki in detail and it was very helpful, we already configured the IP of the SMS Simulator in Configuration -> Webservices clients. In our test setup the traffic is served by tomcat workers via the Apache Tomcat Connector:
Cyclos runs on machine 192.168.0.1 (tomcat in port 8080) with internet address http://cyclos.domain.com/cyclos
SMS AIO runs on machine 192.168.0.2 (tomcat in port 8080) with internet address http://sms.domain.com/sms

The WAN IP 80.20.X.X is the same for both machines.

Our configuration in the Cyclos side:
In Configuration -> Webservice clients we have configured the IP of the SMS Controller: 192.168.0.2
In Configuration -> Channels the internet address of the Webservice url: http://sms.domain.com/sms/services/paymentRequest
In Configuration -> Basic configuration the internet address of the Webservice to send messages url: http://sms.domain.com/sms/services/smsSender

Our configuration in the SMS side. First in the config.xml we declare the name of the cyclos instance:

Code: Select all

<cyclosInstance name="demo" language="de" country="DE">
The Connection settings in config.xml are:

Code: Select all

<connectionSettings rootUrl="http://cyclos.domain.com/cyclos" disableCNCheck="true" connectionTimeout="120000" readTimeout="120000" trustAllCert="true" user="" password=""/>
And the routing in config.xml (our Cyclos instance is has the internal name 'demo'):

Code: Select all

<cyclosRouting>
       <route fromTargetNumber="9999" toCyclos="demo"/>  
 </cyclosRouting>
And in the simulator driver file (simulatorDriverConfig.properties):

Code: Select all

cyclos.ws.baseUrl=http://cyclos.domain.com/cyclos
Finally in the baseDriverConfig.properties we have the connection data to the database cyclos3_sms_aio and:

Code: Select all

phone.to.default=9999
cycloshost.com
Cyclos administration and hosting

alexandre
Posts: 862
Joined: Wed Sep 06, 2006 9:06 am

Re: WebServices: Access denied for SOAP Operation

Post by alexandre »

Hi,

On Cyclos->Settings->LocalSettings->SMS->SendSMSWebServiceURL try tu put the internal ips of the machines instead of the domain names (ex. 192.168.0.2)

On SMS config.xml->controller->cyclosInstances->cylosIntance->connectionSettings->rootUrl do the same thing put the internal ip of the cyclos machine (ex. 192.168.0.1)

Regards.
Alexandre Caurrinhos
Cyclos development team.

cycloshost
Posts: 578
Joined: Mon Jan 30, 2012 8:12 am
Contact:

Re: WebServices: Access denied for SOAP Operation

Post by cycloshost »

Hi,

as suggested, on Cyclos->Settings->LocalSettings->SMS->SendSMSWebServiceURL we have put the internal url instead of the domain name:
http://192.168.0.2:8080/sms/services/smsSender

(We guess we have to do the same with the WebService URL: http://192.168.0.2:8080/sms/services/paymentRequest)

This part seems to solve something, because we do not receive anymore the WARN CyclosInstanceValidationInterceptor - Access denied for SOAP Operation. But we get now a new error:

Code: Select all

ERROR ControllerFacade - Error sending message (traceData: 124540248203499) to cyclos instance with id 'demo': SEND_ERROR, cyclos smsLogId: 18 (to: 017610203041). Check Cyclos errors log page, log files or target member sms logs.
But when we try to do put the internal url 192.168.0.1:8080 instead of the cyclos domain name in the config.xml->controller->cyclosInstances->cylosIntance->connectionSettings->rootUrl, we receive this error:

Code: Select all

ERROR ControllerFacade - Connection error processing driver message: CYCLOS_WS_CONNECTION_FAILED: Error invoking sendSms
nl.strohalm.cyclos.controller.exception.WebServiceConnectionException: CYCLOS_WS_CONNECTION_FAILED: Error invoking sendSms
We tried also to change the cyclos.ws.baseurl to the internal cyclos url to 192.168.0.1:8080 in simulatorDriverConfig.properties according to the config.xml but when done we cannot even log in in the SMS Simulator:

Code: Select all

INFO accessLog - Method execution failed: 
javax.xml.ws.soap.SOAPFaultException: Server error: unauthorized-access 
cycloshost.com
Cyclos administration and hosting

admin
Site Admin
Posts: 1420
Joined: Mon Jan 24, 2005 10:31 am

Re: WebServices: Access denied for SOAP Operation

Post by admin »

So leave the config.xml and simulationdriver.properties with domain names and see if works.

Regards
Alexandre

cycloshost
Posts: 578
Joined: Mon Jan 30, 2012 8:12 am
Contact:

Re: WebServices: Access denied for SOAP Operation

Post by cycloshost »

So leave the config.xml and simulationdriver.properties with domain names and see if works.
We receive this error when we leave the config.xml and simulationdriver.properties with domain names:

Code: Select all

2012-07-24 10:24:32 ERROR ControllerFacade - Error sending message (traceData: 156357521723111) to cyclos instance with id 'demo': SEND_ERROR, cyclos smsLogId: 21 (to: 017610203041). Check Cyclos errors log page, log files or target member sms logs.
The message that the simulator should answer to the command introduced (in this case 'help') is previously received correctly in the log, but not shown in the simulator window:

Code: Select all

2012-07-24 10:24:31  INFO ControllerFacade - Sending message to cyclos instance with id 'demo' (trace=156357521723111, smsType=HELP). Target: 017610203041, toCharge: 017610203041, text: For information about SMS operations. Send a message with the word help followed by one of the following operation commands: acinfo, pay, rq, reg, info
cycloshost.com
Cyclos administration and hosting

alexandre
Posts: 862
Joined: Wed Sep 06, 2006 9:06 am

Re: WebServices: Access denied for SOAP Operation

Post by alexandre »

Try to use all config with the internal private network address, something like this:

SMS->config.xml->controller->cyclosInstances->cyclosInstance(demo)->connectionSettings->rootURL:
http://192.168.0.1:8080/cyclos

SMS->simulatorDriverconfig.properties->cyclos.ws.baseUrl
http://192.168.0.1:8080/cyclos

CYCLOS->AdminMenu->Settings->LocalSettings->SMS->SendSMSWebServiceURL
http://192.168.0.2:8080/sms/services/smsSender

CYCLOS->AdminMenu->Settings->Channels->SMS->WebServiceUrl
http://192.168.0.2:8080/sms/services/paymentRequest

CYCLOS->AdminMenu->Settings->WebServiceClient->SmsController->InternetAddress
192.168.0.2


If this not work then you have some network issue that are blocking the communication between the servers.

Regards.
Alexandre Caurrinhos
Cyclos development team.

cycloshost
Posts: 578
Joined: Mon Jan 30, 2012 8:12 am
Contact:

Re: WebServices: Access denied for SOAP Operation

Post by cycloshost »

Youre right, is a communication problem. We have tried with the internal IPs and everything works if we disable the firewall in the main server. We had a rule to divert all traffic coming from port 8080, now this part is solved. Thanks!
cycloshost.com
Cyclos administration and hosting

Post Reply