none
Array in WCF-Response is null RRS feed

  • Question

  • Hello,

    I have an AXIS 1.4 webservice and a C# .NET client.

    As I receive a response from this webservice, I get an empty array back. But Fiddler says something different, it shows me the values. If I use the same request from a Java-Client, the array is filled with values.

    I have no Idea why this is not working. Can u please help me?

    Here are the important parts from my WSDL-File:

    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://gen.ws.dvelop.com" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://gen.ws.dvelop.com">
    	<wsdl:documentation>D3WService</wsdl:documentation>
    	<wsdl:types>
    		<xsd:schema xmlns="http://gen.ws.dvelop.com" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://gen.ws.dvelop.com">
    			<xsd:complexType name="TDocField">
    				<xsd:attribute name="field_no" type="xsd:int" use="required"/>
    				<xsd:attribute name="row_no" type="xsd:int" use="optional"/>
    				<xsd:attribute name="value" type="xsd:string" use="required"/>
    			</xsd:complexType>
    			<xsd:complexType name="TDocFields">
    				<xsd:sequence>
    					<xsd:element name="doc_field" type="TDocField" maxOccurs="unbounded" minOccurs="0"/>
    				</xsd:sequence>
    			</xsd:complexType>
    
    <xsd:complexType name="TSearchDocumentImport">
    				<xsd:sequence>
    					<xsd:element name="max_number_of_docs" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_number" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_type_short" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="var_number" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_id" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_status" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="user" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="date1" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="date2" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="search_modified_tstamp_1" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="search_modified_tstamp_2" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="web_published" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="owner" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_extension" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="text" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="searchtext_expression" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="dsearch_similar_doc_id" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="dsearch_min_relevance" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="dsearch_want_hints" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="dsearch_by_example" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="vice_user" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_size" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="date_create" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="date_access" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="sort_order" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="search_upd_attr_tstamp_1" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="search_upd_attr_tstamp_2" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="folder_id" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="color_code" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="overall_proc_tstamp_1" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="overall_proc_tstamp_2" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="released" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="verified" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="outColumnNames" type="TOutCols" minOccurs="0" maxOccurs="1"/>
    					<xsd:element name="doc_fields" type="TDocFields" minOccurs="0" maxOccurs="1"/>
    				</xsd:sequence>
    			</xsd:complexType>
    			<xsd:complexType name="TSearchDocumentExport">
    				<xsd:sequence>
    					<xsd:element name="number" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="files_refused" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="dsearch_used_words" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="dsearch_hint_words" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="dsearch_corrections" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="outColumnNames" type="TOutCols" minOccurs="0" maxOccurs="1"/>
    				</xsd:sequence>
    			</xsd:complexType>
    			<xsd:complexType name="TDocumentItem">
    				<xsd:sequence>
    					<xsd:element name="doc_id" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="sender" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="sender_long" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="sender_short" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="sender_type" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="recipient" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="recipient_long" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="recipient_short" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="recipient_type" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="date_received" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="date_remember" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="notice" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="timestamp_sent" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="timestamp_acknowledged" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="date_acknowledge_until" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="chain_id" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="holdfile_type" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="holdfile_path" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="holdfile_read" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="wfl_id" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="wfl_step_id" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="wfl_step_ident_nr" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="origin_long" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="reference" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="wfl_name" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="wfl_step_name" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="holdfile_id" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_type" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_type_short" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_number" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="var_number" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_text_1" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_text_2" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_text_3" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_text_4" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="orig_filename" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_ext" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_status" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_status_id" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_editor" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="size_kb" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="owner" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="date_of_import" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="last_alteration_number" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="last_alteration_timestamp" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="alteration_number_released" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="caption" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="web_published" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="access_key_B" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="access_key_P" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="access_key_F" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="access_key_A" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_permission" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="dependent_documents" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="dependent_documents_in_public" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="old_archive_suffix" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_type_type" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="signature" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="size_byte" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="dependent_documents_byte" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="dependent_documents_in_public_byte" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="relevance" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="origin" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_editor_long" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_ext_in_public" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="timestamp_of_import" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_link" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_id_father" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="hierarchy" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="last_access_timestamp" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="last_update_attributes" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="max_archive_index" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_file_versions" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="color_code" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="overall_proc_timestamp" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_editor_displayname" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="owner_long" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="released" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="verified" minOccurs="0" type="xsd:string"/>
    					<xsd:element name="doc_fields" type="TDocFields" minOccurs="0" maxOccurs="1"/>
    					<xsd:element name="TWSDownloadURLs" minOccurs="0" type="TWSDownloadURLs"/>
    					<xsd:element name="WSDownloadURL" minOccurs="0" type="xsd:anyURI"/>
    				</xsd:sequence>
    			</xsd:complexType>
    			<xsd:complexType name="TDocumentItems">
    				<xsd:sequence>
    					<xsd:element name="item" maxOccurs="unbounded" minOccurs="0" type="TDocumentItem"/>
    				</xsd:sequence>
    			</xsd:complexType>
    			<xsd:element name="SearchDocumentRequest">
    				<xsd:complexType>
    					<xsd:complexContent>
    						<xsd:extension base="TD3Request">
    							<xsd:sequence>
    								<xsd:element name="import" type="TSearchDocumentImport"/>
    								<xsd:element xmlns:xmime="http://www.w3.org/2005/05/xmlmime" name="bytes" minOccurs="0" maxOccurs="1" type="xsd:base64Binary" xmime:expectedContentTypes="application/octet-stream"/>
    								<xsd:element name="WSDownloadFormat" minOccurs="0" type="TDownloadUrlFormat"/>
    							</xsd:sequence>
    						</xsd:extension>
    					</xsd:complexContent>
    				</xsd:complexType>
    			</xsd:element>
    			<xsd:element name="SearchDocumentResponse">
    				<xsd:complexType>
    					<xsd:complexContent>
    						<xsd:extension base="TD3Response">
    							<xsd:sequence>
    								<xsd:element name="export" minOccurs="0" maxOccurs="1" type="TSearchDocumentExport"/>
    								<xsd:element name="table" minOccurs="0" maxOccurs="1" type="TDocumentItems"/>
    							</xsd:sequence>
    						</xsd:extension>
    					</xsd:complexContent>
    				</xsd:complexType>
    			</xsd:element>
    		</xsd:schema>
    	</wsdl:types>
    	<wsdl:message name="SearchDocumentRequest">
    		<wsdl:part name="in" element="tns:SearchDocumentRequest"/>
    	</wsdl:message>
    	<wsdl:message name="SearchDocumentResponse">
    		<wsdl:part name="out" element="tns:SearchDocumentResponse"/>
    	</wsdl:message>
    
    	<wsdl:portType name="D3WServicePortType">
    		<wsdl:operation name="SearchDocument">
    			<wsdl:input message="tns:SearchDocumentRequest" wsaw:Action="ws.dvelop.com/SearchDocument"/>
    			<wsdl:output message="tns:SearchDocumentResponse" wsaw:Action="ws.dvelop.com/D3WS/SearchDocumentResponse"/>
    		</wsdl:operation>
    	</wsdl:portType>
    	<wsdl:binding name="D3WSbinding" type="tns:D3WServicePortType">
    		<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    		<wsdl:operation name="SearchDocument">
    			<soap:operation soapAction="ws.dvelop.com/SearchDocument" style="document"/>
    			<wsdl:input>
    				<soap:body use="literal"/>
    			</wsdl:input>
    			<wsdl:output>
    				<soap:body use="literal"/>
    			</wsdl:output>
    		</wsdl:operation>
    	</wsdl:binding>
    	<wsdl:service name="D3WService">
    		<wsdl:port name="D3WSPort" binding="tns:D3WSbinding">
    			<soap:address location="http://localhost:8082/ws22/services/D3WServiceGen"/>
    		</wsdl:port>
    	</wsdl:service>
    </wsdl:definitions>

    My Response in Fiddler looks like this:

    <?xml version='1.0' encoding='utf-8'?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    	<soapenv:Body>
    		<ns:SearchDocumentResponse xmlns:ns="http://gen.ws.dvelop.com" WSCallNumber="1" WSD3Time="211" WSXmlTime="203">
    			<ReturnCode>10</ReturnCode>
    			<ReturnMessage>Es wurden zu viele Dokumente gefunden. Es wird nur ein Teil der Treffermenge angezeigt! [0000010]</ReturnMessage>
    			<export>
    				<number>10</number>
    				<files_refused>0</files_refused>
    				<dsearch_used_words>[I]</dsearch_used_words>
    				<dsearch_hint_words>[I]</dsearch_hint_words>
    			</export>
    			<table>
    				<item>
    					<doc_id>T000022605</doc_id>
    					<doc_type>UnitTests</doc_type>
    					<doc_type_short>UT</doc_type_short>
    					<doc_number>T000022605</doc_number>
    					<var_number>1</var_number>
    					<orig_filename>Sample60er</orig_filename>
    					<doc_ext>TXT</doc_ext>
    					<doc_status>Fr</doc_status>
    					<doc_status_id>30</doc_status_id>
    					<owner>gboe</owner>
    					<date_of_import>30.07.2013</date_of_import>
    					<last_alteration_number>0</last_alteration_number>
    					<last_alteration_timestamp>30.07.2013 - 12:19:43</last_alteration_timestamp>
    					<alteration_number_released>0</alteration_number_released>
    					<caption>T000022605</caption>
    					<web_published>0</web_published>
    					<access_key_F>CBB7D0DF</access_key_F>
    					<doc_permission>10010100-11011010-11-00-000100111111</doc_permission>
    					<doc_type_type>d</doc_type_type>
    					<codepage>65001</codepage>
    					<signature>0</signature>
    					<size_byte>10</size_byte>
    					<doc_ext_in_public>TXT</doc_ext_in_public>
    					<timestamp_of_import>30.07.2013 - 12:19:43</timestamp_of_import>
    					<doc_link>0</doc_link>
    					<last_access_timestamp>30.07.2013 - 12:19:43</last_access_timestamp>
    					<last_update_attributes>30.07.2013 - 12:19:43</last_update_attributes>
    					<doc_file_versions>1</doc_file_versions>
    					<color_code>0</color_code>
    					<overall_proc_timestamp>30.07.2013 - 12:19:43</overall_proc_timestamp>
    					<owner_long>Gerrit Böing</owner_long>
    					<released>f</released>
    					<verified>j</verified>
    					<doc_fields>
    						<doc_field field_no="61" row_no="-1" value="Tapir" />
    					</doc_fields>
    				</item>
    			</table>
    		</ns:SearchDocumentResponse>
    	</soapenv:Body>
    </soapenv:Envelope>

    So as you can see, the doc_fields-array has exactly one entry, which in this case is right.

    And if I now check the doc_fields in my code, they are always null.

    My Java-Client can interpret the repsonse so the doc_fields are not null.

    I have no idea, why the .NET-Client is not able to read the doc_fields.

    It would be nice, if someone can check this.

    Kind regards


    Monday, June 30, 2014 6:03 AM

Answers

  • Hi,

    This forum is used to discuss the question about the WCF Web Service, then for other types of the web service, please try to post it to this forum:
    #WCF, ASMX and other Web Services Forum:
    http://forums.asp.net/28.aspx/1?WCF+ASMX+and+other+Web+Services .
     

    Thanks for your understanding.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, July 1, 2014 8:24 AM
    Moderator