org.apache.axis2.AxisFault:无效的XML

时间:2016-01-22 06:31:35

标签: java mage

我正在尝试通过magja将图像添加到magento中的产品中,并且我得到了无效的xml错误 以下是处理图像插入的代码。 任何人都可以告诉我,为什么我会收到此错误。

byte [] data = MagjaFileUtils.getBytesFromFileURL(" http://img.bbystatic.com/BestBuy_US/images/products/2178/2178004_sd.jpg");

        Media image = new Media();
        image.setName("google");
        image.setMime("image/jpeg");
        image.setData(data);

        Set<ProductMedia.Type> types = ImmutableSet.of(ProductMedia.Type.IMAGE, ProductMedia.Type.SMALL_IMAGE);

        ProductMedia media = new ProductMedia();
        media.setExclude(false);
        media.setImage(image);
        media.setLabel("Image for Product");
        media.setPosition(1);
        media.setTypes(types);
        media.setProduct(product);
      product.addMedia(media);`
  

2016-01-22 11:48:51错误ProductMediaRemoteServiceImpl:528 -   org.apache.axis2.AxisFault:无效的XML       at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)       at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)       在org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)       at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)       在org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)       在org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:555)       在org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:531)       在com.google.code.magja.soap.MagentoSoapClient.call(MagentoSoapClient.java:253)       在com.google.code.magja.soap.MagentoSoapClient.callArgs(MagentoSoapClient.java:213)       在com.google.code.magja.service.product.ProductMediaRemoteServiceImpl.create(ProductMediaRemoteServiceImpl.java:213)       在com.niveus.integrator.test.MagentoProductClient.generateProduct(MagentoProductClient.java:139)       在com.niveus.integrator.test.MagentoProductClient.testGetByIdAndSku(MagentoProductClient.java:43)       在com.niveus.integrator.test.MagentoProductClient.main(MagentoProductClient.java:151)   无法将媒体添加到产品

0 个答案:

没有答案