asp.net 웹 서비스 (asmx)의 출력물에있는 각 요소에 xmlns="http://tempuri.org/"
선언을 어떻게 생략 할 수 있습니까?웹 서비스 출력에서 xmlns = "http://tempuri.org/"를 생략하는 방법
<?xml version="1.0" encoding="utf-16"?>
<ArrayOfData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DataItem>
<Id xmlns="http://tempuri.org/">463d931f-5f14-447d-99cd-289cae2a5b6d</Id>
<Created xmlns="http://tempuri.org/">2012-03-13T13:47:13.8626511+01:00</Created>
...
</DataItem>
...
웹 서비스는 다음과 같이 정의된다 :
[EdmEntityTypeAttribute(NamespaceName="DataEntityModel", Name="DataItem")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class DataItem : EntityObject
{
[EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Guid Id
{
...
}
}
public class DataItemCollection : Collection<DataItem>
{
}
내가 [WebService(Namespace = "http://tempuri.org/")]
이 속성에서, 결과는 동일 제거 :
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class DataWebService : System.Web.Services.WebService
{
[WebMethod]
public DataCollection GetData()
{
...
}
}
데이터 항목은 EF의 엔티티입니다.
DataItem의 모습은 어떻습니까? –
질문이 업데이트되었습니다. – zosim