SOAP Web服务 - 添加自定义标头 [英] SOAP Web Services - Adding custom headers

查看:131
本文介绍了SOAP Web服务 - 添加自定义标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我一直在反对这个问题,我似乎无法得到一个直接的答案。

以下是这种情况:

我使用SOAP从我的Windows移动设备应用程序调用Web服务。我有WSDL,并使用visual studio生成的代理来发送soap消息并接收响应。一切都很好。但是,后端具有自定义安全性,标题中需要3个内容。

1)用户名
2)密码
3)标题命名空间

现在,如果这是一个桌面应用程序甚至是Web应用程序,您可以使用WSE并且只是整天弹出一个标题。但是,根据我的阅读,.NET CF不支持WSE。嗯,那真是太糟糕了。

我想象"解决方案"是某种劫持传出请求soap消息,并操纵它以添加正确的标头。我上下搜索了某种解决方案,我感到很茫然。

任何人都可以提供有助于解决这种情况的见解或示例吗?
规格:
VS2008
.NETCF 3.5
PPC 2003(客户端的要求,boo)
Web服务托管在JBOSS java后端

解决方案

如果它只是http头,那么你可以这样做:

http://blogs.msdn.com/davidklinems/archive/ 2005/01/31/364279.aspx

HTH ...... Alex

---
http://blogs.msdn.com/priozersk/


Hello all,

I've been banging my head against this issue for a while, and I can't seem to get a straight answer. 

Here's the situation:

I am calling web services from my windows mobile device application using SOAP.  I have the WSDL, and am using a visual studio generated proxy to send the soap message and receive the response.  All is well there.  However, the back-end has custom security that requires 3 things in the header.

1)  Username
2)  Password
3)  Header namespace

Now, if this was a desktop application or even a web application, you could use WSE and just pop in a header all day long.  However, from what I've read, WSE is not supported by .NET CF.  Well, that's a bummer. 

I imagine the "solution" is some sort of hijacking of the outgoing request soap message, and manipulating it to add in the correct header.  I've searched up and down for some sort of solution, and am at a loss.

Can anyone offer insight or examples that might help with this situation?

Specs:
VS2008
.NETCF 3.5
PPC 2003 (client's requirement, boo)
Web Services are hosted on JBOSS java back end

解决方案

If it's just http headers then you can do something like this:

http://blogs.msdn.com/davidklinems/archive/2005/01/31/364279.aspx

HTH... Alex

---
http://blogs.msdn.com/priozersk/


这篇关于SOAP Web服务 - 添加自定义标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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