Foros de discusión

JSON servlet not being creating when using service builder

thumbnail
Brant Levinson, modificado hace 15 años.

JSON servlet not being creating when using service builder

Junior Member Mensajes: 48 Fecha de incorporación: 12/07/08 Mensajes recientes
I have been trying to use service builder to build an application. The SOAP servlet gets created by not the JSON one.

I have remote-service='true' and have implemented the method as advised here: http://www.liferay.com/web/guest/community/forums/-/message_boards/message/1191680.

public class CustomerDtlsServiceImpl extends CustomerDtlsServiceBaseImpl {
public CustomerDtls getCustomerDtls(long id)
throws PortalException, SystemException {
return customerDtlsPersistence.findByPrimaryKey(id);
}
}

Although when I run ant build-service or just ant to build the war, it doesn't create the CustomerDtlsServiceJSON.java file. Am I doing this right? How to I get JSON services to run with a new portlet? Am I missing something?

Regards,
Brant
Tony Lim, modificado hace 14 años.

RE: JSON servlet not being creating when using service builder

Junior Member Mensajes: 90 Fecha de incorporación: 15/04/09 Mensajes recientes
I'm getting the same problem. How come the JSON files don't get greated?

thanks

Brant Levinson:
I have been trying to use service builder to build an application. The SOAP servlet gets created by not the JSON one.

I have remote-service='true' and have implemented the method as advised here: http://www.liferay.com/web/guest/community/forums/-/message_boards/message/1191680.

public class CustomerDtlsServiceImpl extends CustomerDtlsServiceBaseImpl {
public CustomerDtls getCustomerDtls(long id)
throws PortalException, SystemException {
return customerDtlsPersistence.findByPrimaryKey(id);
}
}

Although when I run ant build-service or just ant to build the war, it doesn't create the CustomerDtlsServiceJSON.java file. Am I doing this right? How to I get JSON services to run with a new portlet? Am I missing something?

Regards,
Brant
thumbnail
Dave Morris, modificado hace 14 años.

RE: JSON servlet not being creating when using service builder

Junior Member Mensajes: 27 Fecha de incorporación: 7/05/09 Mensajes recientes
I just upgraded to 5.2.3, and when I run ant build-service in the ext, my JSON classes are no longer being created either. Is this a change in 5.2.3?

In 5.2.2, the ext build-service command did create the JSON classes, but in the plugins SDK, it never did. Are you guys developing in plugins or ext?

Dave
Tony Lim, modificado hace 14 años.

RE: JSON servlet not being creating when using service builder

Junior Member Mensajes: 90 Fecha de incorporación: 15/04/09 Mensajes recientes
Developing in Plugins SDK
thumbnail
Faisal K, modificado hace 14 años.

RE: JSON servlet not being creating when using service builder

Regular Member Mensajes: 138 Fecha de incorporación: 9/01/08 Mensajes recientes
Hi,

By def'ault, Liferay have commented the json file creation in plugin-sdk refer the 'build-service' section of build-common-plugin.xml under plugin root directry. As per my knowledge Liferay json servlet is still not able to load the json servlet created using plugin, may be liferay team is working on that, why I am guessing this because is If we un comment the above service-json file system property in the above file, service builder will generate the json files properly.

Any body have better understanding please reply!
thumbnail
Wilson Man, modificado hace 14 años.

RE: JSON servlet not being creating when using service builder

Liferay Master Mensajes: 581 Fecha de incorporación: 21/06/06 Mensajes recientes
i could be wrong (cuz i haven't had time to dig deep into this ...) but i think per jsr-286, all the AJAX requests should go through the serveResource() method in your portlet class ... check out Liferay's JSPPortlet class. We normally extend this class to implement the serveResource()
Medha Sutaria, modificado hace 14 años.

RE: JSON servlet not being creating when using service builder

Junior Member Mensajes: 31 Fecha de incorporación: 11/08/08 Mensajes recientes
We've been trying to expose the web services for the wol-portlet, especially for the wall. What I saw in the portlet is, no json and ServiceSoap files were present, so I uncommented the line having "-Dservice.json.file" in plugins SDK as said by Faisal here and created the files -
Faisal K:
By def'ault, Liferay have commented the json file creation in plugin-sdk refer the 'build-service' section of build-common-plugin.xml under plugin root directry. As per my knowledge Liferay json servlet is still not able to load the json servlet created using plugin, may be liferay team is working on that, why I am guessing this because is If we un comment the above service-json file system property in the above file, service builder will generate the json files properly.


Next step, I saw that the build-wsdd target was missing in plugins sdk, so I copied the target from ext's build.xml and made few changes in class path and ran the target. It created the wsdd for wol-portlet.

Next, I copied the descriptors in tunnel-web's server-config.wsdd. But now, when I try i open http://localhost:8080/tunnel-web/axis, it gives me an error -
Sorry, something seems to have gone wrong... here are the details:

Fault - Could not find class for the service named: com.liferay.wol.service.http.WallEntryServiceSoap
Hint: you may need to copy your class files/tree into the right location (which depends on the servlet system you are using).; nested exception is: 
	java.lang.ClassNotFoundException: com.liferay.wol.service.http.WallEntryServiceSoap
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
 faultSubcode: 
 faultString: Could not find class for the service named: com.liferay.wol.service.http.WallEntryServiceSoap
Hint: you may need to copy your class files/tree into the right location (which depends on the servlet system you are using).; nested exception is: 
	java.lang.ClassNotFoundException: com.liferay.wol.service.http.WallEntryServiceSoap
 faultActor: 
 faultNode: 
 faultDetail: 
	{http://xml.apache.org/axis/}hostname:...


I understand that copying these missing class files from wol-portlet/web-inf/classes to tunnel-web/web-inf/classes will help. But this will be duplicating the code and I don't want to do that. For the classes required for web-services of ext-plugins, I think it takes from the root's lib itself since the AxisServlet is present in Root only.

So, my question is, how do we include the files in the classpath? Also, isn't there any built-in way of doing all this instead of the workarounds I've been trying to do? I hoped liferay would provide a direct way to expose it's plugins web-services built by plugins sdk.