Author
|
Message
|
namita varshney
|
Monday 25 October 2010 2:30:21 am
Hello , i want to create a webservice in eZ publish and want to consume it in .Net application. Can it be possible? Thanks.
|
Gaetano Giunta
|
Monday 25 October 2010 4:42:34 am
@namita 1: you are again mixing two prtocols in your calls! This time jsonrpc and xmlrpc. Please take the time to understand what these 3 words mean: json-rpc, xml-rpc, soap. Read about them on wikipedia. In short: the server is answering with a jsonrpc response to the client. This response contains an error message. The error message is: "the client sent a request that is not valid according to my protocol". You should either
- change the jsonrpc server into an xmlrpc server, or
- in the payload you create in the debugger write some valid json data, not some xml data
@namita 2: if you want to create a webservice in eZP with the ggwebservices extension and consume it from a .net application, you currently have two choices:
- use a library in your .net application that speaks the xml-rpc or json-rpc protocols and use that library for the client
- wait a few weeks (possibly months) until there is good support for SOAP+WSDL servers within the extension. Currently only the SOAP+WSDL client is there, but I am working on the server implementation. I do not promise release dates, though.
Principal Consultant International Business
Member of the Community Project Board
|
namita varshney
|
Monday 25 October 2010 5:40:25 am
Sorry for making you confuse. I was trying to understand both xml-rpc and json-rpc. so i was confused. Thanks for helping.
|
Gaetano Giunta
|
Tuesday 26 October 2010 5:48:32 am
It is possible to create a SOAP webservice in eZP, but - there is limited support for marshaling of native contents - there is no support for WSDL To do it: 1. create an extension 2. in it, create settings/soap.ini.append.php and in the file declare your extension to provide soap services 3. in the extension, create soap/initialize.php and add your logic in there (similar to the above examples with jsonrpc/xmlrpc)
Principal Consultant International Business
Member of the Community Project Board
|
Gaetano Giunta
|
Tuesday 26 October 2010 5:55:14 am
Another solution is to forego completely eZP native SOAP support, and code you server from scratch using custom modules/views. Example code for the view:
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$server = new SoapServer( $my_wsdl_file );
$server->setClass( $mySoapWorkerClass );
$server->handle();
}
else
{
readfile( $my_wsdl_file );
}
eZExecution::cleanExit();
Principal Consultant International Business
Member of the Community Project Board
|
Gaetano Giunta
|
Tuesday 26 October 2010 6:03:43 am
Last but not least: another interesting extension for SOAP support in eZP: http://projects.ez.no/nusoap/
Principal Consultant International Business
Member of the Community Project Board
|
Dhaval Panchal
|
Monday 01 November 2010 6:22:29 am
Hey GG, Im thankful to you, now im able to use gg Webservice,.. but can you please suggest me how do i consume .net server in ggClient? It would be so nice of you if you have a look about my question. Thanks Dhaval
|
Dhaval Panchal
|
Monday 01 November 2010 6:40:30 am
hi GG, I came to know that you are the author of GG web service, great man.!!! and i have read your posts, i got too much idea about GG web services. I have used it in php, thanks a lot..!!! I want one more help from you, I have one Service in .Net and i want to consume it in php using gg Service client. can you please help me? Thanks Dhaval
|