Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Nav Dhillon
Consuming web-service from remote clients not working
20 aprile 2012 14.10
Risposta

Nav Dhillon

Punteggio: Junior Member

Messaggi: 25

Data di Iscrizione: 31 ottobre 2011

Messaggi recenti

I exposed a SOAP web service from my portlet. When I call it from a client on localhost, the web-service works as expected. However, if the client is on remote host(non-localhost), and I pass the same SOAP xml (generated from the wsdl), the web-service method in ServiceImpl does not get invoked. Instead, the client gets an html response (response pasted below). Also related to this, I am unable to fetch the wsdl using "http://1.2.3.4/axis/Plugin_UserInfoService?wsdl" when I try from remote host. I get "Hi there, this is an AXIS service!" html message. If I try the same url from localhost, then the WSDL is fetched properly.

Is there a configuration switch or setting in tomcat and/or liferay that is causing this difference in behaviour between localhost web-service calls vs from other hosts? I am really on a short timeline so any input is appreciated. Thanks in advance.

============================= Actual web service response when using remote client =========================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
<title>www.abc123.com</title>

</head>
<frameset rows="100%,*" border="0">
<frame src="http://111.11.11.11/axis/Plugin_UserInfoService" frameborder="0" />
<frame frameborder="0" noresize />
</frameset>

<!-- pageok -->
<!-- 03 -->
<!-- -->
</html>
Olaf Kock
RE: Consuming web-service from remote clients not working
21 aprile 2012 4.10
Risposta

Olaf Kock

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 3560

Data di Iscrizione: 23 settembre 2008

Messaggi recenti

If we're speaking about Liferay Servicebuilder Webservices, you'll have to allow the remote host to access the webservices. In portal-ext.properties, examine
1axis.servlet.hosts.allowed=127.0.0.1,SERVER_IP

and add the hostname you're accessing from. However, the expected result should IMHO have been an "Access denied", so the odds are that you're not hitting Liferay's webservice but another frontend (Apache?) that does not forward the request like you expect?
Nav Dhillon
RE: Consuming web-service from remote clients not working
21 aprile 2012 20.03
Risposta

Nav Dhillon

Punteggio: Junior Member

Messaggi: 25

Data di Iscrizione: 31 ottobre 2011

Messaggi recenti

Thank you, you are correct. Did some more tests, and it turns out I am getting this html response even when the liferay is shutdown. Regards
Hitoshi Ozawa
RE: Consuming web-service from remote clients not working
22 aprile 2012 3.54
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 7949

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

If you're testing using a web browser, maybe you're getting this from your cache. Web service should be using the same setting as other web pages.

I'm not having problem using web service behind Apache httpd server so it should work. Still need to set the properties mentioned by Olaf.
Nav Dhillon
RE: Consuming web-service from remote clients not working
22 aprile 2012 10.23
Risposta

Nav Dhillon

Punteggio: Junior Member

Messaggi: 25

Data di Iscrizione: 31 ottobre 2011

Messaggi recenti

I have the properties set correctly in portal-ext.properties, the issue looks to be outside of liferay. Since this page is getting served even when liferay is shutdown, the html (instead of web-service response) is likely being sent by the firewall. Although the port 80 & 443 are allowed to get thru the firewall, there is something about the web-service call that causes the firewall to block it. Most likely, it is the SoapAction in the http header that is triggering firewall blocking. I have sent it to our corporate firewall's admins...
Sergey B
RE: Consuming web-service from remote clients not working
22 aprile 2012 10.28
Risposta

Sergey B

Punteggio: New Member

Messaggi: 15

Data di Iscrizione: 20 novembre 2011

Messaggi recenti

Nav, how did you generate your remote client? Can you please provide an example.
Olaf Kock
RE: Consuming web-service from remote clients not working
23 aprile 2012 6.27
Risposta

Olaf Kock

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 3560

Data di Iscrizione: 23 settembre 2008

Messaggi recenti

please open a new thread for this kind of questions - makes it easier to follow through for everybody if we stick to one topic per post.
Sergey B
RE: Consuming web-service from remote clients not working
23 aprile 2012 6.51
Risposta

Sergey B

Punteggio: New Member

Messaggi: 15

Data di Iscrizione: 20 novembre 2011

Messaggi recenti

Already did open a new thread, no replies.

What would it take for Liferay to start providing relevant, up to date documentation for it's features? I searched the documentation section up and down and could not find an example of how to consume a WebService generated by the service builder.
Olaf Kock
RE: Consuming web-service from remote clients not working
27 aprile 2012 2.18
Risposta

Olaf Kock

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 3560

Data di Iscrizione: 23 settembre 2008

Messaggi recenti

Sergey B:
I ... could not find an example of how to consume a WebService generated by the service builder.

The relevant chapters in the development documentation start here. Granted, this concentrates on the publishing side, but the consuming side is slightly outside of Liferay's scope. But still, in order to retain overview over the posts, let's continue in your other post (I assume this is the one you're referring to)
Nav Dhillon
RE: Consuming web-service from remote clients not working
30 aprile 2012 11.53
Risposta

Nav Dhillon

Punteggio: Junior Member

Messaggi: 25

Data di Iscrizione: 31 ottobre 2011

Messaggi recenti

Resolved, and this was NOT a liferay issue... In our case, our domain was being redirected by goDaddy. For some reason, goDaddy was not redirecting the "response" to web-service calls back to client properly, and passing this generic html response instead. Just changing the url from name to IP address quickly confirms if this is the case for anyone who may be running into this.
Olaf Kock
RE: Consuming web-service from remote clients not working
8 maggio 2012 6.06
Risposta

Olaf Kock

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 3560

Data di Iscrizione: 23 settembre 2008

Messaggi recenti

Thank you for reporting this back.
Hitoshi Ozawa
RE: Consuming web-service from remote clients not working
8 maggio 2012 6.28
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 7949

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

Already did open a new thread, no replies.


Sergey, sorry to say this but that's not a very good reason to go against forum rules and try to hijack other threads.
Sergey B
RE: Consuming web-service from remote clients not working
9 maggio 2012 11.39
Risposta

Sergey B

Punteggio: New Member

Messaggi: 15

Data di Iscrizione: 20 novembre 2011

Messaggi recenti

Olaf,

Thank you for the response. The documentation section you provided a link to does not describe how to call a service created through the service builder. All the examples are of existing LR services, all have <ServiceName>SoapServiceLocator class which is not present for service builder generated services.

If being able to expose a custom service is advertised as a features, I would at least expect a brief example on how to implement/use it. A real world example of passing in a real world object and getting another one back (not some "hello world" string, an actual object consisting of other objects, a CourseEnrollment containing Students for example). Is that an unreasonable request?