解组错误 [英] Unmarshalling Error

查看:50
本文介绍了解组错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常异常的(IMHO)错误,每当我尝试向SOAP服务发送请求时都会引发该错误:

I have a pretty abnormal(IMHO) error that it's being raised whenever I try do a request to a SOAP service:

解组错误:意外元素(uri: http://www.domain.com/ws/servicename/,本地: dummyArg)。期望的元素是< {} dummyArg>

Unmarshalling Error: unexpected element (uri:"http://www.domain.com/ws/servicename/", local:"dummyArg"). Expected elements are <{}dummyArg>

我正在调用的方法定义为:

The method that I'm calling has is defined as:

function GetData(const dummyArg:WideString):Array_Of_Data; stdcall;

我对SOAP的使用经验很少,所以我[[]快要失去理智了,我找不到任何有用的东西有关此的信息。
随时问任何可能会加快发现问题过程的问题。

I have little experience with SOAP therefore I'm this [ ] close to lose my mind, I couldn't find any useful information on this. Feel free to ask any question that might speed up the process in finding the issue.

编辑:我正在使用Delphi 2010,并且我打电话给像这样的方法:
GetData(EmptyStr); GetData('null'); GetData('{}');

I'm using Delphi 2010, and I've called the method like so: GetData(EmptyStr);, GetData('null'); and GetData('{}');

谢谢您的时间。

推荐答案

我设法找到了解决该问题的方法,只需将单元初始化部分中的invoke选项从ioDocument替换为ioHasNamespace或ioHasAllSOAPActions和SOAP请求将正确生成,例如:

I've managed to find a clean fix to my issue, just replace the invoke option in the initialization section of the unit from ioDocument to ioHasNamespace or ioHasAllSOAPActions and the SOAP request will be generated correctly, example:

InvRegistry.RegisterInvokeOptions(TypeInfo(YourSoapInterface), ioDocument);

更改为

InvRegistry.RegisterInvokeOptions(TypeInfo(YourSoapInterface), ioHasNamespace);

InvRegistry.RegisterInvokeOptions(TypeInfo(YourSoapInterface), ioHasAllSOAPActions);

这是我可以找到的最干净的解决方案。

This is the cleanest fix I could find for this issue.

这篇关于解组错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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