I don’t see anything in this code that stands out here. It looks correct to me.
Since I’ve never used that toolkit, I have nothing intelligent to add about it.
Maybe someone within Oliver’s organization has more to add.
From: Allan Conybeare [mailto:Allan.Conybeare@xxxxxxxxxxxxxxxxx]
Sent: Thursday, December 06, 2012 3:27 AM
To: Pritchett, James; 'Oliver Pesch'; 'sushidevelopers@xxxxxxxxxxxxx'
Subject: RE: SUSHI - sushi1_6.xsd ...sushi/sushicounterservice.svc?xsd=xsd1 shows attributes as elements
James,
Thanks for your reply. Mine looks very similar, I’ve highlighted the two differences in mine, also mine doesn’t have the order bit “.XmlElementAttribute(Order=0)]” .
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.niso.org/schemas/sushi")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://www.niso.org/schemas/sushi", IsNullable = false)]
public partial class ReportRequest
{
private Requestor requestorField;
private CustomerReference customerReferenceField;
private ReportDefinition reportDefinitionField;
private System.DateTime createdField;
private bool createdFieldSpecified;
private string idField;
/// <remarks/>
public Requestor Requestor
{
get
{
return this.requestorField;
}
set
{
this.requestorField = value;
}
}
/// <remarks/>
public CustomerReference CustomerReference
{
get
{
return this.customerReferenceField;
}
set
{
this.customerReferenceField = value;
}
}
/// <remarks/>
public ReportDefinition ReportDefinition
{
get
{
return this.reportDefinitionField;
}
set
{
this.reportDefinitionField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public System.DateTime Created
{
get
{
return this.createdField;
}
set
{
this.createdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool CreatedSpecified
{
get
{
return this.createdFieldSpecified;
}
set
{
this.createdFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string ID
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
}
Regards Allan
From: Pritchett, James [mailto:James.Pritchett@xxxxxxxxxxxxxxxxxxxx]
Sent: 05 December 2012 19:45
To: Allan Conybeare; 'Oliver Pesch'; 'sushidevelopers@xxxxxxxxxxxxx'
Subject: RE: SUSHI - sushi1_6.xsd ...sushi/sushicounterservice.svc?xsd=xsd1 shows attributes as elements
Allan,
What does the ReportRequest class look like in the c# code?
Here’s what we at SerialsSolutions have in our client code generated using svcutil from sushi1_6.xsd:
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "4.0.30319.1")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.niso.org/schemas/sushi")]
public partial class ReportRequest
{
private Requestor requestorField;
private CustomerReference customerReferenceField;
private ReportDefinition reportDefinitionField;
private System.DateTime createdField;
private bool createdFieldSpecified;
private string idField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=0)]
public Requestor Requestor
{
get
{
return this.requestorField;
}
set
{
this.requestorField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=1)]
public CustomerReference CustomerReference
{
get
{
return this.customerReferenceField;
}
set
{
this.customerReferenceField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=2)]
public ReportDefinition ReportDefinition
{
get
{
return this.reportDefinitionField;
}
set
{
this.reportDefinitionField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public System.DateTime Created
{
get
{
return this.createdField;
}
set
{
this.createdField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool CreatedSpecified
{
get
{
return this.createdFieldSpecified;
}
set
{
this.createdFieldSpecified = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string ID
{
get
{
return this.idField;
}
set
{
this.idField = value;
}
}
}
Oliver,
Thanks for your reply.
These are the names that the xsd.exe gives the elements when it generates the .Net Serialization class (System.Xml.Serialization), all the element names and attributes are appended with “Field”, I’m assuming that .Net does this in case the element or attribute names match .Net properties or methods as this would cause conflicts.
This is not part of the SDK that I’ve changed so I’m having a bit of trouble figuring out what’s wrong. If I use the client simulator that was supplied in the SDK it works but if I try to use a third party client i.e. Soap UI, which automatically sets up the request based on the WSDL or the JUSP client it doesn’t.
Regards Allan
From: Oliver Pesch [mailto:OPesch@xxxxxxxxx]
Sent: 05 December 2012 13:56
To: Allan Conybeare; 'sushidevelopers@xxxxxxxxxxxxx'
Subject: RE: SUSHI - sushi1_6.xsd ...sushi/sushicounterservice.svc?xsd=xsd1 shows attributes as elements
The two elements you are referencing “Createdfield” and “IDfield” are not part of the SUSHI1_6.xsd as found on the NISO site (http://www.niso.org/schemas/sushi/sushi1_6.xsd ). Is it possible they are being inserted by some internal logic to your application?
Oliver
Hi,
I’m having a bit of difficulty with the sushi1_6.xsd schema and wondered if anyone has any thoughts.
I’ve used the EBSCO SDK to develop my service. When I query my web service for the WSDL (http://services_test.portlandpress.com/sushi/sushicounterservice.svc?wsdl) and XSD (http://services_test.portlandpress.com/sushi/sushicounterservice.svc?xsd=xsd1) the returned xsd shows the attributes as elements.
Here is the relevant snippet from the XSD (sushi1_6.xsd) -
Code:
...
<xs:complexType name="ReportRequest">
<xs:annotation>
<xs:documentation/>
</xs:annotation>
<xs:sequence>
<xs:element type="s:Requestor" name="Requestor">
<xs:annotation> <xs:documentation>Consumer of the service (client).</xs:documentation> </xs:annotation>
</xs:element>
<xs:element type="s:CustomerReference" name="CustomerReference">
<xs:annotation> <xs:documentation>Identity of the customer for which data is requested</xs:documentation> </xs:annotation>
</xs:element>
<xs:element type="s:ReportDefinition" name="ReportDefinition">
<xs:annotation> <xs:documentation>Report paramters including report name, version and filters (e.g. date ranges)</xs:documentation> </xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:dateTime" name="Created">
<xs:annotation> <xs:documentation>Date/time the request was created</xs:documentation> </xs:annotation>
</xs:attribute>
<xs:attribute type="xs:string" name="ID">
<xs:annotation> <xs:documentation>Identifier may be provided by client application for internal use/diagnostics.</xs:documentation> </xs:annotation>
</xs:attribute>
</xs:complexType>
...
Here is the same snippet after the call to http://services_test.portlandpress.com/sushi/sushicounterservice.svc?xsd=xsd1
createdField and idField below should be attributes not elements?
Code:
...
<xs:complexType name="ReportRequest">
<xs:sequence>
<xs:element name="createdField" type="xs:dateTime"/>
<xs:element name="createdFieldSpecified" type="xs:boolean"/>
<xs:element name="customerReferenceField" type="tns:CustomerReference" nillable="true"/>
<xs:element name="idField" type="xs:string" nillable="true"/>
<xs:element name="reportDefinitionField" type="tns:ReportDefinition" nillable="true"/>
<xs:element name="requestorField" type="tns:Requestor" nillable="true"/>
</xs:sequence>
</xs:complexType>
...
Any help will be greatly appreciated.
Cheers Al
Portland Press Ltd registered in England and Wales No. 2453983.
Registered Office: Charles Darwin House, 12 Roger Street, Third Floor, London, WC1N 2JU.
VAT registration number GB 523 2392 69. Portland Customer Services is a division of Portland Press Ltd.
The contents of this email are for the recipient only.
If you are not this person (or not responsible for delivery to this person), then notify the sender and delete the email immediately.
Any opinions contained in this message are those of the author and are not given or endorsed by Portland Press Ltd or the division through which this message is sent unless otherwise clearly indicated in this message.
Charles Darwin House, 12 Roger Street, Third Floor, London, WC1N 2JU
EBSCO Industries
This email and any files transmitted with it are confidential and solely for the use of the intended recipient. It may contain information which is covered by professional or other privilege. If you
are neither the intended recipient of this email nor the person responsible for delivering it to the intended recipient, be advised that you have received this email in error and that any use of it is strictly
prohibited. Please notify the sender immediately by reply email and then delete it from your system. EBSCO accepts no liability for any loss or damage suffered by any person arising from the use of this email.
Please consider the environment before printing this email.