XML deserialisation problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard Lewis

    #1

    XML deserialisation problems

    I have a web service that is used from a Pocket PC device using .NET CF
    1.1

    The webservice creates an object structure and serialises the object
    structure to create the following SOAP response

    <?xml version="1.0" encoding="utf-8" ?>
    <soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <RegisterMobile DeviceResponse xmlns="http://mobile.project. net/">
    <RegisterMobile DeviceResult>
    <Status>Already Registered</Status>
    <DataObject xsi:type="Proje ctSpecificDevic e" HostName="POCKE T PC"
    ProcessorUID="0 8590050-XXXX-XXXX" IMEI="" />
    <ServerDatetime >2006-08-29T14:25:13.657 8286+01:00</ServerDatetime>
    </RegisterMobileD eviceResult>
    </RegisterMobileD eviceResponse>
    </soap:Body>
    </soap:Envelope>

    I have the following thinds setup in the device code (C#)


    [System.Xml.Seri alization.XmlTy peAttribute(Nam espace="http://mobile.proj
    ect.net/")]
    public class ProjectSpecific Device: Device
    {
    }

    public class Device
    {
    [XmlAttribute]
    public string HostName;

    [XmlAttribute]
    public string ProcessorUID;

    [XmlAttribute]
    public string IMEI;
    }

    The webservice interface has the following attributes

    [System.Diagnost ics.DebuggerSte pThroughAttribu te()]
    [System.Componen tModel.Designer CategoryAttribu te("code")]
    [System.Web.Serv ices.WebService BindingAttribut e(Name="Client
    AdapterSoap", Namespace="http ://mobile.project. net/")]
    [System.Xml.Seri alization.XmlIn cludeAttribute( typeof(ProjectS pecificDevi
    ce))]
    [System.Xml.Seri alization.XmlIn cludeAttribute( typeof(Registra tionRequest
    ))]
    public class WebServiceInteg rator
    {
    /// <remarks/>

    [System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://mobil
    e.project.net/RegisterMobileD evice",
    RequestNamespac e="http://mobile.project. net/",
    ResponseNamespa ce="http://mobile.project. net/",
    Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
    ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)
    ]
    public ResponsePack RegisterMobileD evice(RequestPa ck request)
    {
    object[] results = this.Invoke("Re gisterMobileDev ice", new object[] {
    request});
    return ((ResponsePack) (results[0]));
    }
    }


    Up until recently this was processed correctly and the call to the
    webservice succeeded but I now cannot get this call to succeed.

    When calling the Webservice I get the following Exception thrown when
    the above is processed on the device.

    Cannot find type for http://tempuri.org/:ProjectSpecifi cDevice."

    Any help would be greatly appreciated.

    Richard
Working...