Magneto Integration  Topic is solved

Find general Jiwa support here.

Magneto Integration

Postby Ahmed » Mon Feb 29, 2016 4:10 pm

Hi,

Im trying to integrate Magento & Jiwa. I followed all the steps here https://wiki.jiwa.com.au/index.php?titl ... ion_Plugin & successfully integrated both.
If I try to export Jiwa categories its working fine for me, but the issue is when I try to Export Jiwa Inventory Items it throws an error
The number of bytes available is inconsistent with the HTTP Content-Length header. There may have been a network error or the client may be sending invalid requests.

Please tell me what Im doing wrong or what I should do to make it working.

Thanks & Regards
Ahmed
Occasional Contributor
Occasional Contributor
 
Posts: 14
Joined: Fri Feb 26, 2016 9:26 pm

Re: Magneto Integration

Postby Mike.Sheen » Mon Feb 29, 2016 4:52 pm

Ahmed wrote:when I try to Export Jiwa Inventory Items it throws an error
The number of bytes available is inconsistent with the HTTP Content-Length header. There may have been a network error or the client may be sending invalid requests.

Please tell me what Im doing wrong or what I should do to make it working.


Hi Ahmed,

What version of Magento are you using?
What version of Jiwa are you using?

The plugin was built and tested against Magento 1.9.x. and is supported on release builds of Jiwa version 07.00.149.00 or later.

Can you confirm you get the same error when exporting products from the Jiwa Demo database to a test version of your Magento store?


Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Magneto Integration

Postby Ahmed » Mon Feb 29, 2016 5:11 pm

Mike.Sheen wrote:
Ahmed wrote:when I try to Export Jiwa Inventory Items it throws an error
The number of bytes available is inconsistent with the HTTP Content-Length header. There may have been a network error or the client may be sending invalid requests.

Please tell me what Im doing wrong or what I should do to make it working.


Hi Ahmed,

What version of Magento are you using?
What version of Jiwa are you using?

The plugin was built and tested against Magento 1.9.x. and is supported on release builds of Jiwa version 07.00.149.00 or later.

Can you confirm you get the same error when exporting products from the Jiwa Demo database to a test version of your Magento store?


Mike



Hello Mike,

Thank you for the quick reply.

As recommended in documentation Im using Magento 1.9.2.2 & Latest version of Jiwa 7.0.149

Regards
Ahmed
Occasional Contributor
Occasional Contributor
 
Posts: 14
Joined: Fri Feb 26, 2016 9:26 pm

Re: Magneto Integration

Postby Mike.Sheen » Mon Feb 29, 2016 6:43 pm

Ahmed wrote:As recommended in documentation Im using Magento 1.9.2.2 & Latest version of Jiwa 7.0.149


Ok, great.

I asked this:

Mike.Sheen wrote:Can you confirm you get the same error when exporting products from the Jiwa Demo database to a test version of your Magento store?


Because I wanted to know if it's something particular about your data which is causing the issue (such as really large images attempting to be transmitted to the store).

Either way we'll still need to work out the issue, but it would be nice to know if the Demo data works or not.

Try changing the logging level to "Verbose" for the export of the products - and post the results of the log when running the export. It will help isolate the area causing the issue.

After that - we come to a question about you: How's your C# skills? I don't know who you are or what skills you have - but if you're a developer I'd recommend the following from there:
  • Setup an environment with both Jiwa 7.00.149.00 installed and Visual Studio (2015 recommended, even the express / community edition is fine)
  • Add a System.Diagnostics.Debugger.Break() in the plugin code in the part where it dequeues inventory items from Jiwa to export to the store
  • Run the export of products and the breakpoint will be hit
  • Step through the code until the error occurs - report back here the part of the plugin which caused the error.


If you're not a developer or can't step through the plugin code in a dev environment then we'll probably need to do that for you to work out the issue.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Magneto Integration

Postby Ahmed » Mon Feb 29, 2016 7:09 pm

Hi Mike,

Im a magento developer. I will install visual studio & try to setup environment if necessary ?

Please check the Magento log data

id Magento_Integration_RecID LogDateTime LogType IntegrationActionName ElapsedMilliseconds LogMessage
1017 647BC2BA-.. 2016-02-29 12:57:15.553 3 Export Jiwa Inventory Items 11437 START 'Export Jiwa Inventory Items'
1018 647BC2BA-.. 2016-02-29 12:57:15.863 3 Export Jiwa Inventory Items 11962 Found 20 items in queue 'Jiwa Inventory'
1019 647BC2BA-.. 2016-02-29 12:57:15.867 3 Export Jiwa Inventory Items 11972 Reading customer group list from Magento
1020 647BC2BA-.. 2016-02-29 12:57:27.283 3 Export Jiwa Inventory Items 23384 Finished reading customer group list from Magento
1021 647BC2BA-.. 2016-02-29 12:57:27.293 3 Export Jiwa Inventory Items 23394 Retrieving Catalog tree from magento
1022 647BC2BA-.. 2016-02-29 12:57:41.640 0 Export Jiwa Inventory Items 37730 The number of bytes available is inconsistent with the HTTP Content-Length header. There may have been a network error or the client may be sending invalid requests.
1023 647BC2BA-.. 2016-02-29 12:57:41.663 3 Export Jiwa Inventory Items 37752 END 'Export Jiwa Inventory Items'
Ahmed
Occasional Contributor
Occasional Contributor
 
Posts: 14
Joined: Fri Feb 26, 2016 9:26 pm

Re: Magneto Integration

Postby Mike.Sheen » Mon Feb 29, 2016 8:58 pm

Ahmed wrote:I will install visual studio & try to setup environment if necessary ?


