You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Rajesh Kumar Mallah (JIRA)" <ji...@apache.org> on 2018/04/03 15:01:00 UTC

[jira] [Commented] (OFBIZ-10317) Allowing XML-RPC and SOAP to pass GenericValue objects to services as IN fields

    [ https://issues.apache.org/jira/browse/OFBIZ-10317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16424141#comment-16424141 ] 

Rajesh Kumar Mallah commented on OFBIZ-10317:
---------------------------------------------

 

 

Hi Taher ,

Below is one of the ways to replicate it using curl

 

 

below is a simple call to findPartiesById to ensure that the command below is a valid way of
invoking  a XML-RPC service.

{{$ curl -X POST -H "Content-Type: text/xml" -d @working.xml   [https://ofbizhost.com/webtools/control/xmlrpc]}}

 

Below is an attempt  to invoke calculateProductPrice by sending a struct and it is expected to 
raise error in current state of software. please note  product ID *ENCHILADAS* is a part of current demo data set.

 $ curl -X POST  -H "Content-Type: text/xml"  -d @not-working.xml  {{[https://ofbizhost.com/webtools/control/xmlrpc]}}

 

this currently responds with:

<?xml version="1.0" encoding="UTF-8"?><methodResponse xmlns:ex="http://ws.apache.org/xmlrpc/namespaces/extensions"><fault><value><struct><member><name>faultCode</name><value><i4>0</i4></value></member><member><name>faultString</name><value>Type check failed for field [calculateProductPrice.product]; expected type is [org.apache.ofbiz.entity.GenericValue]; actual type is [java.util.HashMap]</value></member></struct></value></fault></methodResponse>

 

*Expected Result:* A XML representing the valid price of the the product.

 

[^working.xml]

[^not-working.xml]

> Allowing XML-RPC and SOAP to pass GenericValue objects to services as IN fields
> -------------------------------------------------------------------------------
>
>                 Key: OFBIZ-10317
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10317
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework/webtools
>    Affects Versions: 16.11.04
>            Reporter: Rajesh Kumar Mallah
>            Priority: Major
>         Attachments: not-working.xml, working.xml
>
>
>  
> The existing framework allows invoking  various services via XMLRPC or SOAP 
> as per their argument expectations. However only basic types are handled
> like String , Boolean , Int etc. If a service is expecting a GenericValue eg: 'calculateProductPrice'   it is not possible to invoke it via SOAP or XMLRPC.
> The reason being SOAP or XMLRPC can support Map and that is the closest 
> it can provide in lieu of any custom Object that a Service might be expecting.
> A generic solution needs to be found so that the full potential of the plethora of 
> exportable services can be utilized by external systems that looks for integrating and 
> banking upon OfBiz via XMLRPC or SOAP.
> h6. related Threads:
> [How to pass org.apache.ofbiz.entity.GenericValue using XMLRPC]
> [https://markmail.org/message/dwako4nsu4h3zgmu] [ dev ]
> [https://markmail.org/message/iuffmakor3ru2yce] [user]
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)