jackrabbit session.importXML() does not honour uuid - jackrabbit

I have been trying to import xml data in to JCR using
session.importXML("/", resource, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW);
First time it works fine, but when I do the import the same data again it does not not throw exception even though the uids in the xml are the same. It just adds the records to the database. That means my records keep adding to the database every time I import
It throws exception if I import the xml twice in the same session. If I import the xml in different sessions it does not throw exception. I did some debugging in to the jackrabbit code. At the time of importing the data from xml jackrabbit goes through each record and it if it has unique id then it tries to find whether the record already exists, apparently it does not find even though that is there. It finds it if the record already imported in the same session.
Here is my XML.
<?xml version="1.0" encoding="UTF-8"?>
<sv:node xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:pb="http://pb.com/pb/hubble/projects/1.0/"
xmlns:sv="http://www.jcp.org/jcr/sv/1.0"
sv:name="Viewpoint">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>pb:component</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>cbd43fb6-3530-11e4-8920-164230d1df67</sv:value>
</sv:property>
<sv:property sv:name="className" sv:type="String">
<sv:value>com.pb.viewpoint.common.model.Component</sv:value>
</sv:property>
<sv:property sv:name="jcr:title" sv:type="String">
<sv:value>Viewpoint</sv:value>
</sv:property>
<sv:property sv:name="pb:licensed" sv:type="Boolean">
<sv:value>true</sv:value>
</sv:property>
<sv:node sv:name="pb:roles" jcr:primaryType="pb:role">
<sv:node sv:name="Community Administrator">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>pb:role</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>cbd441d2-3530-11e4-8920-164230d1df67</sv:value>
</sv:property>
<sv:property sv:name="className" sv:type="String">
<sv:value>com.pb.viewpoint.common.model.Role</sv:value>
</sv:property>
<sv:property sv:name="jcr:title" sv:type="String">
<sv:value>Community Administrator</sv:value>
</sv:property>
<sv:property sv:name="pb:nameDisplayKey" sv:type="String">
<sv:value>roleNameKey.CommunityAdministrator</sv:value>
</sv:property>
<sv:property sv:name="pb:categoryDisplayKey" sv:type="String">
<sv:value>categoryKey.Administrative</sv:value>
</sv:property>
<sv:property sv:name="pb:category" sv:type="String">
<sv:value>Administrative</sv:value>
</sv:property>
<sv:property sv:name="pb:type" sv:type="String">
<sv:value>ADMINISTRATOR</sv:value>
</sv:property>
<sv:node sv:name="pb:entitlements" jcr:primaryType="pb:entitlement">
<sv:node sv:name="VIEWPOINT_LIST_ROLE_MAPPINGS">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>pb:entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>cbd44308-3530-11e4-8920-164230d1df67</sv:value>
</sv:property>
<sv:property sv:name="className" sv:type="String">
<sv:value>com.pb.viewpoint.common.model.Entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:title" sv:type="String">
<sv:value>VIEWPOINT_LIST_ROLE_MAPPINGS</sv:value>
</sv:property>
</sv:node>
<sv:node sv:name="VIEWPOINT_UPDATE_ROLE_MAPPINGS">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>pb:entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>cbd44434-3530-11e4-8920-164230d1df67</sv:value>
</sv:property>
<sv:property sv:name="className" sv:type="String">
<sv:value>com.pb.viewpoint.common.model.Entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:title" sv:type="String">
<sv:value>VIEWPOINT_UPDATE_ROLE_MAPPINGS</sv:value>
</sv:property>
</sv:node>
<sv:node sv:name="VIEWPOINT_LIST_COMMUNITIES">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>pb:entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>85438386-343b-11e4-99ba-164230d1df67</sv:value>
</sv:property>
<sv:property sv:name="className" sv:type="String">
<sv:value>com.pb.viewpoint.common.model.Entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:title" sv:type="String">
<sv:value>VIEWPOINT_LIST_COMMUNITIES</sv:value>
</sv:property>
</sv:node>
<sv:node sv:name="VIEWPOINT_UPDATE_COMMUNITIES">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>pb:entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>854385fc-343b-11e4-99ba-164230d1df67</sv:value>
</sv:property>
<sv:property sv:name="className" sv:type="String">
<sv:value>com.pb.viewpoint.common.model.Entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:title" sv:type="String">
<sv:value>VIEWPOINT_UPDATE_COMMUNITIES</sv:value>
</sv:property>
</sv:node>
<sv:node sv:name="VIEWPOINT_VIEW_COMMUNITY_TO_VAULT_DATABASE_MAPPINGS">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>pb:entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>cbd4465a-3530-11e4-8920-164230d1df67</sv:value>
</sv:property>
<sv:property sv:name="className" sv:type="String">
<sv:value>com.pb.viewpoint.common.model.Entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:title" sv:type="String">
<sv:value>VIEWPOINT_VIEW_COMMUNITY_TO_VAULT_DATABASE_MAPPINGS</sv:value>
</sv:property>
</sv:node>
<sv:node sv:name="VIEWPOINT_EDIT_COMMUNITY_TO_VAULT_DATABASE_MAPPINGS">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>pb:entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>cbd4484e-3530-11e4-8920-164230d1df67</sv:value>
</sv:property>
<sv:property sv:name="className" sv:type="String">
<sv:value>com.pb.viewpoint.common.model.Entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:title" sv:type="String">
<sv:value>VIEWPOINT_EDIT_COMMUNITY_TO_VAULT_DATABASE_MAPPINGS</sv:value>
</sv:property>
</sv:node>
<sv:node sv:name="VIEWPOINT_VIEW_ENGAGEONE_SERVER">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>pb:entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>8543873c-343b-11e4-99ba-164230d1df67</sv:value>
</sv:property>
<sv:property sv:name="className" sv:type="String">
<sv:value>com.pb.viewpoint.common.model.Entitlement</sv:value>
</sv:property>
<sv:property sv:name="jcr:title" sv:type="String">
<sv:value>VIEWPOINT_VIEW_ENGAGEONE_SERVER</sv:value>
</sv:property>
</sv:node>
</sv:node>
</sv:node>
</sv:node>
Is there any reason for the strange behaviour, am I doing something wrong ?

