cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Consuming a Webservice with the compact framework

Former Member
0 Kudos

Hi all,

i want to consume a SAP WebService within .NET in a smart device application. When I create the proxy, I get the following procedure in the .cs class:

<i>[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.sap.com/_-ICO_-CM_XML_CREATE", RequestElementName="_-ICO_-CM_XML_CREATE", RequestNamespace="urn:sap-com:document:sap:rfc:functions", ResponseElementName="_-ICO_-CM_XML_CREATE.Response", ResponseNamespace="urn:sap-com:document:sap:rfc:functions", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)][return: System.Xml.Serialization.XmlElementAttribute("SUBRC", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]public string ICOCM_XML_CREATE([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string ORDERNR, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string ROUTE, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string TESTRUN, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string TOURNO, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string XML_FILE_LOCAL, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string XML_FILE_SERVER, [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] out string XML_STRING) {object[] results = this.Invoke("_ICO_CM_XML_CREATE", new object[] {ORDERNR,ROUTE,TESTRUN,TOURNO,XML_FILE_LOCAL,XML_FILE_SERVER});XML_STRING = ((string)(results[1]));return ((string)(results[0]));}</i>

When I compile the project I get the follwing error for each occurance of the "Form" Attribute :

"<b>'System.Xml.Serialization.XmlElementAttribute' does not contain a definition for 'Form'" </b>

When I try to consume this webservice with a "normal" kind of application, such as a windows-application, everything is ok.

But when trying to use it with the compact framework, the error occurs.

Is anyone outhere who can help me?

Thank you

Regardings

Accepted Solutions (0)

Answers (1)

Answers (1)

reiner_hille-doering
Active Contributor
0 Kudos

It seems that the "Form" property of the XmlElementAttribute was missing in Compact Framework 1.1. It does exist in Compact Framework 2.0.

You can try removing the "Form=System.Xml.Schema.XmlSchemaForm.Unqualified" entries from the proxy, but I'm not sure of it will still correctly work: For in-parameter it should be Ok to skip "Form=", but for out-paramters and result it could have the effect that no data is received.

In this case the best option may be to upgrade to Compact Framework 2.0.