Hoping somebody would be willing to help me out with connecting to a WCF Service that I did not create. I've tried working through a couple of examples on mSDN but couldn't make heads or tails of them. I was asked to see if I could write something to connect to a Motorola premiere one software on a squad car MDC. As a result I only have temporary access (as in a short, scheduled time frame) for development and I can't have a copy to take with me to play with. I was given an API Manual from Motorola that allegedly has everything I need to talk through WCF to their application but since I've never seen WCF before I'm drowning in confusion here. Best I can tell, I need to "talk" to the service as if it's a web site in the localhost using http protocols.
The manual says I can choose a by request or by subscription and I think I want Subscription since it would be easier for the end user but I'm not really sure?
I've included what I THINK is the necessary connection information, can anyone start me off with a code sample in VB.NET? Please?
By Request: PremierOne Mobile client hosts WCF “Data Request Service” –
IMobileDataService. The hosted WCF service contract exposes Query and CAD Incident data to
third party applications. Figure 2-1 shows Third Party Vendor 1 application requesting query and
CAD incident data.
By Subscription: A third-party application registers and unregisters to PremierOne Mobile client
using the IMobileDataService service contract’s Register and UnRegister operation contracts.
PremierOne Mobile client updates all third party applications which implement the WCF service
contract - IDataReceiver – defined by PremierOne. In Figure 2-1 below, the Third Party Vendor 2
subscribes to PremierOne Mobile Client for subscribed CAD Incident data.
2.2.1 External System Registers to PremierOne Mobile Client
Service Contract IMobileDataService
Operation Contract Register
Description Third-party applications register to PremierOne Mobile client with a call
back address. As a result third party applications can now receive data
from PremierOne Mobile client.
Parameters See Table 2-15.
Return Values True if successful, otherwise false
Table 2-15 External System Registers to PremierOne Mobile Client Parameters
Name Type Description
public class RegisterParameters
private string dataSource;
private string careOfAddress;
private string filter;
private Credentials credentials;
a) dataSource (string ( nvarchar(50)) )
Type of data source that third-party applications want to subscribe. May be one
of the following data source:
E.g. : “Query”
E.g. : “Query, “Incident”
b) careOfAddress (string ( nvarchar(200)) )
The callback address of the WCF service hosted by 3rd party applications.
E.g. : "http://localhost:9501/ExternalTool/Simulator
c) filter (text)
The filter condition for the third-party applications to subscribe to the specific
data within the data source type. To specify multiple filters use a comma for a
separator. For example, the third-party application can subscribe to both
“Active or Closed” incident data. Note: The Filter condition is only valid for data
source type – “Incident”.
E.g. : “Active,Update,Closed”
E.g. : “Active,Closed”
Active – Incident is in an Active status if it is assigned to a PremierOne User
and is being currently worked on.
Closed – Incident that is in a closed status and was previously worked by a
Update – Any updates (like comments, adding persons, Vehicles) that were
made to the incident.
d) The instance of Credentials that contains the authentication information of
the third-party application. For details, see “Credentials Class” on page A-1.
2.2.3 External System Implements IDataReceiver WCF Service
The third-party application subscribing to the PremierOne Mobile client data needs to implement
the IDataReceiver WCF service contract.
Service Contract IDataReceiver– The IDataReceiver interface is hosted by the external
application to receive data from the PremierOne mobile client.
Operation Contract ReceiveData
Method public void ReceiveData (string dataSource, string xmlResponse)
Description Third-party applications receive data from the PremierOne Mobile client.
The pre-requisite is that the third-party applications should register in
order to receive PremierOne Mobile client data. PremierOne Mobile
unregisters the third-party applications when it fails to send data to
those applications; third party applications should re-register themselves
to PremierOne Mobile.
Parameters See Table 2-17.
Return Values None
Table 2-17 External System Implements IDataReceiver WDR Service Parameters
Name Type Description
dataSource string Type of data source that third-party applications want to
subscribe. May be one of the following data sources:
Table 2-18 XSD for Query xmlResponse
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.mot.com/pswgs/service/ExternalDataAgent" xmlns:xs="http://www.w3.org/
2001/XMLSchema" xmlns="http://www.mot.com/pswgs/service/ExternalDataAgent" xmlns:NS="http://www.mot.com/
pswgs/service/ExternalDataAgent" elementFormDefault="qualified" attributeFormDefault="unqualified">
<!-- Contains one or more records -->
<xs:element name="QueryDataResponses" type="QueryDataResponse" minOccurs="0" maxOccurs="unbounded" /
<xs:attribute name="Count" type="xs:int" /> <!--Indicate the count of Response-->
A.1 Credentials Class
public class Credentials
private string externalUserName;
private string externalPassword;
private string premierOneUserId;
Any request to an API should be identified by a logged-on PremierOne Mobile User Id. Otherwise,
access to CAD incident and query data is denied.
Table A-1 Credentials Class Parameters
Parameter Name Description Data Type
externalUserName User Name of the third-party application string
externalPassword Password of the third-party application string
premierOneUserId Logged on PremierOne Mobile User Id string
A-2 July 2010
WCF Endpoints (Service and Client) Chapter A: Appendix A
You configure externalUserName and externalPassword using the PremierOne
Configuration Tool. Third-party applications should use these credentials to subscribe to
PremierOne Mobile client API data.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.2 WCF Endpoints (Service and Client)
WCF endpoint configuration is hosted by the PremierOne Mobile client.
Table A-2 WCF Endpoint Configuration
<?xml version="1.0" encoding="UTF-8"?>
<endpoint address="http://localhost:9500/ExternalDataAgent" binding="basicHttpBinding" bindingConfiguration="EDABindingConfiguration" contract="PSWGS.Mobile.Mdt.ExternalDataAgent.IMobileDataService" />
<endpoint name="EDASendData" address="" binding="basicHttpBinding" bindingConfiguration="EDABindingConfiguration" contract="PSWGS.Mobile.Mdt.ExternalDataAgent.IDataReceiver" />
<binding name="EDABindingConfiguration" receiveTimeout="00:30:00" sendTimeout="00:30:00" maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647">
July 2010 A-3
Client API Guide WCF Endpoints (Service and Client)
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="65535" />
<add key="LogonUserId" value="NUser1" />