Does Microsoft yet know their plans for Windows Mobile/PocketPC (.NET Compact Framework) for WCF
The current netcf distribution doesn't contain non-soap/non-ws support (e.g. binary/tcp remoting), I'm wondering what kind of functionality we might be able to look forward to on a netcf version of WCF.
Thanks!

Plans for Windows Mobile Pocket/PC?
ThomasDL
Bill Essary MSFT
Alright. Figured out that I have to use WSHttpBinding on my service to allow creation of web reference from mobile app (it didn't like my previous attemps using WSDualHttpBinding). However, after my web reference was created, I noticed that the properties of my complex-type parameters were exploded to become the parameters of the web reference methods.
For instance, I have an InitiateInventoryMovementRequest class that is intended to be the sole parameter of an InitiateInventoryMovement function. My web reference successfully created a method signature for InitiateInventoryMovement, but forced parameters to be "string[] additionalBinLocations, string itemNumber, string userID, ..." which are the properties of the InitiateInventoryMovementRequest class. Is there any way to force the web reference to see the complex types I'm using for method parameters and returns
BlueMikey
CMick
For the time being, use ASMX on the client to talk to Indigo Services. The CF team is looking at making a version of WCF for the CF but it is not yet available
-Thank you
Madhu
vodka
For anyone else that's, maybe, been following this thread, I found the answer to my parameters problem by removing the MessageContract attribute from, and adding a Serializable attribute to, the parameter classes.
Apparently the MessageContract attribute forces the parameter class properties to explode and become simple parameters for the method.
jrcdude
(1)
Make sure,your class is marked as Serializable
[Serializable]
public class InitiateInventoryMovementRequest
{
private int InventoryId;
private int productId;
I}
(2)
set XmlSerializerFormat attribute for the inetrface
// Define a service contract.
[ServiceContract(Namespace="http://Microsoft.ServiceModel.Samples"), XmlSerializerFormat]
public interface ICalculator
{[OperationContract]
int GetProductId(InitiateInventoryMovementRequest obj);
}
(3)
This will force wcf to use xml Serializer (by default wcf will use xml formatter for serialization)
This should generate proxy the way you expected.
-Thank you
Madhu
SolarScott
Thanks for your patience, I am still thinking we are on track, may be I misunderstood your problem description, please correct me.
Problem description:
==============
You have wcf service method, which will return custom class type
// in this method, I am trying to return employee class type
Example:
public Employee GetEmployeeInfo(int empId)
{
return new Employee();
}
If you generate proxy for this service, you want to see above method signature like this on client side (exactly same kind of method signature on client side)
Example:
=======
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://Microsoft.ServiceModel.Samples/ICalculator/GetEmployeeInfo", RequestNamespace="http://Microsoft.ServiceModel.Samples", ResponseNamespace="http://Microsoft.ServiceModel.Samples", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public Employee GetEmployeeInfo(int empId) {
object[] results = this.Invoke("GetEmployeeInfo", new object[] {
empId});
return ((Employee)(results[0]));
}
SERIALIZATION:
============
ASP.NET web services will use XML serialization
By default WCF use XMLFORMATER for serialization, but we can change this behavior, we can ask wcf service to use XML serializer (in previous reply, I showed how to add xml serialization attributes to wcf service), when we are communicating with non-wcf clients, this is preferred option, because non wcf apps will use xml serializer.
How to test:
=========
(1) Download this sample
http://windowssdk.msdn.microsoft.com/library/default.asp url=/library/en-us/wcf_samples/html/3ea381ee-ac7d-4d62-8c6c-12dc3650879f.asp
(2)Add new class to service project, copy following info to new class
using System;
using System.Collections.Generic;
using System.Text;
namespace Microsoft.ServiceModel.Samples
{
[Serializable]
public class Employee
{
private string m_Name;
private int m_Age;
public int m_EmpNum;
}
}
(3)Now open service.cs and add new method to the ICalculator interface
[OperationContract]
Employee GetEmployeeInfo(int empId);
(4)Since we added this new method,implement this method in CalculatorService
public Employee GetEmployeeInfo(int empId)
{
return new Employee();
}
(5)compile the service project
now we are done with service project
(6)
run wsdl.exe {serviceuri} /out:proxy.cs
(7)proxy file will have Employee class defination like this
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://Microsoft.ServiceModel.Samples")]
public partial class Employee {
private int m_EmpNumField;
/// <remarks/>
public int m_EmpNum {
get {
return this.m_EmpNumField;
}
set {
this.m_EmpNumField = value;
}
}
}
/// <remarks/>
public Employee EndGetEmployeeInfo(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((Employee)(results[0]));
}
CONCLUSION:
==========
If I misunderstood your problem description, please correct me
If you are still not able to generate proxy, can you please send your service code to me.
-Thank you
Madhu
byx45
Madu, In following the example you provided earlier, I realized that they use basic Http binding. This is the only way I could get any ASMX client to connect correctly. Is there any way to use WSHttpBinding instead If so, what needs to be done to make my clients and server compatible with this binding type
Example link: http://windowssdk.msdn.microsoft.com/library/default.asp url=/library/en-us/wcf_samples/html/3ea381ee-ac7d-4d62-8c6c-12dc3650879f.asp
Joe Lutz
Jim Elliott
Followed the example in the article. Generated typed wsdl output proxy. Once I added code to instantiate the proxy in my smart devices (Pocket PC) application, I received the following compile error:
"Error 1 The type 'System.Uri' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:\Documents and Settings\Timmy\My Documents\Visual Studio 2005\Projects\InventoryAuditor\InventoryAuditor\CSInventoryAuditorForm.cs 21 13 InventoryAuditor"
And, of course, a smart devices project can't reference non-CF version of System.DLL (and nor would I seeing that it's almost 3MB). Am I missing something here
Thanks.
Gregoire de Jabrun
I am trying to test this sample,i think if you are able to call simple web service from smart device app ,you should be able to call wcf service
can you add wcf service reference from add web reference wizard (Example: http://localhost/servicemodelsamples/service.svc wsdl ),and compile the project
we just generate proxy file (.cs) from wcf service wsdl (This behavior is same for simple web service also),it should not have any more dependencies.
If you see the proxy file,it will have system.web,system.web.protocols(nothing specific to wcf)
I will try to test it today,you can try above approach,it should work
-Thank you
Madhu
Paytheon
http://windowssdk.msdn.microsoft.com/library/default.asp url=/library/en-us/wcf_samples/html/3ea381ee-ac7d-4d62-8c6c-12dc3650879f.asp
please install winfx sdk,you can download this sample from winfx sdk
please let me know if you need more info
-Thank you
Madhu
AreaScout
What you can do right now is to use MSMQ integration binding because MSMQ is supported in .NET CF 2.0. I have tested it and it works (see a previous thread in this forum "Integration with MSMQ on .NET Compact Framework 2.0").
Geoff Henry
I tried what you suggested along with several other variations. The web reference is still created with simple type parameters. Any other suggestions
I realize our correspondence is getting a little off topic, however, I hope it winds up showing some considerations and issues regarding mobile application communication with WCF technologies.
Thanks for your help thus far, btw.