Login  Register

Re: Calling services from external applications

Posted by Brett on May 04, 2007; 1:48pm
URL: http://ofbiz.116.s1.nabble.com/Calling-services-from-external-applications-tp180768p180769.html

What kind of error did you get with the RMI attempt?

I like using the RMI interface because is handles the object
conversion seamlessly.  If the two web applications are in the same
intranet RMI is a good solution.

Brett

On 5/4/07, Andrew Crowe <[hidden email]> wrote:

> Hi
>
>    We are currently piloting using ofbiz as the back end to some of our
> systems.  One of these is a web site for an association.  What we need
> to do is to allow that web site to access the data in ofbiz.  Not only
> read, but also write new data to it.  The web site is a java/jsp
> application.
>
> We have created the entities and services required in Ofbiz, and can get
> access to the services.  I have tried using the web service interface to
> add data, and this works fine as long as I only use simple types such as
> String (xsd:string).  However, one of the things that we have is a date
> field.  We have set this up as a java.sql.Date as defined in the
> 'fieldtypemysql.xml' file.  However, when sending this as soap ofbiz
> thinks that the java.sql.Date is a java.util.Date, and so throws an
> error.  This is due to roundtripping issues.
>
> We have then tried changing the type to java.util.Date in the entity and
> fieldtype defs.  This results in the web service working.  However, then
> when creating the entity through the ofbiz interface I get...
>
> The Following Errors Occurred:
>
>    * Type conversion of field [dateSetup] to type [java.util.Date]
> failed for value "2007-14-14": org.ofbiz.base.util.GeneralException:
> Conversion from String to java.util.Date not currently supported
>    * Type conversion of field [dateSetup] to type [java.util.Date]
> failed for value "2007-14-14": org.ofbiz.base.util.GeneralException:
> Conversion from String to java.util.Date not currently supported
>
> I'm also concerned with this approach as it is altering the core defs
> and will break everything else!
>
> Looking at other ofbiz services it uses java.sql.Timestamp objects for
> the type.  However, this will also not roundtrip, and comes back as a
> Calendar object!
>
> I have also tried to get the wsdl to use for services that use types
> other than 'string', but an error is thrown saying that ofbiz cant
> handle them!
>
> So the question really is....  How do I set up the web service (ofbiz
> and cremote client) to use the correct data type that will work to
> create the date?  There are a lot of examples I have found, but they
> only deal with strings!
>
> I have also tried RMI, but I could not get this to work from the remote
> application.
>
> If anyone has any information on how best to call an ofbiz service from
> a remote application (including dates) then I would be most gratefull
>
> Many thanks in advance
>
>
>
>