當我嘗試導入通過WCF測試客戶端一個WSDL(http://ns.hr-xml.org/schemas/org_hr-xml/3_0/Services/Web_Services/WSDL/TimeCard.wsdl)我得到的「WCF操作在WCF測試客戶端不支持,因爲它使用類型
WCF操作不是在WCF測試客戶端支持」
,因爲它使用的屏幕截圖如圖鍵入「錯誤消息。
合同看起來像下面,我不知道爲什麼我收到上述錯誤信息。莫非有人請摹UIDE我正確的方向:
[System.ServiceModel.OperationContractAttribute(Action="ChangeTimeCard", ReplyAction="*")]
[System.ServiceModel.FaultContractAttribute(typeof(HRXMLTimeCard.HRXML_Candidate_3_1.ConfirmBODType), Action="ChangeTimeCard", Name="ConfirmBOD", Namespace="http://www.openapplications.org/oagis/9")]
[System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BinaryObjectType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(AmountType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(QuantityType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(PreferenceABIEType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(AddressBaseType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(NameType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(PersonNameBaseType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(TimePeriodABIEType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(TextType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(CodeType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(StatusBasisType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(VerbType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(ResponseCodeType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(IdentifierType))]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(BusinessObjectDocumentType))]
HRXMLTimeCard.HRXML_Candidate_3_1.ProcessTimeCardResponse ChangeTimeCard(HRXMLTimeCard.HRXML_Candidate_3_1.ChangeTimeCardRequest request);
這是ChangeTimeCardRequest類:
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
public partial class ChangeTimeCardRequest {
[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://www.hr-xml.org/3", Order=0)]
public HRXMLTimeCard.HRXML_Candidate_3_1.ChangeTimeCardType ChangeTimeCard;
public ChangeTimeCardRequest() {
}
public ChangeTimeCardRequest(HRXMLTimeCard.HRXML_Candidate_3_1.ChangeTimeCardType ChangeTimeCard) {
this.ChangeTimeCard = ChangeTimeCard;
}
}
下面是ChangeTimeCardType:
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.225")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.hr-xml.org/3")]
public partial class ChangeTimeCardType : BusinessObjectDocumentType {
private ChangeTimeCardDataAreaType dataAreaField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=0)]
public ChangeTimeCardDataAreaType DataArea {
get {
return this.dataAreaField;
}
set {
this.dataAreaField = value;
this.RaisePropertyChanged("DataArea");
}
}
}
另外,如果WSDL沒有在WCF測試工作客戶端,這是否意味着它不會適用於所有客戶端,即。 Java還是PHP?
謝謝,我已更新我的原始問題的代碼爲HRXMLTimeCard.HRXML_Candidate_3_1.ChangeTimeCardType類 –
您可以嘗試添加[System.ServiceModel .ServiceKnownTypeAttribute(typeof(HRXMLTimeCard.HRXML_Candidate_3_1.ChangeTimeCardType))]到您的合同? – pedrodg
@flybyte,這是否解決了您的問題? – pedrodg