入力XMLから発行WCF XMLシリアル化ソープ要求
<ws:processAcord xmlns:ws="http://ws.plus.predictivelogic.com/">
<arg0>CrlUser</arg0>
<arg1>CrlPass</arg1>
<arg2>Life Scope</arg2>
<arg3 />
</ws:processAcord>
オブジェクトクラス
[XmlRoot(ElementName = "processAcord", Namespace = "http://ws.plus.predictivelogic.com/")]
public class Input
{
//[DataMember]
[XmlElement(ElementName = "arg0")]
public string Arg0 { get; set; }
//[DataMember]
[XmlElement(ElementName = "arg1")]
public string Arg1 { get; set; }
//[DataMember]
[XmlElement(ElementName = "arg2")]
public string Arg2 { get; set; }
//[DataMember]
[XmlElement(ElementName = "arg3")]
public string Arg3 { get; set; }
//[DataMember]
[XmlAttribute(AttributeName = "ws", Namespace = "http://www.w3.org/2000/xmlns/")]
public string Ws { get; set; }
}
サービス定義
public UnderWritingOutput Get(Input inputXml)
{
//do stuff
}
シリアライゼーションに問題が発生します。私はそれがデバッグしているとき私はサービス内のデータを取得していないよ。
[DataContract]
やその他のxml
属性のように、自分のコードに何らかの属性宣言の問題がなければなりません。
アップデート1:
私はすでにサービスの詳細を投稿し、ここで結合..
<system.serviceModel>
<services>
<service name="ServiceApplication.UnderWritingService" behaviorConfiguration="debug">
<endpoint address="GetUnderWriting" binding="basicHttpBinding" contract="ServiceApplication.IUnderWritingService"></endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:60418/"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="debug">
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
</behavior>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
私はそれを見せてあるsoapUI要求を開いています私の入力XMLとして
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:ser="http://schemas.datacontract.org/2004/07/ServiceApplication">
<soapenv:Header/>
<soapenv:Body>
<tem:Get>
<!--Optional:-->
<tem:inputXml>
<!--Optional:-->
<ser:Arg0>?</ser:Arg0>
<!--Optional:-->
<ser:Arg1>?</ser:Arg1>
<!--Optional:-->
<ser:Arg2>?</ser:Arg2>
<!--Optional:-->
<ser:Arg3>?</ser:Arg3>
<!--Optional:-->
<ser:Ws>?</ser:Ws>
</tem:inputXml>
</tem:Get>
</soapenv:Body>
</soapenv:Envelope>
IUnderWritingService
[ServiceContract]
public interface IUnderWritingService
{
[OperationContract]
UnderWritingOutput Get(UnderWritingInput inputXml);
}
である可能性を認識していなかった。TEM = "http://tempuri.org/"で、最初のxmlは異なる名前空間を示しています。あなたは何をしたいのですか? – rene
ここに投稿された最初のXML iv'eは、私のサービスの入力でなければなりません。 –
しかし、SOAP Webサービスにしたいのですか?単純な投稿のRESTサービスではありませんか? – rene