AXIS Web服务标头问题 [英] AXIS web service header issue
问题描述
我正在尝试创建一个向AXIS Web服务发送请求的客户端,该服务不会在WSDL中公开头。以下是服务在标题中所需的格式:
< soapenv:标题>
< ns1:sessionID soapenv:actor ="" soapenv:mustUnderstand属性= QUOT; 0" xsi:type =" xsd:string"
xmlns:ns1 =" http:// host / session"> E0F48620-9DB2-11D7-8620-BF9E8B9C6E0D< / ns1:sessionID>
< / soapenv:Header>
我为标题创建了一个新类,但.NET传递了标题:
< soap:Header>
< q1:Header id =" h_id1" xmlns:q1 =" http://core.webservices.workbrain.com/session ">
< sessionID xsi:type =" xsd:string"> 87BF5A10-7340-11DF-BED1-A7B253A37D75< / sessionID>
< / q1:标题>
< / soap:Header>
我正在尝试找到一种在C#中创建类的方法,以便该属性是包含在标头中的唯一节点请求(或者传递的值包含在我可以重命名为sessionID的类头中)
谢谢,
Patrick
您好Patrick,
您能否分享您为标题创建的课程?以下代码有帮助吗?
[MessageContract]
公共课&HeaderClass
{
[MessageHeader(Name =" SessionID",Namespace =" http:// core .webservices.workbrain.com / session ")])
public string sessionID;
}
您可以在
http: //msdn.microsoft.com/en-us/library/ms730255.aspx
谢谢,
Neha Garg
I'm trying to create a client that sends a request to an AXIS web service that does not expose the header in the WSDL. Below is the format that the service expects in the header:
<soapenv:Header>
<ns1:sessionID soapenv:actor="" soapenv:mustUnderstand="0" xsi:type="xsd:string"
xmlns:ns1="http://host/session">E0F48620-9DB2-11D7-8620-BF9E8B9C6E0D</ns1:sessionID>
</soapenv:Header>
I have created a new class for the header, but .NET passes the header as such:
<soap:Header>
<q1:Header id="h_id1" xmlns:q1="http://core.webservices.workbrain.com/session">
<sessionID xsi:type="xsd:string">87BF5A10-7340-11DF-BED1-A7B253A37D75</sessionID>
</q1:Header>
</soap:Header>
I'm am trying to find a way to create the class in C# so that the attribute is the only node contained in the header of the request (or so that the value passed is contained within the class header which I could rename to sessionID)
Thanks,
Patrick
Hi Patrick,
Can you please share the class you have created for the header? Does the code below help?
[MessageContract]
public class HeaderClass
{
[MessageHeader(Name = "SessionID", Namespace ="http://core.webservices.workbrain.com/session")]
public string sessionID;}
You can read about it at http://msdn.microsoft.com/en-us/library/ms730255.aspx
Thanks,
Neha Garg
这篇关于AXIS Web服务标头问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!