Problem with WebService Query on Organizations - It only gives 2 results with small ID numbers

45 views
Skip to first unread message

Frank-J

unread,
Mar 30, 2020, 3:30:41 PM3/30/20
to iDempiere
Hello to the community,

We are using the query webservice to access the IDs of existing organizational units based on their name. The same procedure works well for the users to query their IDs. The weird thing is that the query only results in 2 values: Org.-IDs 11 and 12 which are HQ and Store Central.
All other organzizational units cannot be accessed by the web service.

I have tested it with two systems. One is the idempiere test server: https://test.idempiere.org. The following requests and results were tested with this testserver. Postman Post to: https://test.idempiere.org/ADInterface/services/ModelADService?wsdl
Here I get the same results than with our system.

The webservices I added are:        queryOrganization   (resulting in 2 while expecting 8 (5 stores and the other 3 org-units)
                   and for comparison:    query User              (which results in 9 of 11 Users only ommitting the System and SuperUser which is ok)

Here is the result of my postman request (followed by the request itself):

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <ns1:queryDataResponse xmlns:ns1="http://idempiere.org/ADInterface/1_0">
            <WindowTabData xmlns="http://idempiere.org/ADInterface/1_0" NumRows="2" TotalRows="2" StartRow="0">
                <DataSet>
                    <DataRow>
                        <field column="Name">
                            <val>HQ</val>
                        </field>
                        <field column="AD_Client_ID">
                            <val>11</val>
                        </field>
                        <field column="AD_Org_ID">
                            <val>11</val>
                        </field>
                    </DataRow>
                    <DataRow>
                        <field column="Name">
                            <val>Store Central</val>
                        </field>
                        <field column="AD_Client_ID">
                            <val>11</val>
                        </field>
                        <field column="AD_Org_ID">
                            <val>12</val>
                        </field>
                    </DataRow>
                </DataSet>
                <RowCount>2</RowCount>
                <Success>true</Success>
            </WindowTabData>
        </ns1:queryDataResponse>
    </soap:Body>
</soap:Envelope>


This is the request itself:

 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:_0="http://idempiere.org/ADInterface/1_0">
   <soapenv:Header/>
   <soapenv:Body>
     <_0:queryData>
       <_0:ModelCRUDRequest>
         <_0:ModelCRUD>
           <_0:serviceType>queryOrganization</_0:serviceType>
           <_0:TableName>AD_Org</_0:TableName>
         </_0:ModelCRUD>
         <_0:ADLoginRequest>
           <_0:user>webservice @ gardenworld.com</_0:user>
           <_0:pass>System</_0:pass>
           <_0:lang>en_US</_0:lang>
           <_0:ClientID>11</_0:ClientID>
           <_0:RoleID>50004</_0:RoleID>
           <_0:OrgID>11</_0:OrgID>
           <_0:WarehouseID>103</_0:WarehouseID>
           <_0:stage>0</_0:stage>
         </_0:ADLoginRequest>
       </_0:ModelCRUDRequest>
     </_0:queryData>
   </soapenv:Body>
 </soapenv:Envelope>

-------------End of XML Message here-----------------------------

I am wondering, if there is something like a not complete index or similar in the database which can be repaired? Or there may be some other inconsistency in the organization data of Garden World, but to me this seems not very likely.

So I would be happy to get (good) advice how to solve this problem. If I left out any information required for further investigation, please, do not hesitate to ask me.

Best regards

Frank

Mohamed Dernoun

unread,
Mar 31, 2020, 6:37:15 AM3/31/20
to iDempiere
because the role you are trying to access with has only access to two organizations , i added another role and tried with this request i got all organizations

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:_0="http://idempiere.org/ADInterface/1_0">
   
<soapenv:Header/>
   
<soapenv:Body>

     <_0:queryData>
       <_0:ModelCRUDRequest>
         <_0:ModelCRUD>
           <_0:serviceType>queryOrganization</_0:serviceType>
           <_0:TableName>AD_Org</_0:TableName>
         </_0:ModelCRUD>
         <_0:ADLoginRequest>
           <_0:user>superuser @ idempiere.com</_0:user>

           <_0:pass>System</_0:pass>
           <_0:ClientID>11</_0:ClientID>
           <_0:RoleID>102</_0:RoleID>
           <_0:OrgID>0</_0:OrgID>

           <_0:stage>0</_0:stage>
         </_0:ADLoginRequest>
       </_0:ModelCRUDRequest>
     </_0:queryData>
   
</soapenv:Body>
 
</soapenv:Envelope>


Frank-J

unread,
Mar 31, 2020, 10:35:28 AM3/31/20
to iDempiere
Dear Mohamed,

thank you very much. With this idea I could easily change the configuration of the webservice as we need it.
iDempiere sometimes has much more dimensions that one has in mind ;-)

Best regards,
Frank
Reply all
Reply to author
Forward
0 new messages