2012-03-30 3 views
0

Nous hébergeons notre service Web WCF dans le service Windows. Nous utilisons basicHttpBinding. Nous devons préserver la rétrocompatibilité avec le service Web Soap 1.1. Notre problème est l'espace de noms manquant sur l'élément EPTalkMessage dans le paramètre de méthode web. J'ai beaucoup cherché mais je n'ai pas trouvé de moyen d'ajouter un espace de noms à cet élément.Wcf problème de compatibilité descendante - espace de noms manquant sur le paramètre de méthode

Savon de l'ancien service Web est:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
<s:Header> 
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://aaa.sk/EPTalk/IssueDocument</Action> 
</s:Header> 
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
<IssueDocument xmlns="http://aaa.sk/EPTalk"> 
    <EPTalkMessage xmlns="http://aaa.sk/EPTalk/ToSignInput" /> 
</IssueDocument> 
</s:Body> 
</s:Envelope> 

Nouveau savon est généré:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
    <s:Header> 
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://aaa.sk/EPTalk/IssueDocument</Action> 
    </s:Header> 
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
    <IssueDocument xmlns="http://aaa.sk/EPTalk"> 
     <EPTalkMessage /> 
    </IssueDocument > 
    </s:Body> 
</s:Envelope> 

signature de service est la suivante:

[ServiceContract (Namespace = "http://aaa.sk/EPTalk")] 
[XmlSerializerFormat(Use = OperationFormatUse.Literal, Style = OperationFormatStyle.Document)] 
public interface IRegistryInputWebService 
{ 
    [OperationContract(Action = "http://aaa.sk/EPTalk/IssueDocument")] 
    RegistryServiceResult IssueDocument([MessageParameter(Name = "EPTalkMessage")] 
     UpvsPortalEmulator.ToSignInput.EPTalkMessage message); 
} 

Reliure:

BasicHttpBinding 
{     
MaxReceivedMessageSize = 1024 * 1024 * 10, 
MaxBufferSize = 1024 * 1024 * 10, 
ReaderQuotas = 
       { 
       MaxArrayLength = 1024 * 1024 * 10, 
       MaxStringContentLength = 1024 * 1024 * 10 
       }, 
MessageEncoding = WSMessageEncoding.Text, 
Security = new BasicHttpSecurity 
       { 
       Mode = BasicHttpSecurityMode.None 
       } 
}; 

Modifié: définition EPTalkMessage ajoutée.

[XmlType, XmlRoot (ElementName = "EPTalkMessage", Namespace = Declarations.SchemaVersion, IsNullable = false), Serializable] 
    public class EPTalkMessage 
{ 
} 

Merci beaucoup pour votre aide

Répondre

0

Après avoir cherché pendant un certain temps, je résolus de cette question avec MessageContracts.

Questions connexes