iOS 版 Sudz-c 存在问题,缺少命名空间
我正在开发一个使用网络服务的应用程序。这是一项私有服务,因此我无法在此处发布 WSDL 或生成的代码,因此这更多的是一些一般性建议而不是具体细节的问题。
我将 WSDL 输入 Sudz-c。 WSDL 最初包含一些 sudz-c 会忽略的 XSD 导入,因此我将它们复制到 WSDL 的类型部分中。
我使用生成的代码向服务发出请求,但我发现该请求缺少我复制到 WSDL 类型部分中的复杂类型对象的名称空间。
我再次知道这是非常一般的信息,但如果其他人在 Sudz 上遇到过类似的问题,那么很高兴得到您的建议。
I'm working on an app that uses a web service. This is a private service so I cannot post the WSDL or generated code here so this is more of a question for some general advice rather than specifics.
I fed the WSDL into Sudz-c. The WSDL originally had some imports of XSD's that sudz-c would overlook so I copied these into the types section of the WSDL.
I use the generated code to make a request to the service but I'm finding that the request is missing a name space for the complex type objects I copied into the types section of the WSDL.
Again I know this is very general information but if anyone else has had a similar issue with Sudz it would be great to get your advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我知道线程已经结束,但我找到了解决这个问题的方法..
如果 WSDL 包含/导入了外部 XSD,那么是的,您可以将这些 XSD 类型复制到 WSDL 中(即直接将其嵌入到 WSDL 中而不是包含/导入)。生成的代码在任何意义上都几乎是完美的,因为它也生成 XSD 类型的类型..但您可能会收到错误(多个文件中的相同错误)..这将是少数请求/响应类型的缺失 BASE-Class..在分析代码后我意识到缺少的命名空间只不过是同一个 SOAPObject 对象,因此我用 SOAPObject.h 替换了缺少的命名空间,并使用 SOAPObject 接口/类作为基类。
例如,就我而言
(注意:“sudz”是您在使用 SUDZ-C 网站/项目生成代码时使用的唯一名称,在您的情况下,它可能不同)。
我将代码更改为(项目中遇到此错误的所有位置):
我希望这会帮助其他人...我被困了几天,但后来它工作正常..
快乐编码:)
I know the thread has ended, but I found solution to this problem..
If a WSDL has external XSDs included/imported then YES, you are right to have those XSDs types copied over into WSDL (i.e. Directly EMBED it into WSDL rather than including/importing).. The generated Code is almost perfect in any sense since it generates types for XSD types as well.. but you might receive an ERROR (same error in multiple files).. which will be a missing BASE-Class of few request/response types.. after analyzing the code I realized that that missing namespace is nothing but the same SOAPObject object so I replaced that missing namespace with SOAPObject.h and used SOAPObject interface/class as the base class.
e.g. in my case
(Note: 'sudz' is the unique name that you use when generate code using SUDZ-C website/project, in your case it can be different).
I changed the code to (everywhere in the project where this error was encountered):
I hope this will help others... I was stuck for days but later got it working OK..
Happy Coding :)
您可以尝试的一件事是确保在实际服务本身中修复命名空间。
这是一个帮助完成此操作的链接:
http://alensiljak。 blogspot.com/2009/06/removing-httptempuriorg-namespace-from.html
One thing you might try is to make sure you fix your namespace in the actual service itself.
here is a link help get that done:
http://alensiljak.blogspot.com/2009/06/removing-httptempuriorg-namespace-from.html
找不到这个问题的答案,所以最终只是手动编码网络服务消息:(
Couldn't find an answer to this so ended up just hand coding the web service messages :(