如何在WCF服务中更改消息名称 [英] How do I Change the message Name in a WCF service
本文介绍了如何在WCF服务中更改消息名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< wsdl:definitions xmlns:wsdl = http://schemas.xmlsoap.org/wsdl/ xmlns:soap < span class =code-keyword> = http://schemas.xmlsoap.org/wsdl/soap/ xmlns:soapenc = http://schemas.xmlsoap.org/soap/encoding/ xmlns:wsu = http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss -wssecurity-utility-1.0.xsd xmlns:xsd = http://www.w3.org/2001/XMLSchema xmlns:soap12 = http://schemas.xmlsoap.org/wsdl/soap12/ xmlns:tns = http://tempuri.org/ xmlns:wsa = http ://schemas.xmlsoap.org/ws/2004/08/addressing xmlns:wsp = http://schemas.xmlsoap.org/ws/2004/09/policy xmlns:wsap = http://schemas.xmlsoap.org/ws/2004/08/addressing/policy xmlns:wsaw = http://www.w3.org/2006 / 05 / addressing / wsdl xmlns:msc = http://schemas.microsoft.com/ws/2005/12/wsdl/contract xmlns:wsa10 = http ://www.w3.org/2005/08/addressing xmlns:wsx = http://schemas.xmlsoap.org/ws/2004/09/mex xmlns:wsam = http://www.w3.org/2007/05/addressing/metadata name = AdapterDocumentRetrieve targetNamespace = http://tempuri.org / >
< wsdl:types > ... < / wsdl:types >
< wsdl:message name = AdapterDocumentRetrieve_RespondingGateway_CrossG atewayRetrieve_InputMessage >
< wsdl:part name = 参数 element < span class =code-keyword> = tns:RespondingGateway_CrossGatewayRetrieve / >
< / wsdl:message >
< wsdl:消息 名称 = AdapterDocumentRetrieve_RespondingGatew ay_CrossGatewayRetrieve_OutputMessage >
< wsdl:part name = 参数 element < span class =code-keyword> = tns:RespondingGateway_CrossGatewayRetrieveResponse / >
< / wsdl:message >
< wsdl: portType 名称 = AdapterDocumentRetri前夕 > ... < / wsdl:portType >
< wsdl:binding name = BasicHttpBinding_AdapterDocumentRetrieve type = tns:AdapterDocumentRetrieve > ... < / wsdl:binding > ;
< wsdl:service 名称 = AdapterDocumentRetrieve > ... < / wsdl:service >
< / wsdl:definitions >
我想将消息名称AdapterDocumentRetrieve_RespondingGateway_CrossGatewayRetrieve_InputMessage更改为另一个名字
解决方案
请参阅如何更改默认的wsdl消息名称? [ ^ ]。
参考
http://blogs.msdn.com/b/donsmith/archive/2006/10/06/handcrafting-wcf_2d00_friendly-wsdls.aspx [ ^ ]
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" name="AdapterDocumentRetrieve" targetNamespace="http://tempuri.org/"> <wsdl:types>...</wsdl:types> <wsdl:message name="AdapterDocumentRetrieve_RespondingGateway_CrossGatewayRetrieve_InputMessage"> <wsdl:part name="parameters" element="tns:RespondingGateway_CrossGatewayRetrieve"/> </wsdl:message> <wsdl:message name="AdapterDocumentRetrieve_RespondingGateway_CrossGatewayRetrieve_OutputMessage"> <wsdl:part name="parameters" element="tns:RespondingGateway_CrossGatewayRetrieveResponse"/> </wsdl:message> <wsdl:portType name="AdapterDocumentRetrieve">...</wsdl:portType> <wsdl:binding name="BasicHttpBinding_AdapterDocumentRetrieve" type="tns:AdapterDocumentRetrieve">...</wsdl:binding> <wsdl:service name="AdapterDocumentRetrieve">...</wsdl:service> </wsdl:definitions>
I want to chagne the message name "AdapterDocumentRetrieve_RespondingGateway_CrossGatewayRetrieve_InputMessage" to another name解决方案Refer answer at How to change default wsdl message name?[^].
Refer
http://blogs.msdn.com/b/donsmith/archive/2006/10/06/handcrafting-wcf_2d00_friendly-wsdls.aspx[^]
这篇关于如何在WCF服务中更改消息名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文