Ok, but before you do your log reveals something:

Ahmed wrote:
id Magento_Integration_RecID LogDateTime LogType IntegrationActionName ElapsedMilliseconds LogMessage
1017 647BC2BA-.. 2016-02-29 12:57:15.553 3 Export Jiwa Inventory Items 11437 START 'Export Jiwa Inventory Items'
1018 647BC2BA-.. 2016-02-29 12:57:15.863 3 Export Jiwa Inventory Items 11962 Found 20 items in queue 'Jiwa Inventory'
1019 647BC2BA-.. 2016-02-29 12:57:15.867 3 Export Jiwa Inventory Items 11972 Reading customer group list from Magento
1020 647BC2BA-.. 2016-02-29 12:57:27.283 3 Export Jiwa Inventory Items 23384 Finished reading customer group list from Magento
1021 647BC2BA-.. 2016-02-29 12:57:27.293 3 Export Jiwa Inventory Items 23394 Retrieving Catalog tree from magento
1022 647BC2BA-.. 2016-02-29 12:57:41.640 0 Export Jiwa Inventory Items 37730 The number of bytes available is inconsistent with the HTTP Content-Length header. There may have been a network error or the client may be sending invalid requests.
1023 647BC2BA-.. 2016-02-29 12:57:41.663 3 Export Jiwa Inventory Items 37752 END 'Export Jiwa Inventory Items'


The problem is in getting the Magento categories - I'm not able to say why as yet, but that is where we should be looking. The plugin does this before exporting products so we can provide Magento with the correct category id's.

The error is occurring when the plugin invokes the catalogCategoryTree API method. As it does this after almost 15 seconds after the log showed it was about to get the categories, and no timeout error is shown, I can only assume it had a problem deserialising the categories.

I'll need to know the details of the Magento store so I can test this myself - you should PM me those details if you want me to continue to troubleshoot, as it's not appropriate to post the host, API key and password here.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Magneto Integration

Postby Ahmed » Mon Feb 29, 2016 9:19 pm

API Info & magento store details sent.

Thanks
Ahmed
Occasional Contributor
Occasional Contributor
 
Posts: 14
Joined: Fri Feb 26, 2016 9:26 pm

Re: Magneto Integration

Postby Ahmed » Tue Mar 01, 2016 9:26 pm

Mike.Sheen wrote:I'll need to know the details of the Magento store so I can test this myself - you should PM me those details if you want me to continue to troubleshoot, as it's not appropriate to post the host, API key and password here.


Hi Mike,

Detail sent via PM, waiting for your reply.

Thanks & Regards
Ahmed
Occasional Contributor
Occasional Contributor
 
Posts: 14
Joined: Fri Feb 26, 2016 9:26 pm

Re: Magneto Integration  Topic is solved

Postby Mike.Sheen » Wed Mar 09, 2016 10:11 am

Sorry for the delayed response - I've had a chance to look at this and there is something wrong at your end.

To eliminate the plugin as being an issue, I used a tool called SOAPUI. The version I am using is 5.2.1.

To get a positive result, I first pointed SOAP UI at the Jiwa sample web store to make sure I could get the CatalogTree:

Step 1.
Open SOAP UI and create a new SOAP project by selecting the "Create New SOAP Project" button:
Step1-NewSOAP.PNG
Create New Project
Step1-NewSOAP.PNG (15.58 KiB) Viewed 10926 times


Step 2.
Enter the WSDL URL in the New SOAP Project dialog - note that it's different to the store URL - replace /index with ?wsdl=1 at the end of the URL. Make sure "Create Requests" is checked:
Step2-SetWSDL.PNG
New SOAP Project Dialog
Step2-SetWSDL.PNG (21.46 KiB) Viewed 10926 times


Step 3.
Locate the login request in the tree on the left - expand it and double-click the "Request 1" to open the request dialog. Replace the ? in the username and apiKey tags with the appropriate values. Press the Submit button (green arrow at the top left) to submit the request. The right hand pane will show the response - it contains the SessionId in the "loginReturn" tag - copy that as we need it for the next step.
Step3-Login.PNG
Login Request and Response


Step 4.
Locate the catalogCategoryTree request in the tree on the left - expand it and double-click the "Request 1" to open the request dialog. Replace the ? in the sessionId tag with the value we got in the response from the previous step. Remove the ParentId and StoreView tags altogether (the plugin passes null for these values, so removing them simulates this). Press the Submit button (green arrow at the top left) to submit the request. The right hand pane will show the response - in this case with the Jiwa demo webstore the values are shown as expected.
Step4-GetCategoryTree.PNG
Catalog Category Tree Request and Response


Now, when I repeat this process with the details you provided for your store, I get either a fault or an empty response. When I get a fault it suggests in the response to check the logs.

So - you should turn on some logging and see what you can find there. Use a tool such as SOAP UI to test the requests as outlined above to speed up the debugging process.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Magneto Integration

Postby Ahmed » Thu Mar 10, 2016 12:48 am

Brilliant :)

When I tried to debug the SOAP request as you suggested the logs were populating this error : "An error occured [Premature end of Content-Length delimited message body (expected: 65878; received: 65877], see error log for details"

So I override the class : /app/core/Mage/Api/Model/Server/V2/Adapter/Soap.php
And changed the code line of code in try {}

Code: Select all
 ->setHeader('Content-Length',strlen($content)-1,true)


And it worked. Its not the best solution but I don't know why magento is adding extra character when it returns the content. Will find proper reason & update here.

Thanks
Ahmed
Occasional Contributor
Occasional Contributor
 
Posts: 14
Joined: Fri Feb 26, 2016 9:26 pm

Next

Return to Core Product Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron