[OFBiz] Users - how to use SOAP engine

Souvik Saha Bhowmik souviksb at gmail.com
Mon May 30 01:32:35 EDT 2005


Hi

   Please ignore my previous mail.However I as I had stated earlier
that I had configurred axis seperately in Ofbiz(not the existing SOAP
engine that uses Axis)and have dep[loyed webservices there. I could
also prepare its clients using axis(the WSDL2Java command line
utility).
   But I see Ofbiz itself provides a support in its framework for
exposing a service as webservice.For this I followed the instructions
in:
http://lists.ofbiz.org/mailman/htdig/users/2004-March/003097.html
http://lists.ofbiz.org/mailman/htdig/users/2004-March/003255.html
But alot of things are unclear. I could see the WSDL of the service
but cannot access it or prepare aclient for it.
According to the instructions I made a small java service in one of my
applications ( say myProject). It take no input parameter but returns
a Hello World String.So I made the following entry in the services
definition file

<service name="simpleWs" engine="java"
                    location="com.soa.SimpleSoa"
        		invoke="getFirstMessage" auth="false" export="true">
                <description>a test service</description>
                <attribute name="helloString" type="String" mode="OUT"/>
    </service>
where the method to be exposed is 'getFirastMessage' in the class
com.soa.SimpleSoa
Next i made an entry in framework/common/servicedef/services_test.xml
<service name="remoteSimpleWs" engine="soap" export="true" 
                location="http://localhost:8080/webtools/control/SOAPService"
        	invoke="simpleWs" auth="false">
                <description>Calls a service on myProject</description>
                <namespace>http://localhost:8080/</namespace>
    </service>
Now on restarting the server I can view the WSDL at the following location:
But I find no means of accesing the service.If I make an entry in the
controller.xml for an uri mapping(say \invokeSoap)and through thew
events parameter I invoke remoteSimpleWs I get the following error
message: on browser:

layoutEvents.error_call_eventorg.ofbiz.webapp.event.EventHandlerException:
Service invocation error (; nested exception is:
org.xml.sax.SAXParseException: Content is not allowed in prolog.)

Even if I try to create a client using Axis seperately using the
WSDL2Java comaand I get ther SoapFault :
org.xml.sax.SAXParseException: Content is not allowed in prolog.

It seems the problem is with xml parsing. I would like to know whether
my processs is right and what changes are to be made in the
serviedefinition files. And how can I access the webservice.I also
read that thew services in Ofbiz should follow a specific signature
:public static Map service(DispatchContext dctx , Map mp). So I tried
the same procedure on a servicr=e with this signature...The result was
same.,
So I shall be highly obliged if someone can throw some light on thes
points and show mwe the correct procedure to expose a service as
Webservice and access it using the support ( SOAP engine I think)
provided by Ofbiz.


More information about the Users mailing list