Someone reason I don't see this behaviour in Database backed Jackrabbit.
I have only observed the behaviour in InMemory Jackrabbit which stopped me writting my tests

Related

request wsdl service array object

I am using visual basic .net. I want to operate on wsdl service. I'm having a problem with something. I need to insert data into the service. I have no problem connecting to the service. but I could not run the function by using the objects defined in the wsdl file. I'm waiting for your help.
wsdl file
<wsdl:definitions xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:p1="http://xxxxxxx.com/Retail/MAYA/TDMStokHareket" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="SI_TDMStokHareket_OB" targetNamespace="http://xxxxxx">
<wsdl:documentation/>
<wsp:UsingPolicy wsdl:required="false"/>
<wsp:Policy wsu:Id="OP_SI_TDMStokHareket_OB"/>
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:sap-com:document:sap:rfc:functions" targetNamespace="urn:sap-com:document:sap:rfc:functions">
<xsd:element name="ZRT_TDM_STOK_HAREKET">
<xsd:complexType>
<xsd:all>
<xsd:element name="ET_RETURN" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" type="ZRS_TDM_STOK_HAREKET_RES" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="IT_DATA" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" type="ZRS_TDM_STOK_HAREKET" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:element name="ZRT_TDM_STOK_HAREKET.Response">
<xsd:complexType>
<xsd:all>
<xsd:element name="EV_STATU" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ET_RETURN" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" type="ZRS_TDM_STOK_HAREKET_RES" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="IT_DATA" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" type="ZRS_TDM_STOK_HAREKET" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="ZRS_TDM_STOK_HAREKET_RES">
<xsd:sequence>
<xsd:element name="MESSAGE" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Message Text</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="220"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ZRS_TDM_STOK_HAREKET">
<xsd:sequence>
<xsd:element name="TDM_KODU" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Search Term 1</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="20"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="DSN_KODU" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Search Term 1</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="20"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="DSN_ALT_BAYI" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Search Term 1</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="20"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="DSN_ALT_BAYI_ADI" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Name</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="30"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MATNR" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Material Number</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="18"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="SERGE" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Manufacturer serial number</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="30"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MENGE" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Quantity</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:decimal">
<xsd:totalDigits value="13"/>
<xsd:fractionDigits value="3"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="rfc.ZRT_TDM_STOK_HAREKET.Input">
<wsdl:documentation/>
<wsdl:part name="parameters" element="rfc:ZRT_TDM_STOK_HAREKET"/>
</wsdl:message>
<wsdl:message name="rfc.ZRT_TDM_STOK_HAREKET.Output">
<wsdl:documentation/>
<wsdl:part name="parameters" element="rfc:ZRT_TDM_STOK_HAREKET.Response"/>
</wsdl:message>
<wsdl:portType name="SI_TDMStokHareket_OB">
<wsdl:documentation/>
<wsdl:operation name="SI_TDMStokHareket_OB">
<wsdl:documentation/>
<wsp:Policy>
<wsp:PolicyReference URI="#OP_SI_TDMStokHareket_OB"/>
</wsp:Policy>
<wsdl:input message="p1:rfc.ZRT_TDM_STOK_HAREKET.Input"/>
<wsdl:output message="p1:rfc.ZRT_TDM_STOK_HAREKET.Output"/>
</wsdl:operation>
</wsdl:portType>
vb code
client.SI_TDMStokHareket_OB(response.ET_RETURN, request.IT_DATA)
MsgBox(response.ET_RETURN(0).MESSAGE)
I can't send data to the function. Can you help with objects and arrays? thanks
I solved the problem of sending the values to the function as follows
ReDim request.IT_DATA(0)
request.IT_DATA(0) = New ZRS_TDM_STOK_HAREKET
request.IT_DATA(0).TDM_KODU = "70031.42002"
request.IT_DATA(0).DSN_KODU = "70031.42002"
request.IT_DATA(0).DSN_ALT_BAYI = "00000.12345"
request.IT_DATA(0).DSN_ALT_BAYI_ADI = "CAGLAR DSN ALT BAYISI"
request.IT_DATA(0).MATNR = "100000000000001287"
request.IT_DATA(0).SERGE = "445313311000213"
request.IT_DATA(0).MENGESpecified = True
request.IT_DATA(0).MENGE = 1
client.SI_TDMStokHareket_OB(response.ET_RETURN, request.IT_DATA)
MsgBox(response.ET_RETURN(0).MESSAGE)

struggling with XML namespace nodes query

I'm struggling to get my head around XML namespace query when using XML nodes - I've read other similar questions here and an article here but cannot apply this to my specific query.
I have a larger version of this sample XML:
SELECT CAST('<Navigator clsid="{ABF8EB05-610D-11D3-A53E-684F745C}">
<Version>7</Version>
<NavigatorNodes clsid="{0484ACB1-78F5-48D7-A26B-3A0ACD3A5F91}">
<NavigatorNode clsid="{59AB61BD-7833-4954-94C2-B6D737E3DD6F}">
<Indent>0</Indent>
<Caption>Contact</Caption>
<Selected>0</Selected>
<ViewType>0</ViewType>
<ViewSubType>0</ViewSubType>
<ShowTotals>0</ShowTotals>
<RowHeight>0</RowHeight>
<Complement>0</Complement>
<FreezeFirst>0</FreezeFirst>
<a1:QueryFilter xmlns:a2="http://www.ascenttechnology.co.uk/schemas/entities" xmlns:xsi="http://www.w3.org/21/XMLSchema-instance" xmlns:a1="http://www.ascenttechnology.co.uk/schemas/services" Type="QueryFilter">
<entity_name>Contact</entity_name>
<relationship_name />
<relationship_from_entity_name />
<a1:ColumnInfoCollection Type="ColumnInfoCollection" AscentCollection="true">
<__vers>1</__vers>
<IgnoreMissingItem>0</IgnoreMissingItem>
<ReadOnly>0</ReadOnly>
<AllowNulls>0</AllowNulls>
<a1:ColumnInfo Type="ColumnInfo">
<attribute_name>state</attribute_name>
<width>0</width>
</a1:ColumnInfo>
<a1:ColumnInfo Type="ColumnInfo">
<attribute_name>current_address_suffix</attribute_name>
<width>0</width>
</a1:ColumnInfo>
</a1:ColumnInfoCollection>
<a1:SurveyColumnInfoCollection Type="AttributeInfoCollection" AscentCollection="true">
<__vers>1</__vers>
<IgnoreMissingItem>0</IgnoreMissingItem>
<ReadOnly>0</ReadOnly>
<AllowNulls>0</AllowNulls>
</a1:SurveyColumnInfoCollection>
<a1:WorkflowColumnInfoCollection Type="AttributeInfoCollection" AscentCollection="true">
<__vers>1</__vers>
<IgnoreMissingItem>0</IgnoreMissingItem>
<ReadOnly>0</ReadOnly>
<AllowNulls>0</AllowNulls>
</a1:WorkflowColumnInfoCollection>
<a1:ConditionCollection Type="ConditionCollection" AscentCollection="true">
<__vers>1</__vers>
<IgnoreMissingItem>0</IgnoreMissingItem>
<ReadOnly>0</ReadOnly>
<AllowNulls>0</AllowNulls>
<a1:Condition Type="Condition">
<attribute_name>class</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>28</operator>
<value1>1</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>do_not_mail</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1>True</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>gone_away</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1>True</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>dp_opt_out</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1>True</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>deceased</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1>True</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>deleted</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1>True</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>Date_Of_Birth</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>19</operator>
<value1>2010-06-23T::.+:</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>home_address1</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>26</operator>
<value1 xsi:nil="true" />
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>home_postcode</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>26</operator>
<value1 xsi:nil="true" />
<value2 xsi:nil="true" />
<indent_level>1</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>home_address1</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1 />
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>home_postcode</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1 />
<value2 xsi:nil="true" />
<indent_level>1</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
</a1:ConditionCollection>
<a1:OrderByCollection Type="OrderByCollection" AscentCollection="true">
<__vers>1</__vers>
<IgnoreMissingItem>0</IgnoreMissingItem>
<ReadOnly>0</ReadOnly>
<AllowNulls>0</AllowNulls>
</a1:OrderByCollection>
<SelectedArticles xsi:nil="true" />
<groupby_field_name />
<reporting_currency>52</reporting_currency>
<Negate_Filter>0</Negate_Filter>
<Survey_Id>----</Survey_Id>
<Survey_Name xsi:nil="true" />
<Workflow_Id>----</Workflow_Id>
<Workflow_Name xsi:nil="true" />
<XPath>0</XPath>
<locale>0</locale>
</a1:QueryFilter>
</NavigatorNode>
</NavigatorNodes>
</Navigator>' AS XML) as xmldata
And have been trying queries to get to the information contained within the a1:Condition Node. I've tried queries such as:
;WITH XMLNAMESPACES(
'http://www.ascenttechnology.co.uk/schemas/services' AS a1
,'http://www.ascenttechnology.co.uk/schemas/entities' AS a2
,DEFAULT 'http://www.w3.org/21/XMLSchema-instance'
)
SELECT
#xmldata.*
,ref.value('attribute_name[1]','NVARCHAR(50)') as attribute_name
FROM #xmldata
CROSS APPLY xmldata.nodes('/Navigator/NavigatorNodes/NavigatorNode/a1:QueryFilter/a1:ConditionCollection/a1:Condition') T(ref)
But they're always coming back blank when I get near the namespaced nodes - I'm able to pull data from the nodes all the way up to '/Navigator/NavigatorNodes/NavigatorNode' but then have no luck.
Thanks!
You declare DEFAULT 'http://www.w3.org/21/XMLSchema-instance' but your XML string does even not have a default namespace.
Try
WITH XMLNAMESPACES(
'http://www.ascenttechnology.co.uk/schemas/services' AS a1
, 'http://www.ascenttechnology.co.uk/schemas/entities' AS a2
)

SecurityNegotiationException in WPF client when contacting windows service on another pc

I am getting the following exception for a client that is accessing data from service that is hosting a wcf in windows service.
Event Log at Client:
Event Type: Error
Event Source: .NET Runtime
Event Category: None
Event ID: 1026
Date: 10/18/2011
Time: 3:32:20 PM
User: N/A
Computer: PAVAN-A259DD4E8
Description:
Application: WorkMateWPF.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ServiceModel.Security.SecurityNegotiationException
Stack:
Server stack trace:
at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)
at System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorBase.InitiateUpgrade(Stream stream)
at System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessage)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(System.Runtime.Remoting.Proxies.MessageData ByRef, Int32)
at WorkMateWPF.ServiceLogins.IWCFLogin.Authentication(WorkMateLib.LoginsDLL.Login)
at WorkMateWPF.ServiceLogins.WCFLoginClient.Authentication(WorkMateLib.LoginsDLL.Login)
at WorkMateWPF.Login.LoginButton1_Click(System.Object, System.Windows.RoutedEventArgs)
at WorkMateWPF.Login.Grid1_KeyDown(System.Object, System.Windows.Input.KeyEventArgs)
at System.Windows.Input.KeyEventArgs.InvokeEventHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs, Boolean)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawKeyboardActions, Int32, Boolean, Boolean, Int32)
at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(System.Windows.Interop.MSG ByRef, Boolean ByRef)
at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(System.Windows.Interop.MSG ByRef, System.Windows.Input.ModifierKeys)
at System.Windows.Interop.HwndSource.OnPreprocessMessage(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at System.Windows.Threading.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority, System.Delegate, System.Object)
at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(System.Windows.Interop.MSG ByRef, Boolean ByRef)
at System.Windows.Interop.HwndSource+WeakEventPreprocessMessage.OnPreprocessMessage(System.Windows.Interop.MSG ByRef, Boolean ByRef)
at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at System.Windows.Application.Run()
at WorkMateWPF.Application.Main()
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Following is the app file for windows service:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="WorkMateWCF.My.MySettings.workmateConnectionString"
connectionString="Data Source=pavan-pc1;Initial Catalog=WorkMate;Persist Security Info=True;User ID=SA;Password=surpavan"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service name="WorkMateWCF.WCFLogin">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="WorkMateWCF.IWCFLogin">
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://10.1.1.1:8732/WCFLogin" />
</baseAddresses>
</host>
</service>
<service name="WorkMateWCF.WCFCourses">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="WorkMateWCF.IWCFCourses">
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://10.1.1.1:8732/WCFCourses" />
</baseAddresses>
</host>
</service>
<service name="WorkMateWCF.WCFStudent">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="WorkMateWCF.IWCFStudent">
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://10.1.1.1:8732/WCFStudents" />
</baseAddresses>
</host>
</service>
<service name="WorkMateWCF.WCFBatchImport">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="WorkMateWCF.IWCFBatchImport">
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://10.1.1.1:8732/WCFBatchImports" />
</baseAddresses>
</host>
</service>
<service name="WorkMateWCF.WCFFaculty">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="WorkMateWCF.IWCFFaculty">
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://10.1.1.1:8732/WCFFaculty" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Following is the app file for the client:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="WorkMateWPF.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IWCFBatchImport" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="NetTcpBinding_IWCFCourses" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="NetTcpBinding_IWCFFaculty" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="NetTcpBinding_IWCFLogin" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10000"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="NetTcpBinding_IWCFStudent" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://10.1.1.1:8732/WCFBatchImports"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IWCFBatchImport"
contract="ServiceBatchImports.IWCFBatchImport" name="NetTcpBinding_IWCFBatchImport">
</endpoint>
<endpoint address="net.tcp://10.1.1.1:8732/WCFCourses" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IWCFCourses" contract="ServiceCourses.IWCFCourses"
name="NetTcpBinding_IWCFCourses">
</endpoint>
<endpoint address="net.tcp://10.1.1.1:8732/WCFFaculty" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IWCFFaculty" contract="ServiceFaculty.IWCFFaculty"
name="NetTcpBinding_IWCFFaculty">
</endpoint>
<endpoint address="net.tcp://10.1.1.1:8732/WCFLogin" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IWCFLogin" contract="ServiceLogins.IWCFLogin"
name="NetTcpBinding_IWCFLogin">
</endpoint>
<endpoint address="net.tcp://10.1.1.1:8732/WCFStudents" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IWCFStudent" contract="ServiceStudents.IWCFStudent"
name="NetTcpBinding_IWCFStudent">
</endpoint>
</client>
</system.serviceModel>
<userSettings>
<WorkMateWPF.MySettings>
<setting name="Test" serializeAs="String">
<value />
</setting>
</WorkMateWPF.MySettings>
</userSettings>
</configuration>
Looking forward for you help. Thank you.

How to make TCP enabled on lan

I have written a code for my WPF App to use WCF, wcf is running as Windows service, I want the program wpf to run on client machines. I installed WPF app on PC along with the service and sql server, it is working fine in there. However, when I installed the wpf client on another PC, the client WPF is not able to connect to the server. I mean the WCF windows service is not support for lan usage, however I designed it for this intention only. Could you please check my code and tell me where I have gone wrong please.
WPF App code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="WorkMateWPF.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IWCFBatchImport" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="NetTcpBinding_IWCFCourses" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="NetTcpBinding_IWCFFaculty" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="NetTcpBinding_IWCFLogin" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="NetTcpBinding_IWCFStudent" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://localhost:8732/WCFBatchImports"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IWCFBatchImport"
contract="ServiceBatchImports.IWCFBatchImport" name="NetTcpBinding_IWCFBatchImport">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="net.tcp://localhost:8732/WCFCourses" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IWCFCourses" contract="ServiceCourses.IWCFCourses"
name="NetTcpBinding_IWCFCourses">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="net.tcp://localhost:8732/WCFFaculty" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IWCFFaculty" contract="ServiceFaculty.IWCFFaculty"
name="NetTcpBinding_IWCFFaculty">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="net.tcp://localhost:8732/WCFLogin" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IWCFLogin" contract="ServiceLogins.IWCFLogin"
name="NetTcpBinding_IWCFLogin">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="net.tcp://localhost:8732/WCFStudents" binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IWCFStudent" contract="ServiceStudents.IWCFStudent"
name="NetTcpBinding_IWCFStudent">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
<userSettings>
<WorkMateWPF.MySettings>
<setting name="Test" serializeAs="String">
<value />
</setting>
</WorkMateWPF.MySettings>
</userSettings>
</configuration>
Following is the service app code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="WorkMateWCF.My.MySettings.workmateConnectionString"
connectionString="Data Source=PAVAN-PC;Initial Catalog=WorkMate;Persist Security Info=True;User ID=WorkMateUser;Password=workmateuser"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service name="WorkMateWCF.WCFLogin">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="WorkMateWCF.IWCFLogin">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8732/WCFLogin" />
</baseAddresses>
</host>
</service>
<service name="WorkMateWCF.WCFCourses">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="WorkMateWCF.IWCFCourses">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8732/WCFCourses" />
</baseAddresses>
</host>
</service>
<service name="WorkMateWCF.WCFStudent">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="WorkMateWCF.IWCFStudent">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8732/WCFStudents" />
</baseAddresses>
</host>
</service>
<service name="WorkMateWCF.WCFBatchImport">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="WorkMateWCF.IWCFBatchImport">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8732/WCFBatchImports" />
</baseAddresses>
</host>
</service>
<service name="WorkMateWCF.WCFFaculty">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="WorkMateWCF.IWCFFaculty">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8732/WCFFaculty" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Looking forward for the needfull. Thank you.
It appears that all of your service addresses are set to localhost, in both the service and the client config files. Localhost always refers to the machine the program is running on.
You'll need to use the correct machine name for the service and reference it in the client.
For example, say your service is hosted on a machine on the network with the following address - myservicebox:8732. The service's config file would look like this:
<service name="WorkMateWCF.WCFLogin">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="WorkMateWCF.IWCFLogin">
<identity>
<dns value="myservicebox" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://myservicbox:8732/WCFLogin" />
</baseAddresses>
</host>
</service>
You would then reference net.tcp://myservicebox:8732/WCFLogin in your client(s) that wish to utilize the service.
Also, note that your service (based on your posted config file) will be using the default values for the specified bindings, which may cause problems for you if you need different values (like bigger message size, etc).
Your client config will use the bindings you've set up as you assign them to the client endpoints via the bindingConfiguration attribute.
Not necessarily a problem in your case (and it looks like you're using the default values on the client anyway, at a quick glance), but something to be aware of.
I later checked the event logs and the issue was with the time on binding and I changed it to 00:10:00 and it seems to work, but this time I landed on a new error and it does not relate to this question.

how to disable timestamp in WCF "wsHTTPBinding"?

I want to disable timestamp in WCF wsHTTPBinding because if I have client has different time more than 10 min it give me exception that the time is in the future how I can disable it or if there is another solution ?
code example in client :in app.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IFileTransferServiceClient" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8732/Design_Time_Addresses/filetransfer/FileTransferServiceClient/"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IFileTransferServiceClient"
contract="IFileTransferServiceClient" name="WSHttpBinding_IFileTransferServiceClient">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
Increase the MaxClockSkew property: http://msdn.microsoft.com/en-us/library/aa738468.aspx

Resources