xml engine / handler

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

xml engine / handler

Abdullah Shaikh
Hi All,

I want to develop a flex application which will interact with ofbiz using
xml.

I just had a cursory view of xmlrpcclient & xmlserializer, has anybody done
this ? what will be the best way to have ofbiz output xml ?

I have seen that GenericValue can be easily converted to xml form.

The request can be in xml form or can be a normal http request, but the
response from ofbiz should be in xml form, for example something like this,

<Orders>
<Order id="1" status="Approved"/> - all the required fields
<Order id="2" status="Created"/>
</Orders>

<Parties>
<Party firstname="abc" lastname="xyz"> - all the required fields
</Parties>

This way we can have a flex application communicate with ofbiz using xml
over http, I think flex don't understand json, so we need to go the xml way
and also the benefits of xml is that with this approach ofbiz can interact
with any kind of RIA technology.


Thanks,
Abdullah
Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Chris Snow-3
Hi Abdullah,

On my current project, we initially used xml-rpc using a flex xmlrpc
library sent to me by Andrew Zeneski.

We had tried using the new ofbiz soap implementation, but it didn't play
nicely with flex.

Have a look at XMLRPC in the faq:
http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo

If you want a more optimised communication between flex and ofbiz, you
can try BlazeDS:

http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized

Cheers,

Chris




Abdullah Shaikh wrote:

> Hi All,
>
> I want to develop a flex application which will interact with ofbiz using
> xml.
>
> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody done
> this ? what will be the best way to have ofbiz output xml ?
>
> I have seen that GenericValue can be easily converted to xml form.
>
> The request can be in xml form or can be a normal http request, but the
> response from ofbiz should be in xml form, for example something like this,
>
> <Orders>
> <Order id="1" status="Approved"/> - all the required fields
> <Order id="2" status="Created"/>
> </Orders>
>
> <Parties>
> <Party firstname="abc" lastname="xyz"> - all the required fields
> </Parties>
>
> This way we can have a flex application communicate with ofbiz using xml
> over http, I think flex don't understand json, so we need to go the xml way
> and also the benefits of xml is that with this approach ofbiz can interact
> with any kind of RIA technology.
>
>
> Thanks,
> Abdullah
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Bilgin Ibryam-2
In reply to this post by Abdullah Shaikh
Abdullah Shaikh wrote:

> Hi All,
>
> I want to develop a flex application which will interact with ofbiz using
> xml.
>
> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody done
> this ? what will be the best way to have ofbiz output xml ?
>
> I have seen that GenericValue can be easily converted to xml form.
>
> The request can be in xml form or can be a normal http request, but the
> response from ofbiz should be in xml form, for example something like this,
>
> <Orders>
> <Order id="1" status="Approved"/> - all the required fields
> <Order id="2" status="Created"/>
> </Orders>
>
> <Parties>
> <Party firstname="abc" lastname="xyz"> - all the required fields
> </Parties>
>
> This way we can have a flex application communicate with ofbiz using xml
> over http, I think flex don't understand json, so we need to go the xml way
> and also the benefits of xml is that with this approach ofbiz can interact
> with any kind of RIA technology.
>
>
> Thanks,
> Abdullah
>
>  
Hi Abdullah,

take a look at XmlRpcEventHandler.java. We use it to call ofbiz services
by sending data in xml format over http (using a xmlrpc client). The
result is also returned in xml format.

Bilgin
Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Abdullah Shaikh
In reply to this post by Chris Snow-3
Hi Chris,

I don't want to use xml-rpc but instead would like to use Flex HTTPService,
I guess xml-rpc would work with HTTPService.

Basic idea is to create a xml over http communication between ofbiz & any
other RIA, so that we can make ofbiz communicated with flex, gwt etc.

I will have a look at the link provided.

Thanks,
Abdullah

On Mon, Feb 1, 2010 at 8:09 PM, Christopher Snow <
[hidden email]> wrote:

> Hi Abdullah,
>
> On my current project, we initially used xml-rpc using a flex xmlrpc
> library sent to me by Andrew Zeneski.
>
> We had tried using the new ofbiz soap implementation, but it didn't play
> nicely with flex.
>
> Have a look at XMLRPC in the faq:
> http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>
> If you want a more optimised communication between flex and ofbiz, you can
> try BlazeDS:
>
>
> http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized
>
> Cheers,
>
> Chris
>
>
>
>
>
> Abdullah Shaikh wrote:
>
>> Hi All,
>>
>> I want to develop a flex application which will interact with ofbiz using
>> xml.
>>
>> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody
>> done
>> this ? what will be the best way to have ofbiz output xml ?
>>
>> I have seen that GenericValue can be easily converted to xml form.
>>
>> The request can be in xml form or can be a normal http request, but the
>> response from ofbiz should be in xml form, for example something like
>> this,
>>
>> <Orders>
>> <Order id="1" status="Approved"/> - all the required fields
>> <Order id="2" status="Created"/>
>> </Orders>
>>
>> <Parties>
>> <Party firstname="abc" lastname="xyz"> - all the required fields
>> </Parties>
>>
>> This way we can have a flex application communicate with ofbiz using xml
>> over http, I think flex don't understand json, so we need to go the xml
>> way
>> and also the benefits of xml is that with this approach ofbiz can interact
>> with any kind of RIA technology.
>>
>>
>> Thanks,
>> Abdullah
>>
>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Abdullah Shaikh
In reply to this post by Bilgin Ibryam-2
Hi Bilgin,

The client can be in any RIA technology, I need to communicate with ofbiz
from flex, in this case I guess I won't be able to use xmlrpc client.

Thanks,
Abdullah

On Mon, Feb 1, 2010 at 8:14 PM, Bilgin Ibryam <[hidden email]> wrote:

> Abdullah Shaikh wrote:
>
>> Hi All,
>>
>> I want to develop a flex application which will interact with ofbiz using
>> xml.
>>
>> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody
>> done
>> this ? what will be the best way to have ofbiz output xml ?
>>
>> I have seen that GenericValue can be easily converted to xml form.
>>
>> The request can be in xml form or can be a normal http request, but the
>> response from ofbiz should be in xml form, for example something like
>> this,
>>
>> <Orders>
>> <Order id="1" status="Approved"/> - all the required fields
>> <Order id="2" status="Created"/>
>> </Orders>
>>
>> <Parties>
>> <Party firstname="abc" lastname="xyz"> - all the required fields
>> </Parties>
>>
>> This way we can have a flex application communicate with ofbiz using xml
>> over http, I think flex don't understand json, so we need to go the xml
>> way
>> and also the benefits of xml is that with this approach ofbiz can interact
>> with any kind of RIA technology.
>>
>>
>> Thanks,
>> Abdullah
>>
>>
>>
> Hi Abdullah,
>
> take a look at XmlRpcEventHandler.java. We use it to call ofbiz services by
> sending data in xml format over http (using a xmlrpc client). The result is
> also returned in xml format.
>
> Bilgin
>
Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Bilgin Ibryam-2
Abdullah Shaikh wrote:

> Hi Bilgin,
>
> The client can be in any RIA technology, I need to communicate with ofbiz
> from flex, in this case I guess I won't be able to use xmlrpc client.
>
> Thanks,
> Abdullah
>
> On Mon, Feb 1, 2010 at 8:14 PM, Bilgin Ibryam <[hidden email]> wrote:
>
>  
>> Abdullah Shaikh wrote:
>>
>>    
>>> Hi All,
>>>
>>> I want to develop a flex application which will interact with ofbiz using
>>> xml.
>>>
>>> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody
>>> done
>>> this ? what will be the best way to have ofbiz output xml ?
>>>
>>> I have seen that GenericValue can be easily converted to xml form.
>>>
>>> The request can be in xml form or can be a normal http request, but the
>>> response from ofbiz should be in xml form, for example something like
>>> this,
>>>
>>> <Orders>
>>> <Order id="1" status="Approved"/> - all the required fields
>>> <Order id="2" status="Created"/>
>>> </Orders>
>>>
>>> <Parties>
>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>> </Parties>
>>>
>>> This way we can have a flex application communicate with ofbiz using xml
>>> over http, I think flex don't understand json, so we need to go the xml
>>> way
>>> and also the benefits of xml is that with this approach ofbiz can interact
>>> with any kind of RIA technology.
>>>
>>>
>>> Thanks,
>>> Abdullah
>>>
>>>
>>>
>>>      
>> Hi Abdullah,
>>
>> take a look at XmlRpcEventHandler.java. We use it to call ofbiz services by
>> sending data in xml format over http (using a xmlrpc client). The result is
>> also returned in xml format.
>>
>> Bilgin
>>
>>    
>
>  
I have no experience with flex, but xmlrpc is just a way to transport
the data over http encoded in xml. (it is like a lightweight soap) In
this sense, it doesn't matter what technology is using your client
application. If it is able to encode the data in properly formatted xml
and send it over http (and then read the result), that would be enough.
I see that there are also flex libraries for xmlrpc
http://en.wikipedia.org/wiki/XML-RPC

Bilgin
Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Chris Snow-3
I HAVE connected to ofbiz with flex using xmlrpc.

Did you see my post? http://n4.nabble.com/forum/PostLink.jtp?post=1458842



Bilgin Ibryam wrote:

> Abdullah Shaikh wrote:
>> Hi Bilgin,
>>
>> The client can be in any RIA technology, I need to communicate with
>> ofbiz
>> from flex, in this case I guess I won't be able to use xmlrpc client.
>>
>> Thanks,
>> Abdullah
>>
>> On Mon, Feb 1, 2010 at 8:14 PM, Bilgin Ibryam <[hidden email]> wrote:
>>
>>  
>>> Abdullah Shaikh wrote:
>>>
>>>    
>>>> Hi All,
>>>>
>>>> I want to develop a flex application which will interact with ofbiz
>>>> using
>>>> xml.
>>>>
>>>> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody
>>>> done
>>>> this ? what will be the best way to have ofbiz output xml ?
>>>>
>>>> I have seen that GenericValue can be easily converted to xml form.
>>>>
>>>> The request can be in xml form or can be a normal http request, but
>>>> the
>>>> response from ofbiz should be in xml form, for example something like
>>>> this,
>>>>
>>>> <Orders>
>>>> <Order id="1" status="Approved"/> - all the required fields
>>>> <Order id="2" status="Created"/>
>>>> </Orders>
>>>>
>>>> <Parties>
>>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>>> </Parties>
>>>>
>>>> This way we can have a flex application communicate with ofbiz
>>>> using xml
>>>> over http, I think flex don't understand json, so we need to go the
>>>> xml
>>>> way
>>>> and also the benefits of xml is that with this approach ofbiz can
>>>> interact
>>>> with any kind of RIA technology.
>>>>
>>>>
>>>> Thanks,
>>>> Abdullah
>>>>
>>>>
>>>>
>>>>      
>>> Hi Abdullah,
>>>
>>> take a look at XmlRpcEventHandler.java. We use it to call ofbiz
>>> services by
>>> sending data in xml format over http (using a xmlrpc client). The
>>> result is
>>> also returned in xml format.
>>>
>>> Bilgin
>>>
>>>    
>>
>>  
> I have no experience with flex, but xmlrpc is just a way to transport
> the data over http encoded in xml. (it is like a lightweight soap) In
> this sense, it doesn't matter what technology is using your client
> application. If it is able to encode the data in properly formatted
> xml and send it over http (and then read the result), that would be
> enough. I see that there are also flex libraries for xmlrpc
> http://en.wikipedia.org/wiki/XML-RPC
>
> Bilgin

Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Chris Snow-3
In reply to this post by Abdullah Shaikh
Sorry - just seen this.

The approach we currently use is having a dedicated web app in ofbiz
which is used to expose ofbiz services using REST (the organisation
favors REST) .  We are using the jersey rest libraries.

I believe our flex guy is using HTTPService to communicate with rest.

Cheers,

chris

Abdullah Shaikh wrote:

> Hi Chris,
>
> I don't want to use xml-rpc but instead would like to use Flex HTTPService,
> I guess xml-rpc would work with HTTPService.
>
> Basic idea is to create a xml over http communication between ofbiz & any
> other RIA, so that we can make ofbiz communicated with flex, gwt etc.
>
> I will have a look at the link provided.
>
> Thanks,
> Abdullah
>
> On Mon, Feb 1, 2010 at 8:09 PM, Christopher Snow <
> [hidden email]> wrote:
>
>  
>> Hi Abdullah,
>>
>> On my current project, we initially used xml-rpc using a flex xmlrpc
>> library sent to me by Andrew Zeneski.
>>
>> We had tried using the new ofbiz soap implementation, but it didn't play
>> nicely with flex.
>>
>> Have a look at XMLRPC in the faq:
>> http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>
>> If you want a more optimised communication between flex and ofbiz, you can
>> try BlazeDS:
>>
>>
>> http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized
>>
>> Cheers,
>>
>> Chris
>>
>>
>>
>>
>>
>> Abdullah Shaikh wrote:
>>
>>    
>>> Hi All,
>>>
>>> I want to develop a flex application which will interact with ofbiz using
>>> xml.
>>>
>>> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody
>>> done
>>> this ? what will be the best way to have ofbiz output xml ?
>>>
>>> I have seen that GenericValue can be easily converted to xml form.
>>>
>>> The request can be in xml form or can be a normal http request, but the
>>> response from ofbiz should be in xml form, for example something like
>>> this,
>>>
>>> <Orders>
>>> <Order id="1" status="Approved"/> - all the required fields
>>> <Order id="2" status="Created"/>
>>> </Orders>
>>>
>>> <Parties>
>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>> </Parties>
>>>
>>> This way we can have a flex application communicate with ofbiz using xml
>>> over http, I think flex don't understand json, so we need to go the xml
>>> way
>>> and also the benefits of xml is that with this approach ofbiz can interact
>>> with any kind of RIA technology.
>>>
>>>
>>> Thanks,
>>> Abdullah
>>>
>>>
>>>
>>>      
>>    
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Jeroen van der Wal-2
Hi Chris,

We're also a big fan of REST but have not taken time to work on a solution
like you mentioned. Are you willing to share what you have done so far?

Thanks,

Jeroen van der Wal
Stromboli b.v.
+31 655 874050


On Mon, Feb 1, 2010 at 4:53 PM, Christopher Snow <
[hidden email]> wrote:

> Sorry - just seen this.
> The approach we currently use is having a dedicated web app in ofbiz which
> is used to expose ofbiz services using REST (the organisation favors REST) .
>  We are using the jersey rest libraries.
>
> I believe our flex guy is using HTTPService to communicate with rest.
>
> Cheers,
>
> chris
>
>
> Abdullah Shaikh wrote:
>
>> Hi Chris,
>>
>> I don't want to use xml-rpc but instead would like to use Flex
>> HTTPService,
>> I guess xml-rpc would work with HTTPService.
>>
>> Basic idea is to create a xml over http communication between ofbiz & any
>> other RIA, so that we can make ofbiz communicated with flex, gwt etc.
>>
>> I will have a look at the link provided.
>>
>> Thanks,
>> Abdullah
>>
>> On Mon, Feb 1, 2010 at 8:09 PM, Christopher Snow <
>> [hidden email]> wrote:
>>
>>
>>
>>> Hi Abdullah,
>>>
>>> On my current project, we initially used xml-rpc using a flex xmlrpc
>>> library sent to me by Andrew Zeneski.
>>>
>>> We had tried using the new ofbiz soap implementation, but it didn't play
>>> nicely with flex.
>>>
>>> Have a look at XMLRPC in the faq:
>>>
>>> http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>>
>>> If you want a more optimised communication between flex and ofbiz, you
>>> can
>>> try BlazeDS:
>>>
>>>
>>>
>>> http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized
>>>
>>> Cheers,
>>>
>>> Chris
>>>
>>>
>>>
>>>
>>>
>>> Abdullah Shaikh wrote:
>>>
>>>
>>>
>>>> Hi All,
>>>>
>>>> I want to develop a flex application which will interact with ofbiz
>>>> using
>>>> xml.
>>>>
>>>> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody
>>>> done
>>>> this ? what will be the best way to have ofbiz output xml ?
>>>>
>>>> I have seen that GenericValue can be easily converted to xml form.
>>>>
>>>> The request can be in xml form or can be a normal http request, but the
>>>> response from ofbiz should be in xml form, for example something like
>>>> this,
>>>>
>>>> <Orders>
>>>> <Order id="1" status="Approved"/> - all the required fields
>>>> <Order id="2" status="Created"/>
>>>> </Orders>
>>>>
>>>> <Parties>
>>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>>> </Parties>
>>>>
>>>> This way we can have a flex application communicate with ofbiz using xml
>>>> over http, I think flex don't understand json, so we need to go the xml
>>>> way
>>>> and also the benefits of xml is that with this approach ofbiz can
>>>> interact
>>>> with any kind of RIA technology.
>>>>
>>>>
>>>> Thanks,
>>>> Abdullah
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Abdullah Shaikh
In reply to this post by Bilgin Ibryam-2
Thanks Bilgin, I will have a look at xmlrpc.

- Abdullah

On Mon, Feb 1, 2010 at 9:00 PM, Bilgin Ibryam <[hidden email]> wrote:

> Abdullah Shaikh wrote:
>
>> Hi Bilgin,
>>
>> The client can be in any RIA technology, I need to communicate with ofbiz
>> from flex, in this case I guess I won't be able to use xmlrpc client.
>>
>> Thanks,
>> Abdullah
>>
>> On Mon, Feb 1, 2010 at 8:14 PM, Bilgin Ibryam <[hidden email]> wrote:
>>
>>
>>
>>> Abdullah Shaikh wrote:
>>>
>>>
>>>
>>>> Hi All,
>>>>
>>>> I want to develop a flex application which will interact with ofbiz
>>>> using
>>>> xml.
>>>>
>>>> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody
>>>> done
>>>> this ? what will be the best way to have ofbiz output xml ?
>>>>
>>>> I have seen that GenericValue can be easily converted to xml form.
>>>>
>>>> The request can be in xml form or can be a normal http request, but the
>>>> response from ofbiz should be in xml form, for example something like
>>>> this,
>>>>
>>>> <Orders>
>>>> <Order id="1" status="Approved"/> - all the required fields
>>>> <Order id="2" status="Created"/>
>>>> </Orders>
>>>>
>>>> <Parties>
>>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>>> </Parties>
>>>>
>>>> This way we can have a flex application communicate with ofbiz using xml
>>>> over http, I think flex don't understand json, so we need to go the xml
>>>> way
>>>> and also the benefits of xml is that with this approach ofbiz can
>>>> interact
>>>> with any kind of RIA technology.
>>>>
>>>>
>>>> Thanks,
>>>> Abdullah
>>>>
>>>>
>>>>
>>>>
>>>>
>>> Hi Abdullah,
>>>
>>> take a look at XmlRpcEventHandler.java. We use it to call ofbiz services
>>> by
>>> sending data in xml format over http (using a xmlrpc client). The result
>>> is
>>> also returned in xml format.
>>>
>>> Bilgin
>>>
>>>
>>>
>>
>>
>>
> I have no experience with flex, but xmlrpc is just a way to transport the
> data over http encoded in xml. (it is like a lightweight soap) In this
> sense, it doesn't matter what technology is using your client application.
> If it is able to encode the data in properly formatted xml and send it over
> http (and then read the result), that would be enough. I see that there are
> also flex libraries for xmlrpc http://en.wikipedia.org/wiki/XML-RPC
>
> Bilgin
>
Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Abdullah Shaikh
In reply to this post by Chris Snow-3
Yes, thats good to have a separate component to handle xml over http, REST
in your case.

But I am not getting how are forming the url's, because in REST, urls
represents a objects.

For example :

http://ofbiz/partymgr/party/1234 - will represent a party whose id is 1234

http://ofbiz/partymgr/party/1234/addrress/5678 - will represent the address
whose id is 5678 of party 1234

I guess its difficult to have this sort of thing considering the number of
functionality already build in ofbiz.

or are you using REST but not following the each url represents an object.


Thanks,
Abdullah

On Mon, Feb 1, 2010 at 9:23 PM, Christopher Snow <
[hidden email]> wrote:

> Sorry - just seen this.
> The approach we currently use is having a dedicated web app in ofbiz which
> is used to expose ofbiz services using REST (the organisation favors REST) .
>  We are using the jersey rest libraries.
>
> I believe our flex guy is using HTTPService to communicate with rest.
>
> Cheers,
>
> chris
>
>
> Abdullah Shaikh wrote:
>
>> Hi Chris,
>>
>> I don't want to use xml-rpc but instead would like to use Flex
>> HTTPService,
>> I guess xml-rpc would work with HTTPService.
>>
>> Basic idea is to create a xml over http communication between ofbiz & any
>> other RIA, so that we can make ofbiz communicated with flex, gwt etc.
>>
>> I will have a look at the link provided.
>>
>> Thanks,
>> Abdullah
>>
>> On Mon, Feb 1, 2010 at 8:09 PM, Christopher Snow <
>> [hidden email]> wrote:
>>
>>
>>
>>> Hi Abdullah,
>>>
>>> On my current project, we initially used xml-rpc using a flex xmlrpc
>>> library sent to me by Andrew Zeneski.
>>>
>>> We had tried using the new ofbiz soap implementation, but it didn't play
>>> nicely with flex.
>>>
>>> Have a look at XMLRPC in the faq:
>>>
>>> http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>>
>>> If you want a more optimised communication between flex and ofbiz, you
>>> can
>>> try BlazeDS:
>>>
>>>
>>>
>>> http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized
>>>
>>> Cheers,
>>>
>>> Chris
>>>
>>>
>>>
>>>
>>>
>>> Abdullah Shaikh wrote:
>>>
>>>
>>>
>>>> Hi All,
>>>>
>>>> I want to develop a flex application which will interact with ofbiz
>>>> using
>>>> xml.
>>>>
>>>> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody
>>>> done
>>>> this ? what will be the best way to have ofbiz output xml ?
>>>>
>>>> I have seen that GenericValue can be easily converted to xml form.
>>>>
>>>> The request can be in xml form or can be a normal http request, but the
>>>> response from ofbiz should be in xml form, for example something like
>>>> this,
>>>>
>>>> <Orders>
>>>> <Order id="1" status="Approved"/> - all the required fields
>>>> <Order id="2" status="Created"/>
>>>> </Orders>
>>>>
>>>> <Parties>
>>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>>> </Parties>
>>>>
>>>> This way we can have a flex application communicate with ofbiz using xml
>>>> over http, I think flex don't understand json, so we need to go the xml
>>>> way
>>>> and also the benefits of xml is that with this approach ofbiz can
>>>> interact
>>>> with any kind of RIA technology.
>>>>
>>>>
>>>> Thanks,
>>>> Abdullah
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Chris Snow-3
We are not automatically exporting objects with REST.

We are exporting some services with REST.  Each one has to be manually
coded.

It would be nice to develop a solution to automatically export objects
(entities), perhaps this would be relatively trivial using the new
"entity-auto" service (i.e. CRuD service)?



Abdullah Shaikh wrote:

> Yes, thats good to have a separate component to handle xml over http, REST
> in your case.
>
> But I am not getting how are forming the url's, because in REST, urls
> represents a objects.
>
> For example :
>
> http://ofbiz/partymgr/party/1234 - will represent a party whose id is 1234
>
> http://ofbiz/partymgr/party/1234/addrress/5678 - will represent the address
> whose id is 5678 of party 1234
>
> I guess its difficult to have this sort of thing considering the number of
> functionality already build in ofbiz.
>
> or are you using REST but not following the each url represents an object.
>
>
> Thanks,
> Abdullah
>
> On Mon, Feb 1, 2010 at 9:23 PM, Christopher Snow <
> [hidden email]> wrote:
>
>  
>> Sorry - just seen this.
>> The approach we currently use is having a dedicated web app in ofbiz which
>> is used to expose ofbiz services using REST (the organisation favors REST) .
>>  We are using the jersey rest libraries.
>>
>> I believe our flex guy is using HTTPService to communicate with rest.
>>
>> Cheers,
>>
>> chris
>>
>>
>> Abdullah Shaikh wrote:
>>
>>    
>>> Hi Chris,
>>>
>>> I don't want to use xml-rpc but instead would like to use Flex
>>> HTTPService,
>>> I guess xml-rpc would work with HTTPService.
>>>
>>> Basic idea is to create a xml over http communication between ofbiz & any
>>> other RIA, so that we can make ofbiz communicated with flex, gwt etc.
>>>
>>> I will have a look at the link provided.
>>>
>>> Thanks,
>>> Abdullah
>>>
>>> On Mon, Feb 1, 2010 at 8:09 PM, Christopher Snow <
>>> [hidden email]> wrote:
>>>
>>>
>>>
>>>      
>>>> Hi Abdullah,
>>>>
>>>> On my current project, we initially used xml-rpc using a flex xmlrpc
>>>> library sent to me by Andrew Zeneski.
>>>>
>>>> We had tried using the new ofbiz soap implementation, but it didn't play
>>>> nicely with flex.
>>>>
>>>> Have a look at XMLRPC in the faq:
>>>>
>>>> http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>>>
>>>> If you want a more optimised communication between flex and ofbiz, you
>>>> can
>>>> try BlazeDS:
>>>>
>>>>
>>>>
>>>> http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized
>>>>
>>>> Cheers,
>>>>
>>>> Chris
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Abdullah Shaikh wrote:
>>>>
>>>>
>>>>
>>>>        
>>>>> Hi All,
>>>>>
>>>>> I want to develop a flex application which will interact with ofbiz
>>>>> using
>>>>> xml.
>>>>>
>>>>> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody
>>>>> done
>>>>> this ? what will be the best way to have ofbiz output xml ?
>>>>>
>>>>> I have seen that GenericValue can be easily converted to xml form.
>>>>>
>>>>> The request can be in xml form or can be a normal http request, but the
>>>>> response from ofbiz should be in xml form, for example something like
>>>>> this,
>>>>>
>>>>> <Orders>
>>>>> <Order id="1" status="Approved"/> - all the required fields
>>>>> <Order id="2" status="Created"/>
>>>>> </Orders>
>>>>>
>>>>> <Parties>
>>>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>>>> </Parties>
>>>>>
>>>>> This way we can have a flex application communicate with ofbiz using xml
>>>>> over http, I think flex don't understand json, so we need to go the xml
>>>>> way
>>>>> and also the benefits of xml is that with this approach ofbiz can
>>>>> interact
>>>>> with any kind of RIA technology.
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Abdullah
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>        
>>>
>>>      
>>    
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Zhang Shiqian
Ofbiz services can be exported as standard web services, you can use Flex to
call the web services. We have developed some Flex components used in our
ofbiz applications run in this model, and introduced as3corelib to deal with
JSON format data.

On Tue, Feb 2, 2010 at 12:42 AM, Christopher Snow <
[hidden email]> wrote:

> We are not automatically exporting objects with REST.
>
> We are exporting some services with REST.  Each one has to be manually
> coded.
>
> It would be nice to develop a solution to automatically export objects
> (entities), perhaps this would be relatively trivial using the new
> "entity-auto" service (i.e. CRuD service)?
>
>
>
>
> Abdullah Shaikh wrote:
>
>> Yes, thats good to have a separate component to handle xml over http, REST
>> in your case.
>>
>> But I am not getting how are forming the url's, because in REST, urls
>> represents a objects.
>>
>> For example :
>>
>> http://ofbiz/partymgr/party/1234 - will represent a party whose id is
>> 1234
>>
>> http://ofbiz/partymgr/party/1234/addrress/5678 - will represent the
>> address
>> whose id is 5678 of party 1234
>>
>> I guess its difficult to have this sort of thing considering the number of
>> functionality already build in ofbiz.
>>
>> or are you using REST but not following the each url represents an object.
>>
>>
>> Thanks,
>> Abdullah
>>
>> On Mon, Feb 1, 2010 at 9:23 PM, Christopher Snow <
>> [hidden email]> wrote:
>>
>>
>>
>>> Sorry - just seen this.
>>> The approach we currently use is having a dedicated web app in ofbiz
>>> which
>>> is used to expose ofbiz services using REST (the organisation favors
>>> REST) .
>>>  We are using the jersey rest libraries.
>>>
>>> I believe our flex guy is using HTTPService to communicate with rest.
>>>
>>> Cheers,
>>>
>>> chris
>>>
>>>
>>> Abdullah Shaikh wrote:
>>>
>>>
>>>
>>>> Hi Chris,
>>>>
>>>> I don't want to use xml-rpc but instead would like to use Flex
>>>> HTTPService,
>>>> I guess xml-rpc would work with HTTPService.
>>>>
>>>> Basic idea is to create a xml over http communication between ofbiz &
>>>> any
>>>> other RIA, so that we can make ofbiz communicated with flex, gwt etc.
>>>>
>>>> I will have a look at the link provided.
>>>>
>>>> Thanks,
>>>> Abdullah
>>>>
>>>> On Mon, Feb 1, 2010 at 8:09 PM, Christopher Snow <
>>>> [hidden email]> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Hi Abdullah,
>>>>>
>>>>> On my current project, we initially used xml-rpc using a flex xmlrpc
>>>>> library sent to me by Andrew Zeneski.
>>>>>
>>>>> We had tried using the new ofbiz soap implementation, but it didn't
>>>>> play
>>>>> nicely with flex.
>>>>>
>>>>> Have a look at XMLRPC in the faq:
>>>>>
>>>>>
>>>>> http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>>>>
>>>>> If you want a more optimised communication between flex and ofbiz, you
>>>>> can
>>>>> try BlazeDS:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Chris
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Abdullah Shaikh wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> I want to develop a flex application which will interact with ofbiz
>>>>>> using
>>>>>> xml.
>>>>>>
>>>>>> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody
>>>>>> done
>>>>>> this ? what will be the best way to have ofbiz output xml ?
>>>>>>
>>>>>> I have seen that GenericValue can be easily converted to xml form.
>>>>>>
>>>>>> The request can be in xml form or can be a normal http request, but
>>>>>> the
>>>>>> response from ofbiz should be in xml form, for example something like
>>>>>> this,
>>>>>>
>>>>>> <Orders>
>>>>>> <Order id="1" status="Approved"/> - all the required fields
>>>>>> <Order id="2" status="Created"/>
>>>>>> </Orders>
>>>>>>
>>>>>> <Parties>
>>>>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>>>>> </Parties>
>>>>>>
>>>>>> This way we can have a flex application communicate with ofbiz using
>>>>>> xml
>>>>>> over http, I think flex don't understand json, so we need to go the
>>>>>> xml
>>>>>> way
>>>>>> and also the benefits of xml is that with this approach ofbiz can
>>>>>> interact
>>>>>> with any kind of RIA technology.
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Abdullah
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
>


--
--
Regards,

Zhang Shiqian

Wizitsoft Information Technology Ltd.
www.wizitsoft.com | Phone: (8610)6267 0653 ext 604 | Mobile: (86)13264158885
Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Chris Snow-3
Hi Zhang,

Would you be happy to provide some documentation on how to do this?

Many thanks,

Chris

Zhang Shiqian wrote:

> Ofbiz services can be exported as standard web services, you can use Flex to
> call the web services. We have developed some Flex components used in our
> ofbiz applications run in this model, and introduced as3corelib to deal with
> JSON format data.
>
> On Tue, Feb 2, 2010 at 12:42 AM, Christopher Snow <
> [hidden email]> wrote:
>
>  
>> We are not automatically exporting objects with REST.
>>
>> We are exporting some services with REST.  Each one has to be manually
>> coded.
>>
>> It would be nice to develop a solution to automatically export objects
>> (entities), perhaps this would be relatively trivial using the new
>> "entity-auto" service (i.e. CRuD service)?
>>
>>
>>
>>
>> Abdullah Shaikh wrote:
>>
>>    
>>> Yes, thats good to have a separate component to handle xml over http, REST
>>> in your case.
>>>
>>> But I am not getting how are forming the url's, because in REST, urls
>>> represents a objects.
>>>
>>> For example :
>>>
>>> http://ofbiz/partymgr/party/1234 - will represent a party whose id is
>>> 1234
>>>
>>> http://ofbiz/partymgr/party/1234/addrress/5678 - will represent the
>>> address
>>> whose id is 5678 of party 1234
>>>
>>> I guess its difficult to have this sort of thing considering the number of
>>> functionality already build in ofbiz.
>>>
>>> or are you using REST but not following the each url represents an object.
>>>
>>>
>>> Thanks,
>>> Abdullah
>>>
>>> On Mon, Feb 1, 2010 at 9:23 PM, Christopher Snow <
>>> [hidden email]> wrote:
>>>
>>>
>>>
>>>      
>>>> Sorry - just seen this.
>>>> The approach we currently use is having a dedicated web app in ofbiz
>>>> which
>>>> is used to expose ofbiz services using REST (the organisation favors
>>>> REST) .
>>>>  We are using the jersey rest libraries.
>>>>
>>>> I believe our flex guy is using HTTPService to communicate with rest.
>>>>
>>>> Cheers,
>>>>
>>>> chris
>>>>
>>>>
>>>> Abdullah Shaikh wrote:
>>>>
>>>>
>>>>
>>>>        
>>>>> Hi Chris,
>>>>>
>>>>> I don't want to use xml-rpc but instead would like to use Flex
>>>>> HTTPService,
>>>>> I guess xml-rpc would work with HTTPService.
>>>>>
>>>>> Basic idea is to create a xml over http communication between ofbiz &
>>>>> any
>>>>> other RIA, so that we can make ofbiz communicated with flex, gwt etc.
>>>>>
>>>>> I will have a look at the link provided.
>>>>>
>>>>> Thanks,
>>>>> Abdullah
>>>>>
>>>>> On Mon, Feb 1, 2010 at 8:09 PM, Christopher Snow <
>>>>> [hidden email]> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>> Hi Abdullah,
>>>>>>
>>>>>> On my current project, we initially used xml-rpc using a flex xmlrpc
>>>>>> library sent to me by Andrew Zeneski.
>>>>>>
>>>>>> We had tried using the new ofbiz soap implementation, but it didn't
>>>>>> play
>>>>>> nicely with flex.
>>>>>>
>>>>>> Have a look at XMLRPC in the faq:
>>>>>>
>>>>>>
>>>>>> http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>>>>>
>>>>>> If you want a more optimised communication between flex and ofbiz, you
>>>>>> can
>>>>>> try BlazeDS:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Chris
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Abdullah Shaikh wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>> Hi All,
>>>>>>>
>>>>>>> I want to develop a flex application which will interact with ofbiz
>>>>>>> using
>>>>>>> xml.
>>>>>>>
>>>>>>> I just had a cursory view of xmlrpcclient & xmlserializer, has anybody
>>>>>>> done
>>>>>>> this ? what will be the best way to have ofbiz output xml ?
>>>>>>>
>>>>>>> I have seen that GenericValue can be easily converted to xml form.
>>>>>>>
>>>>>>> The request can be in xml form or can be a normal http request, but
>>>>>>> the
>>>>>>> response from ofbiz should be in xml form, for example something like
>>>>>>> this,
>>>>>>>
>>>>>>> <Orders>
>>>>>>> <Order id="1" status="Approved"/> - all the required fields
>>>>>>> <Order id="2" status="Created"/>
>>>>>>> </Orders>
>>>>>>>
>>>>>>> <Parties>
>>>>>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>>>>>> </Parties>
>>>>>>>
>>>>>>> This way we can have a flex application communicate with ofbiz using
>>>>>>> xml
>>>>>>> over http, I think flex don't understand json, so we need to go the
>>>>>>> xml
>>>>>>> way
>>>>>>> and also the benefits of xml is that with this approach ofbiz can
>>>>>>> interact
>>>>>>> with any kind of RIA technology.
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Abdullah
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>            
>>>>>
>>>>>          
>>>>        
>>>
>>>      
>>    
>
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Abdullah Shaikh
In reply to this post by Zhang Shiqian
OK, you mean, ofbiz services are exposed and consumed by Flex, but that is
soap over http right ?

Where does the JSON format data comes into picture ? or how the services
outputs JSON data ?

or am I missing something ?

- Abdullah

On Tue, Feb 2, 2010 at 7:27 AM, Zhang Shiqian
<[hidden email]>wrote:

