Hi,
ich versende in XML serialisierte Objekte als soapEnvelopes unter Verwendung des WSE3.
Das Objekt hat den folgenden Typ:
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://tempuri.org/")]
public partial class GetSchemaDTO
{
private string[] _tableNames;
public string[] TableNames
{
get { return _tableNames; }
set { _tableNames = value; }
}
private SyncSession _syncSession;
public SyncSession SyncSession
{
get { return _syncSession; }
set { _syncSession = value; }
}
}
serialisert bekomme ich davon folgende Envelope:
<soap:Envelope xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsa:Action>http://tempuri.org/GetSchema</wsa:Action>
<wsa:MessageID>urn:uuid:30a74143-212c-4ece-991f-2ed085e41853</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:To>soap.tcp://localhost/SyncService</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-b2aa3487-93ec-41ac-b192-84115851ce30">
<wsu:Created>2009-08-21T07:58:23Z</wsu:Created>
<wsu:Expires>2009-08-21T08:03:23Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<GetSchemaDTO xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
<TableNames>
<string>Testtable</string>
</TableNames>
<SyncSession>
<OriginatorId>0</OriginatorId>
<ClientId>aa86afc5-12f4-48b1-9ad6-3f9cc3098b26</ClientId>
</SyncSession>
</GetSchemaDTO>
</soap:Body>
</soap:Envelope>
Wenn ich die empfangene Envelope aber wieder deserialisieren möchte bekomme ich nur null als Ergebnis.
Beispiel für die Deserialisierung:
SoapServerMethod serverMethod = new SoapServerMethod(typeof (SyncService),
new LogicalMethodInfo(
typeof (SyncService).GetMethod("GetSchema")));
SoapEnvelope envelope = new SoapEnvelope();
envelope.LoadXml(
"<soap:Envelope xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header> <gekürzt> ");
XmlReader bodyReader = envelope.GetBodyReader();
object[] objArray = null;
if (bodyReader != null)
{
if (bodyReader.IsEmptyElement)
{
objArray = new object[0];
}
else
{
bodyReader.ReadStartElement(bodyReader.LocalName, bodyReader.NamespaceURI);
bodyReader.MoveToContent();
objArray = (object[])serverMethod.ParameterSerializer.Deserialize(bodyReader, (serverMethod.BindingUse == SoapBindingUse.Encoded) ? envelope.CurrentSoap.EncodingStyle : null);
}
bodyReader.Close();
}
Hat jemand eine Idee woran es liegen könnte ?
Gruß SkySurfer
Es gibt 11 Arten von Menschen:
Nach einigen Reflector Sessions weiß ich nun wieso es nicht geht ..
man endet beim deserialisieren immer in einem Aufruf von throw new NotImplementetException der in einem try / catch Block gekapselt ist und das auch nicht nach außen liefert.
Prädikat : 🙄
Es gibt 11 Arten von Menschen: