Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update method is not working in product case #28

Open
rahman973 opened this issue Feb 7, 2020 · 0 comments
Open

update method is not working in product case #28

rahman973 opened this issue Feb 7, 2020 · 0 comments

Comments

@rahman973
Copy link

Map<String, Object> productInfo = new HashMap<>();
        productInfo.put("id", t1.getId());
        productInfo.put("name", p1.getName());
        productInfo.put("regular_price", String.valueOf(price1));
        //image
        productInfo.put("sku",p1.getBarcode());
        productInfo.put("description", p1.getDescription());
        Map product=   wooCommerce.update(EndpointBaseType.PRODUCTS.getValue(),t1.getId(), productInfo);
        System.out.println(product.get("id"));

it is not working while everything in debugger is showing fine. if I sue the above same code for creating product just by changing the value from update to create and removing id from map.

the error which is being recived on post man is following

Request processing failed; nested exception is java.lang.RuntimeException:
		org.apache.http.NoHttpResponseException: appropriative-holde.000webhostapp.com:443 failed to respond</p>
	<p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.
<p><b>Root Cause</b></p>
	<pre>java.lang.RuntimeException: org.apache.http.NoHttpResponseException: appropriative-holde.000webhostapp.com:443 failed to respond
	com.icoderman.woocommerce.DefaultHttpClient.getEntityAndReleaseConnection(DefaultHttpClient.java:129)
	com.icoderman.woocommerce.DefaultHttpClient.postEntity(DefaultHttpClient.java:100)
	com.icoderman.woocommerce.DefaultHttpClient.put(DefaultHttpClient.java:76)
	com.icoderman.woocommerce.WooCommerceAPI.update(WooCommerceAPI.java:51)
	com.bmis.app.controller.WoocommerceController.updateWooProduct(WoocommerceController.java:179)
	com.bmis.app.controller.WoocommerceController.checkEitherToCreateOrUpdateProduct(WoocommerceController.java:150)
	com.bmis.app.controller.WoocommerceController.run(WoocommerceController.java:187)
	com.bmis.app.controller.WoocommerceController.getAllSettings(WoocommerceController.java:70)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant