用C#Magento的SOAP API V2:问题与需要HTTP认证店 [英] Magento SOAP API V2 with C#: Issue with Stores that Require HTTP Authentication

查看:215
本文介绍了用C#Magento的SOAP API V2:问题与需要HTTP认证店的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经修订的课题结果
我已经修改了原来的问题(如下图所示),这样的回答,我可以标记问题的一部分。所以这里有云:我搜索已经建立进口来自客户的商店(Magento的)销售订单集成到我们的传统订单处理系统的工具。我有五家来自进口。其中一人在其商店HTTP验证集和我的API登录失败,因为这个原因。我该如何突破这个



搜索结果原来的问题(标题:从Magento的使用C#导入销售订单:有XML文档(错误2 ,372)):结果
结果我建立了一个工具来导入客户店(Magento的)销售订单集成到我们的传统订单处理系统。我有五家来自进口。三做工精细。




  • 问题1:的salesOrderList()调用抛出了这个异常>


    'System.InvalidOperationException'类型的第一次机会异常出现在system.xml.dll的



    有是XML文档(2,372)错误。




    登录成功,我能枚举属性值,等
    但是我无法运行任何
    滤波器 salesOrderList()函数(太)。 ,这将是巨大的,如果有人有经验的
    这点,可以点我在正确的方向


  • 问题2:第五个商店有 HTTP授权来访问它的
    主要Magento的页面。我只用API的用户名和API密钥的工作。
    但它看起来像我有过HTTP授权障碍
    获得的API登录阶段。在登录() Magento的网络
    服务的功能,只需要API的用户名和API密钥。不知道如何
    处理HTTP认证的额外的一层。谁能帮助?


解决方案

这会经常发生,你只是很幸运,这是第一你有这个问题的时间。



您可以用什么做的提琴手验证你为什么要接受一个糟糕的XML格式,.NET只有解析它并看到Magento的不发送任何值得尝试,因为它是错误地创建。



通常情况下,你最终分析从Magento的原始反应,因为它的方式更安全,或者使用的XmlRpc电话。



但现在,检查你有一个以上的测试,在小提琴手的响应之间的差异。



关于你的身份验证,你需要问的主机的凭据,并将它们添加到您的要求在正确的属性一个新的 NetworkCredentials 对象你的服务对象。


REVISED QUESTION
I have revised the original question (as seen below) so that I can mark a part of the problem as answered. So here goes:
I have built a tool to import sales orders from customer stores (magento) for integration into our legacy order processing system. I have five stores to import from. One of them has HTTP Authentication set on its store and my API Login fails because of this. How do I get past this?



ORIGINAL QUESTION (Title: Importing Sales Orders from Magento Using C#: There is an error in XML document (2, 372)):

I have built a tool to import sales orders from customer stores (magento) for integration into our legacy order processing system. I have five stores to import from. Three work fine.

  • PROBLEM 1: The fourth store throws up this exception upon executing the salesOrderList() call:

    A first chance exception of type 'System.InvalidOperationException' occurred in System.Xml.dll

    There is an error in XML document (2, 372).

    The login succeeds, I am able to enumerate attribute values, etc. But I am unable to run the salesOrderList() function with any filter (and null too). It would be great if someone has experience with this and can point me in the right direction.

  • PROBLEM 2: The fifth store has HTTP authorization to access its main magento page. I have only worked with API User Name and API Key. But it looks like I have to cross the HTTP Authorization hurdle to get to the API login stage. The Login() function of magento web service takes only the API User Name and API Key. Not sure how to handle the extra layer of HTTP Authentication. Can anyone help?

解决方案

This will happen often, you just got lucky and it's the first time you're having this problem.

What you can do is using fiddler verify why are you receiving a bad XML format, as .NET only parses it and sees that Magento did not sent anything that is worth of trying as it's wrongly created.

Normally you end up parsing the raw responses from Magento as it's way safer, or use XmlRpc calls.

But for now, check as you have more than one to test, the difference between the responses in fiddler.

Regarding your authentication, you need to ask the host for the credentials, and add them to your request as a new NetworkCredentials object in the correct property of your service object.

这篇关于用C#Magento的SOAP API V2:问题与需要HTTP认证店的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