> Ofbiz services can be exported as standard web services, you can use Flex
> to
> call the web services. We have developed some Flex components used in our
> ofbiz applications run in this model, and introduced as3corelib to deal
> with
> JSON format data.
>
> On Tue, Feb 2, 2010 at 12:42 AM, Christopher Snow <
> [hidden email]> wrote:
>
> > We are not automatically exporting objects with REST.
> >
> > We are exporting some services with REST.  Each one has to be manually
> > coded.
> >
> > It would be nice to develop a solution to automatically export objects
> > (entities), perhaps this would be relatively trivial using the new
> > "entity-auto" service (i.e. CRuD service)?
> >
> >
> >
> >
> > Abdullah Shaikh wrote:
> >
> >> Yes, thats good to have a separate component to handle xml over http,
> REST
> >> in your case.
> >>
> >> But I am not getting how are forming the url's, because in REST, urls
> >> represents a objects.
> >>
> >> For example :
> >>
> >> http://ofbiz/partymgr/party/1234 - will represent a party whose id is
> >> 1234
> >>
> >> http://ofbiz/partymgr/party/1234/addrress/5678 - will represent the
> >> address
> >> whose id is 5678 of party 1234
> >>
> >> I guess its difficult to have this sort of thing considering the number
> of
> >> functionality already build in ofbiz.
> >>
> >> or are you using REST but not following the each url represents an
> object.
> >>
> >>
> >> Thanks,
> >> Abdullah
> >>
> >> On Mon, Feb 1, 2010 at 9:23 PM, Christopher Snow <
> >> [hidden email]> wrote:
> >>
> >>
> >>
> >>> Sorry - just seen this.
> >>> The approach we currently use is having a dedicated web app in ofbiz
> >>> which
> >>> is used to expose ofbiz services using REST (the organisation favors
> >>> REST) .
> >>>  We are using the jersey rest libraries.
> >>>
> >>> I believe our flex guy is using HTTPService to communicate with rest.
> >>>
> >>> Cheers,
> >>>
> >>> chris
> >>>
> >>>
> >>> Abdullah Shaikh wrote:
> >>>
> >>>
> >>>
> >>>> Hi Chris,
> >>>>
> >>>> I don't want to use xml-rpc but instead would like to use Flex
> >>>> HTTPService,
> >>>> I guess xml-rpc would work with HTTPService.
> >>>>
> >>>> Basic idea is to create a xml over http communication between ofbiz &
> >>>> any
> >>>> other RIA, so that we can make ofbiz communicated with flex, gwt etc.
> >>>>
> >>>> I will have a look at the link provided.
> >>>>
> >>>> Thanks,
> >>>> Abdullah
> >>>>
> >>>> On Mon, Feb 1, 2010 at 8:09 PM, Christopher Snow <
> >>>> [hidden email]> wrote:
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>> Hi Abdullah,
> >>>>>
> >>>>> On my current project, we initially used xml-rpc using a flex xmlrpc
> >>>>> library sent to me by Andrew Zeneski.
> >>>>>
> >>>>> We had tried using the new ofbiz soap implementation, but it didn't
> >>>>> play
> >>>>> nicely with flex.
> >>>>>
> >>>>> Have a look at XMLRPC in the faq:
> >>>>>
> >>>>>
> >>>>>
> http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
> >>>>>
> >>>>> If you want a more optimised communication between flex and ofbiz,
> you
> >>>>> can
> >>>>> try BlazeDS:
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized
> >>>>>
> >>>>> Cheers,
> >>>>>
> >>>>> Chris
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> Abdullah Shaikh wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>> Hi All,
> >>>>>>
> >>>>>> I want to develop a flex application which will interact with ofbiz
> >>>>>> using
> >>>>>> xml.
> >>>>>>
> >>>>>> I just had a cursory view of xmlrpcclient & xmlserializer, has
> anybody
> >>>>>> done
> >>>>>> this ? what will be the best way to have ofbiz output xml ?
> >>>>>>
> >>>>>> I have seen that GenericValue can be easily converted to xml form.
> >>>>>>
> >>>>>> The request can be in xml form or can be a normal http request, but
> >>>>>> the
> >>>>>> response from ofbiz should be in xml form, for example something
> like
> >>>>>> this,
> >>>>>>
> >>>>>> <Orders>
> >>>>>> <Order id="1" status="Approved"/> - all the required fields
> >>>>>> <Order id="2" status="Created"/>
> >>>>>> </Orders>
> >>>>>>
> >>>>>> <Parties>
> >>>>>> <Party firstname="abc" lastname="xyz"> - all the required fields
> >>>>>> </Parties>
> >>>>>>
> >>>>>> This way we can have a flex application communicate with ofbiz using
> >>>>>> xml
> >>>>>> over http, I think flex don't understand json, so we need to go the
> >>>>>> xml
> >>>>>> way
> >>>>>> and also the benefits of xml is that with this approach ofbiz can
> >>>>>> interact
> >>>>>> with any kind of RIA technology.
> >>>>>>
> >>>>>>
> >>>>>> Thanks,
> >>>>>> Abdullah
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>
> >>
> >>
> >
> >
>
>
> --
> --
> Regards,
>
> Zhang Shiqian
>
> Wizitsoft Information Technology Ltd.
> www.wizitsoft.com | Phone: (8610)6267 0653 ext 604 | Mobile:
> (86)13264158885
>
Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Zhang Shiqian
In reply to this post by Chris Snow-3
1. Apply the service-wsdl.patch to your OFBIZ copy.
2. Export your service by add "export="true" in your service definition
file(services.xml), for example

<service name="getReverseAuctionPrice" engine="java" export="true"

             location=" ....
3. In the Flex mxml file, declare the web service

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/halo"
               creationComplete="initApp()">
<fx:Declarations>
        <s:WebService id="serviceId"
                      wsdl="
http://localhost:8080/webtools/control/SOAPService/getReverseAuctionPrice?WSDL
"
                      useProxy="false">
            <s:operation name="getReverseAuctionPrice"
result="flashReverseAuctionData(event)"
                         fault="showError(event)">
                <s:request>
                    <period>{period}</period>
                    <runMode>{runMode}</runMode>
                    <itemId>{itemId}</itemId>
                    <participants>{participants}</participants>
                    <newestBidTime>{newestBidTime}</newestBidTime>
                </s:request>
            </s:operation>
        </s:WebService>
    </fx:Declarations>

flashReverseAuctionData and showError are the callback method. period
and runMode are the parameters which bind to properties of the class.
<fx:Script>
        [Bindable]
        private var itemId:String;
        [Bindable]
        private var participants:String;
...


4. Create the callback method called by Flex webservice component.

private function showError(event:FaultEvent):void {

            Alert.show(event.fault.faultString);
        }
5. Call the service

try {

                serviceId.getReverseAuctionPrice();
            } catch(ex:Error) {
                Alert.show(ex.message);
            }
6. Manipulate the result

private function flashReverseAuctionData(event:ResultEvent):void {

            var bidsData = JSON.decode(event.result.toString());
            if(bidsDataStore==null ){
                bidsDataStore= bidsData;
            }else{
                 //TODO
            }
        }

Using as3corelib to deal with JSON format data





On Tue, Feb 2, 2010 at 1:05 PM, Christopher Snow <
[hidden email]> wrote:

> Hi Zhang,
>
> Would you be happy to provide some documentation on how to do this?
>
> Many thanks,
>
> Chris
>
>
> Zhang Shiqian wrote:
>
>> Ofbiz services can be exported as standard web services, you can use Flex
>> to
>> call the web services. We have developed some Flex components used in our
>> ofbiz applications run in this model, and introduced as3corelib to deal
>> with
>> JSON format data.
>>
>> On Tue, Feb 2, 2010 at 12:42 AM, Christopher Snow <
>> [hidden email]> wrote:
>>
>>
>>
>>> We are not automatically exporting objects with REST.
>>>
>>> We are exporting some services with REST.  Each one has to be manually
>>> coded.
>>>
>>> It would be nice to develop a solution to automatically export objects
>>> (entities), perhaps this would be relatively trivial using the new
>>> "entity-auto" service (i.e. CRuD service)?
>>>
>>>
>>>
>>>
>>> Abdullah Shaikh wrote:
>>>
>>>
>>>
>>>> Yes, thats good to have a separate component to handle xml over http,
>>>> REST
>>>> in your case.
>>>>
>>>> But I am not getting how are forming the url's, because in REST, urls
>>>> represents a objects.
>>>>
>>>> For example :
>>>>
>>>> http://ofbiz/partymgr/party/1234 - will represent a party whose id is
>>>> 1234
>>>>
>>>> http://ofbiz/partymgr/party/1234/addrress/5678 - will represent the
>>>> address
>>>> whose id is 5678 of party 1234
>>>>
>>>> I guess its difficult to have this sort of thing considering the number
>>>> of
>>>> functionality already build in ofbiz.
>>>>
>>>> or are you using REST but not following the each url represents an
>>>> object.
>>>>
>>>>
>>>> Thanks,
>>>> Abdullah
>>>>
>>>> On Mon, Feb 1, 2010 at 9:23 PM, Christopher Snow <
>>>> [hidden email]> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Sorry - just seen this.
>>>>> The approach we currently use is having a dedicated web app in ofbiz
>>>>> which
>>>>> is used to expose ofbiz services using REST (the organisation favors
>>>>> REST) .
>>>>>  We are using the jersey rest libraries.
>>>>>
>>>>> I believe our flex guy is using HTTPService to communicate with rest.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> chris
>>>>>
>>>>>
>>>>> Abdullah Shaikh wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Hi Chris,
>>>>>>
>>>>>> I don't want to use xml-rpc but instead would like to use Flex
>>>>>> HTTPService,
>>>>>> I guess xml-rpc would work with HTTPService.
>>>>>>
>>>>>> Basic idea is to create a xml over http communication between ofbiz &
>>>>>> any
>>>>>> other RIA, so that we can make ofbiz communicated with flex, gwt etc.
>>>>>>
>>>>>> I will have a look at the link provided.
>>>>>>
>>>>>> Thanks,
>>>>>> Abdullah
>>>>>>
>>>>>> On Mon, Feb 1, 2010 at 8:09 PM, Christopher Snow <
>>>>>> [hidden email]> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi Abdullah,
>>>>>>>
>>>>>>> On my current project, we initially used xml-rpc using a flex xmlrpc
>>>>>>> library sent to me by Andrew Zeneski.
>>>>>>>
>>>>>>> We had tried using the new ofbiz soap implementation, but it didn't
>>>>>>> play
>>>>>>> nicely with flex.
>>>>>>>
>>>>>>> Have a look at XMLRPC in the faq:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>>>>>>
>>>>>>> If you want a more optimised communication between flex and ofbiz,
>>>>>>> you
>>>>>>> can
>>>>>>> try BlazeDS:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>> Chris
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Abdullah Shaikh wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Hi All,
>>>>>>>>
>>>>>>>> I want to develop a flex application which will interact with ofbiz
>>>>>>>> using
>>>>>>>> xml.
>>>>>>>>
>>>>>>>> I just had a cursory view of xmlrpcclient & xmlserializer, has
>>>>>>>> anybody
>>>>>>>> done
>>>>>>>> this ? what will be the best way to have ofbiz output xml ?
>>>>>>>>
>>>>>>>> I have seen that GenericValue can be easily converted to xml form.
>>>>>>>>
>>>>>>>> The request can be in xml form or can be a normal http request, but
>>>>>>>> the
>>>>>>>> response from ofbiz should be in xml form, for example something
>>>>>>>> like
>>>>>>>> this,
>>>>>>>>
>>>>>>>> <Orders>
>>>>>>>> <Order id="1" status="Approved"/> - all the required fields
>>>>>>>> <Order id="2" status="Created"/>
>>>>>>>> </Orders>
>>>>>>>>
>>>>>>>> <Parties>
>>>>>>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>>>>>>> </Parties>
>>>>>>>>
>>>>>>>> This way we can have a flex application communicate with ofbiz using
>>>>>>>> xml
>>>>>>>> over http, I think flex don't understand json, so we need to go the
>>>>>>>> xml
>>>>>>>> way
>>>>>>>> and also the benefits of xml is that with this approach ofbiz can
>>>>>>>> interact
>>>>>>>> with any kind of RIA technology.
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Abdullah
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>>
>
>


--
--
Regards,

Zhang Shiqian

Wizitsoft Information Technology Ltd.
www.wizitsoft.com | Phone: (8610)6267 0653 ext 604 | Mobile: (86)13264158885
Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Zhang Shiqian
In your service you can return any format data, because json is simple and
small, so i adopted it.
You can user json-lib <http://www.json.org/java/> to format your java
object.

On Tue, Feb 2, 2010 at 3:47 PM, Zhang Shiqian
<[hidden email]>wrote:

> 1. Apply the service-wsdl.patch to your OFBIZ copy.
> 2. Export your service by add "export="true" in your service definition
> file(services.xml), for example
>
> <service name="getReverseAuctionPrice" engine="java" export="true"
>
>              location=" ....
> 3. In the Flex mxml file, declare the web service
>
>  <?xml version="1.0" encoding="utf-8"?>
> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>                xmlns:s="library://ns.adobe.com/flex/spark"
>                xmlns:mx="library://ns.adobe.com/flex/halo"
>                creationComplete="initApp()">
> <fx:Declarations>
>         <s:WebService id="serviceId"
>                       wsdl="
> http://localhost:8080/webtools/control/SOAPService/getReverseAuctionPrice?WSDL
> "
>                       useProxy="false">
>             <s:operation name="getReverseAuctionPrice"
> result="flashReverseAuctionData(event)"
>                          fault="showError(event)">
>                 <s:request>
>                     <period>{period}</period>
>                     <runMode>{runMode}</runMode>
>                     <itemId>{itemId}</itemId>
>                     <participants>{participants}</participants>
>                     <newestBidTime>{newestBidTime}</newestBidTime>
>                 </s:request>
>             </s:operation>
>         </s:WebService>
>     </fx:Declarations>
>
> flashReverseAuctionData and showError are the callback method. period
> and runMode are the parameters which bind to properties of the class.
> <fx:Script>
>         [Bindable]
>         private var itemId:String;
>         [Bindable]
>         private var participants:String;
> ...
>
>
> 4. Create the callback method called by Flex webservice component.
>
>  private function showError(event:FaultEvent):void {
>
>             Alert.show(event.fault.faultString);
>         }
> 5. Call the service
>
> try {
>
>                 serviceId.getReverseAuctionPrice();
>             } catch(ex:Error) {
>                 Alert.show(ex.message);
>             }
> 6. Manipulate the result
>
> private function flashReverseAuctionData(event:ResultEvent):void {
>
>             var bidsData = JSON.decode(event.result.toString());
>             if(bidsDataStore==null ){
>                 bidsDataStore= bidsData;
>             }else{
>                  //TODO
>             }
>         }
>
> Using as3corelib to deal with JSON format data
>
>
>
>
>
> On Tue, Feb 2, 2010 at 1:05 PM, Christopher Snow <
> [hidden email]> wrote:
>
>> Hi Zhang,
>>
>> Would you be happy to provide some documentation on how to do this?
>>
>> Many thanks,
>>
>> Chris
>>
>>
>> Zhang Shiqian wrote:
>>
>>> Ofbiz services can be exported as standard web services, you can use Flex
>>> to
>>> call the web services. We have developed some Flex components used in our
>>> ofbiz applications run in this model, and introduced as3corelib to deal
>>> with
>>> JSON format data.
>>>
>>> On Tue, Feb 2, 2010 at 12:42 AM, Christopher Snow <
>>> [hidden email]> wrote:
>>>
>>>
>>>
>>>> We are not automatically exporting objects with REST.
>>>>
>>>> We are exporting some services with REST.  Each one has to be manually
>>>> coded.
>>>>
>>>> It would be nice to develop a solution to automatically export objects
>>>> (entities), perhaps this would be relatively trivial using the new
>>>> "entity-auto" service (i.e. CRuD service)?
>>>>
>>>>
>>>>
>>>>
>>>> Abdullah Shaikh wrote:
>>>>
>>>>
>>>>
>>>>> Yes, thats good to have a separate component to handle xml over http,
>>>>> REST
>>>>> in your case.
>>>>>
>>>>> But I am not getting how are forming the url's, because in REST, urls
>>>>> represents a objects.
>>>>>
>>>>> For example :
>>>>>
>>>>> http://ofbiz/partymgr/party/1234 - will represent a party whose id is
>>>>> 1234
>>>>>
>>>>> http://ofbiz/partymgr/party/1234/addrress/5678 - will represent the
>>>>> address
>>>>> whose id is 5678 of party 1234
>>>>>
>>>>> I guess its difficult to have this sort of thing considering the number
>>>>> of
>>>>> functionality already build in ofbiz.
>>>>>
>>>>> or are you using REST but not following the each url represents an
>>>>> object.
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Abdullah
>>>>>
>>>>> On Mon, Feb 1, 2010 at 9:23 PM, Christopher Snow <
>>>>> [hidden email]> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Sorry - just seen this.
>>>>>> The approach we currently use is having a dedicated web app in ofbiz
>>>>>> which
>>>>>> is used to expose ofbiz services using REST (the organisation favors
>>>>>> REST) .
>>>>>>  We are using the jersey rest libraries.
>>>>>>
>>>>>> I believe our flex guy is using HTTPService to communicate with rest.
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> chris
>>>>>>
>>>>>>
>>>>>> Abdullah Shaikh wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi Chris,
>>>>>>>
>>>>>>> I don't want to use xml-rpc but instead would like to use Flex
>>>>>>> HTTPService,
>>>>>>> I guess xml-rpc would work with HTTPService.
>>>>>>>
>>>>>>> Basic idea is to create a xml over http communication between ofbiz &
>>>>>>> any
>>>>>>> other RIA, so that we can make ofbiz communicated with flex, gwt etc.
>>>>>>>
>>>>>>> I will have a look at the link provided.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Abdullah
>>>>>>>
>>>>>>> On Mon, Feb 1, 2010 at 8:09 PM, Christopher Snow <
>>>>>>> [hidden email]> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Hi Abdullah,
>>>>>>>>
>>>>>>>> On my current project, we initially used xml-rpc using a flex xmlrpc
>>>>>>>> library sent to me by Andrew Zeneski.
>>>>>>>>
>>>>>>>> We had tried using the new ofbiz soap implementation, but it didn't
>>>>>>>> play
>>>>>>>> nicely with flex.
>>>>>>>>
>>>>>>>> Have a look at XMLRPC in the faq:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>>>>>>>
>>>>>>>> If you want a more optimised communication between flex and ofbiz,
>>>>>>>> you
>>>>>>>> can
>>>>>>>> try BlazeDS:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>>
>>>>>>>> Chris
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Abdullah Shaikh wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Hi All,
>>>>>>>>>
>>>>>>>>> I want to develop a flex application which will interact with ofbiz
>>>>>>>>> using
>>>>>>>>> xml.
>>>>>>>>>
>>>>>>>>> I just had a cursory view of xmlrpcclient & xmlserializer, has
>>>>>>>>> anybody
>>>>>>>>> done
>>>>>>>>> this ? what will be the best way to have ofbiz output xml ?
>>>>>>>>>
>>>>>>>>> I have seen that GenericValue can be easily converted to xml form.
>>>>>>>>>
>>>>>>>>> The request can be in xml form or can be a normal http request, but
>>>>>>>>> the
>>>>>>>>> response from ofbiz should be in xml form, for example something
>>>>>>>>> like
>>>>>>>>> this,
>>>>>>>>>
>>>>>>>>> <Orders>
>>>>>>>>> <Order id="1" status="Approved"/> - all the required fields
>>>>>>>>> <Order id="2" status="Created"/>
>>>>>>>>> </Orders>
>>>>>>>>>
>>>>>>>>> <Parties>
>>>>>>>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>>>>>>>> </Parties>
>>>>>>>>>
>>>>>>>>> This way we can have a flex application communicate with ofbiz
>>>>>>>>> using
>>>>>>>>> xml
>>>>>>>>> over http, I think flex don't understand json, so we need to go the
>>>>>>>>> xml
>>>>>>>>> way
>>>>>>>>> and also the benefits of xml is that with this approach ofbiz can
>>>>>>>>> interact
>>>>>>>>> with any kind of RIA technology.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Abdullah
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
> --
> --
> Regards,
>
> Zhang Shiqian
>
> Wizitsoft Information Technology Ltd.
> www.wizitsoft.com | Phone: (8610)6267 0653 ext 604 | Mobile:
> (86)13264158885
>



--
--
Regards,

Zhang Shiqian

Wizitsoft Information Technology Ltd.
www.wizitsoft.com | Phone: (8610)6267 0653 ext 604 | Mobile: (86)13264158885
Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Chris Snow-3
In reply to this post by Zhang Shiqian
Many thanks! When I get a chance to look at this, are you happy for me
to put a formal write-up of this on the ofbiz wiki?

Zhang Shiqian wrote:

> 1. Apply the service-wsdl.patch to your OFBIZ copy.
> 2. Export your service by add "export="true" in your service definition
> file(services.xml), for example
>
> <service name="getReverseAuctionPrice" engine="java" export="true"
>
>              location=" ....
> 3. In the Flex mxml file, declare the web service
>
> <?xml version="1.0" encoding="utf-8"?>
> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>                xmlns:s="library://ns.adobe.com/flex/spark"
>                xmlns:mx="library://ns.adobe.com/flex/halo"
>                creationComplete="initApp()">
> <fx:Declarations>
>         <s:WebService id="serviceId"
>                       wsdl="
> http://localhost:8080/webtools/control/SOAPService/getReverseAuctionPrice?WSDL
> "
>                       useProxy="false">
>             <s:operation name="getReverseAuctionPrice"
> result="flashReverseAuctionData(event)"
>                          fault="showError(event)">
>                 <s:request>
>                     <period>{period}</period>
>                     <runMode>{runMode}</runMode>
>                     <itemId>{itemId}</itemId>
>                     <participants>{participants}</participants>
>                     <newestBidTime>{newestBidTime}</newestBidTime>
>                 </s:request>
>             </s:operation>
>         </s:WebService>
>     </fx:Declarations>
>
> flashReverseAuctionData and showError are the callback method. period
> and runMode are the parameters which bind to properties of the class.
> <fx:Script>
>         [Bindable]
>         private var itemId:String;
>         [Bindable]
>         private var participants:String;
> ...
>
>
> 4. Create the callback method called by Flex webservice component.
>
> private function showError(event:FaultEvent):void {
>
>             Alert.show(event.fault.faultString);
>         }
> 5. Call the service
>
> try {
>
>                 serviceId.getReverseAuctionPrice();
>             } catch(ex:Error) {
>                 Alert.show(ex.message);
>             }
> 6. Manipulate the result
>
> private function flashReverseAuctionData(event:ResultEvent):void {
>
>             var bidsData = JSON.decode(event.result.toString());
>             if(bidsDataStore==null ){
>                 bidsDataStore= bidsData;
>             }else{
>                  //TODO
>             }
>         }
>
> Using as3corelib to deal with JSON format data
>
>
>
>
>
> On Tue, Feb 2, 2010 at 1:05 PM, Christopher Snow <
> [hidden email]> wrote:
>
>  
>> Hi Zhang,
>>
>> Would you be happy to provide some documentation on how to do this?
>>
>> Many thanks,
>>
>> Chris
>>
>>
>> Zhang Shiqian wrote:
>>
>>    
>>> Ofbiz services can be exported as standard web services, you can use Flex
>>> to
>>> call the web services. We have developed some Flex components used in our
>>> ofbiz applications run in this model, and introduced as3corelib to deal
>>> with
>>> JSON format data.
>>>
>>> On Tue, Feb 2, 2010 at 12:42 AM, Christopher Snow <
>>> [hidden email]> wrote:
>>>
>>>
>>>
>>>      
>>>> We are not automatically exporting objects with REST.
>>>>
>>>> We are exporting some services with REST.  Each one has to be manually
>>>> coded.
>>>>
>>>> It would be nice to develop a solution to automatically export objects
>>>> (entities), perhaps this would be relatively trivial using the new
>>>> "entity-auto" service (i.e. CRuD service)?
>>>>
>>>>
>>>>
>>>>
>>>> Abdullah Shaikh wrote:
>>>>
>>>>
>>>>
>>>>        
>>>>> Yes, thats good to have a separate component to handle xml over http,
>>>>> REST
>>>>> in your case.
>>>>>
>>>>> But I am not getting how are forming the url's, because in REST, urls
>>>>> represents a objects.
>>>>>
>>>>> For example :
>>>>>
>>>>> http://ofbiz/partymgr/party/1234 - will represent a party whose id is
>>>>> 1234
>>>>>
>>>>> http://ofbiz/partymgr/party/1234/addrress/5678 - will represent the
>>>>> address
>>>>> whose id is 5678 of party 1234
>>>>>
>>>>> I guess its difficult to have this sort of thing considering the number
>>>>> of
>>>>> functionality already build in ofbiz.
>>>>>
>>>>> or are you using REST but not following the each url represents an
>>>>> object.
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Abdullah
>>>>>
>>>>> On Mon, Feb 1, 2010 at 9:23 PM, Christopher Snow <
>>>>> [hidden email]> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>> Sorry - just seen this.
>>>>>> The approach we currently use is having a dedicated web app in ofbiz
>>>>>> which
>>>>>> is used to expose ofbiz services using REST (the organisation favors
>>>>>> REST) .
>>>>>>  We are using the jersey rest libraries.
>>>>>>
>>>>>> I believe our flex guy is using HTTPService to communicate with rest.
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> chris
>>>>>>
>>>>>>
>>>>>> Abdullah Shaikh wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>> Hi Chris,
>>>>>>>
>>>>>>> I don't want to use xml-rpc but instead would like to use Flex
>>>>>>> HTTPService,
>>>>>>> I guess xml-rpc would work with HTTPService.
>>>>>>>
>>>>>>> Basic idea is to create a xml over http communication between ofbiz &
>>>>>>> any
>>>>>>> other RIA, so that we can make ofbiz communicated with flex, gwt etc.
>>>>>>>
>>>>>>> I will have a look at the link provided.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Abdullah
>>>>>>>
>>>>>>> On Mon, Feb 1, 2010 at 8:09 PM, Christopher Snow <
>>>>>>> [hidden email]> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>> Hi Abdullah,
>>>>>>>>
>>>>>>>> On my current project, we initially used xml-rpc using a flex xmlrpc
>>>>>>>> library sent to me by Andrew Zeneski.
>>>>>>>>
>>>>>>>> We had tried using the new ofbiz soap implementation, but it didn't
>>>>>>>> play
>>>>>>>> nicely with flex.
>>>>>>>>
>>>>>>>> Have a look at XMLRPC in the faq:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>>>>>>>
>>>>>>>> If you want a more optimised communication between flex and ofbiz,
>>>>>>>> you
>>>>>>>> can
>>>>>>>> try BlazeDS:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>>
>>>>>>>> Chris
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Abdullah Shaikh wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>>>>>> Hi All,
>>>>>>>>>
>>>>>>>>> I want to develop a flex application which will interact with ofbiz
>>>>>>>>> using
>>>>>>>>> xml.
>>>>>>>>>
>>>>>>>>> I just had a cursory view of xmlrpcclient & xmlserializer, has
>>>>>>>>> anybody
>>>>>>>>> done
>>>>>>>>> this ? what will be the best way to have ofbiz output xml ?
>>>>>>>>>
>>>>>>>>> I have seen that GenericValue can be easily converted to xml form.
>>>>>>>>>
>>>>>>>>> The request can be in xml form or can be a normal http request, but
>>>>>>>>> the
>>>>>>>>> response from ofbiz should be in xml form, for example something
>>>>>>>>> like
>>>>>>>>> this,
>>>>>>>>>
>>>>>>>>> <Orders>
>>>>>>>>> <Order id="1" status="Approved"/> - all the required fields
>>>>>>>>> <Order id="2" status="Created"/>
>>>>>>>>> </Orders>
>>>>>>>>>
>>>>>>>>> <Parties>
>>>>>>>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>>>>>>>> </Parties>
>>>>>>>>>
>>>>>>>>> This way we can have a flex application communicate with ofbiz using
>>>>>>>>> xml
>>>>>>>>> over http, I think flex don't understand json, so we need to go the
>>>>>>>>> xml
>>>>>>>>> way
>>>>>>>>> and also the benefits of xml is that with this approach ofbiz can
>>>>>>>>> interact
>>>>>>>>> with any kind of RIA technology.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Abdullah
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                  
>>>>>>>>                
>>>>>>>
>>>>>>>              
>>>>>>            
>>>>>
>>>>>          
>>>>        
>>>
>>>
>>>      
>>    
>
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: xml engine / handler

Zhang Shiqian
Very happy :)

On Tue, Feb 2, 2010 at 5:33 PM, Christopher Snow <
[hidden email]> wrote:

> Many thanks! When I get a chance to look at this, are you happy for me to
> put a formal write-up of this on the ofbiz wiki?
>
>
> Zhang Shiqian wrote:
>
>> 1. Apply the service-wsdl.patch to your OFBIZ copy.
>> 2. Export your service by add "export="true" in your service definition
>> file(services.xml), for example
>>
>> <service name="getReverseAuctionPrice" engine="java" export="true"
>>
>>             location=" ....
>> 3. In the Flex mxml file, declare the web service
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>>               xmlns:s="library://ns.adobe.com/flex/spark"
>>               xmlns:mx="library://ns.adobe.com/flex/halo"
>>               creationComplete="initApp()">
>> <fx:Declarations>
>>        <s:WebService id="serviceId"
>>                      wsdl="
>>
>> http://localhost:8080/webtools/control/SOAPService/getReverseAuctionPrice?WSDL
>> "
>>                      useProxy="false">
>>            <s:operation name="getReverseAuctionPrice"
>> result="flashReverseAuctionData(event)"
>>                         fault="showError(event)">
>>                <s:request>
>>                    <period>{period}</period>
>>                    <runMode>{runMode}</runMode>
>>                    <itemId>{itemId}</itemId>
>>                    <participants>{participants}</participants>
>>                    <newestBidTime>{newestBidTime}</newestBidTime>
>>                </s:request>
>>            </s:operation>
>>        </s:WebService>
>>    </fx:Declarations>
>>
>> flashReverseAuctionData and showError are the callback method. period
>> and runMode are the parameters which bind to properties of the class.
>> <fx:Script>
>>        [Bindable]
>>        private var itemId:String;
>>        [Bindable]
>>        private var participants:String;
>> ...
>>
>>
>> 4. Create the callback method called by Flex webservice component.
>>
>> private function showError(event:FaultEvent):void {
>>
>>            Alert.show(event.fault.faultString);
>>        }
>> 5. Call the service
>>
>> try {
>>
>>                serviceId.getReverseAuctionPrice();
>>            } catch(ex:Error) {
>>                Alert.show(ex.message);
>>            }
>> 6. Manipulate the result
>>
>> private function flashReverseAuctionData(event:ResultEvent):void {
>>
>>            var bidsData = JSON.decode(event.result.toString());
>>            if(bidsDataStore==null ){
>>                bidsDataStore= bidsData;
>>            }else{
>>                 //TODO
>>            }
>>        }
>>
>> Using as3corelib to deal with JSON format data
>>
>>
>>
>>
>>
>> On Tue, Feb 2, 2010 at 1:05 PM, Christopher Snow <
>> [hidden email]> wrote:
>>
>>
>>
>>> Hi Zhang,
>>>
>>> Would you be happy to provide some documentation on how to do this?
>>>
>>> Many thanks,
>>>
>>> Chris
>>>
>>>
>>> Zhang Shiqian wrote:
>>>
>>>
>>>
>>>> Ofbiz services can be exported as standard web services, you can use
>>>> Flex
>>>> to
>>>> call the web services. We have developed some Flex components used in
>>>> our
>>>> ofbiz applications run in this model, and introduced as3corelib to deal
>>>> with
>>>> JSON format data.
>>>>
>>>> On Tue, Feb 2, 2010 at 12:42 AM, Christopher Snow <
>>>> [hidden email]> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> We are not automatically exporting objects with REST.
>>>>>
>>>>> We are exporting some services with REST.  Each one has to be manually
>>>>> coded.
>>>>>
>>>>> It would be nice to develop a solution to automatically export objects
>>>>> (entities), perhaps this would be relatively trivial using the new
>>>>> "entity-auto" service (i.e. CRuD service)?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Abdullah Shaikh wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Yes, thats good to have a separate component to handle xml over http,
>>>>>> REST
>>>>>> in your case.
>>>>>>
>>>>>> But I am not getting how are forming the url's, because in REST, urls
>>>>>> represents a objects.
>>>>>>
>>>>>> For example :
>>>>>>
>>>>>> http://ofbiz/partymgr/party/1234 - will represent a party whose id is
>>>>>> 1234
>>>>>>
>>>>>> http://ofbiz/partymgr/party/1234/addrress/5678 - will represent the
>>>>>> address
>>>>>> whose id is 5678 of party 1234
>>>>>>
>>>>>> I guess its difficult to have this sort of thing considering the
>>>>>> number
>>>>>> of
>>>>>> functionality already build in ofbiz.
>>>>>>
>>>>>> or are you using REST but not following the each url represents an
>>>>>> object.
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Abdullah
>>>>>>
>>>>>> On Mon, Feb 1, 2010 at 9:23 PM, Christopher Snow <
>>>>>> [hidden email]> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Sorry - just seen this.
>>>>>>> The approach we currently use is having a dedicated web app in ofbiz
>>>>>>> which
>>>>>>> is used to expose ofbiz services using REST (the organisation favors
>>>>>>> REST) .
>>>>>>>  We are using the jersey rest libraries.
>>>>>>>
>>>>>>> I believe our flex guy is using HTTPService to communicate with rest.
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>> chris
>>>>>>>
>>>>>>>
>>>>>>> Abdullah Shaikh wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Hi Chris,
>>>>>>>>
>>>>>>>> I don't want to use xml-rpc but instead would like to use Flex
>>>>>>>> HTTPService,
>>>>>>>> I guess xml-rpc would work with HTTPService.
>>>>>>>>
>>>>>>>> Basic idea is to create a xml over http communication between ofbiz
>>>>>>>> &
>>>>>>>> any
>>>>>>>> other RIA, so that we can make ofbiz communicated with flex, gwt
>>>>>>>> etc.
>>>>>>>>
>>>>>>>> I will have a look at the link provided.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Abdullah
>>>>>>>>
>>>>>>>> On Mon, Feb 1, 2010 at 8:09 PM, Christopher Snow <
>>>>>>>> [hidden email]> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Hi Abdullah,
>>>>>>>>>
>>>>>>>>> On my current project, we initially used xml-rpc using a flex
>>>>>>>>> xmlrpc
>>>>>>>>> library sent to me by Andrew Zeneski.
>>>>>>>>>
>>>>>>>>> We had tried using the new ofbiz soap implementation, but it didn't
>>>>>>>>> play
>>>>>>>>> nicely with flex.
>>>>>>>>>
>>>>>>>>> Have a look at XMLRPC in the faq:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> http://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo
>>>>>>>>>
>>>>>>>>> If you want a more optimised communication between flex and ofbiz,
>>>>>>>>> you
>>>>>>>>> can
>>>>>>>>> try BlazeDS:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> http://langhua.org/portal/portal/default/OFBiz/OFBizBlazeDSModulePortletWindow?windowstate=maximized
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>>
>>>>>>>>> Chris
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Abdullah Shaikh wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Hi All,
>>>>>>>>>>
>>>>>>>>>> I want to develop a flex application which will interact with
>>>>>>>>>> ofbiz
>>>>>>>>>> using
>>>>>>>>>> xml.
>>>>>>>>>>
>>>>>>>>>> I just had a cursory view of xmlrpcclient & xmlserializer, has
>>>>>>>>>> anybody
>>>>>>>>>> done
>>>>>>>>>> this ? what will be the best way to have ofbiz output xml ?
>>>>>>>>>>
>>>>>>>>>> I have seen that GenericValue can be easily converted to xml form.
>>>>>>>>>>
>>>>>>>>>> The request can be in xml form or can be a normal http request,
>>>>>>>>>> but
>>>>>>>>>> the
>>>>>>>>>> response from ofbiz should be in xml form, for example something
>>>>>>>>>> like
>>>>>>>>>> this,
>>>>>>>>>>
>>>>>>>>>> <Orders>
>>>>>>>>>> <Order id="1" status="Approved"/> - all the required fields
>>>>>>>>>> <Order id="2" status="Created"/>
>>>>>>>>>> </Orders>
>>>>>>>>>>
>>>>>>>>>> <Parties>
>>>>>>>>>> <Party firstname="abc" lastname="xyz"> - all the required fields
>>>>>>>>>> </Parties>
>>>>>>>>>>
>>>>>>>>>> This way we can have a flex application communicate with ofbiz
>>>>>>>>>> using
>>>>>>>>>> xml
>>>>>>>>>> over http, I think flex don't understand json, so we need to go
>>>>>>>>>> the
>>>>>>>>>> xml
>>>>>>>>>> way
>>>>>>>>>> and also the benefits of xml is that with this approach ofbiz can
>>>>>>>>>> interact
>>>>>>>>>> with any kind of RIA technology.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> Abdullah
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>>
>
>


--
--
Regards,

Zhang Shiqian

Wizitsoft Information Technology Ltd.
www.wizitsoft.com | Phone: (8610)6267 0653 ext 604 | Mobile: (86)13264158885