web service error "The identifier id4 does not appear in the document."

  • Thread starter Thread starter gcao99
  • Start date Start date
G

gcao99

Hi,

I'm writing a Windows CE application in Visual Studio 2005 to consume a
web service from Tomcat+Axis and got this error:

Message: The identifier id4 does not appear in the document.

Stacktrace: at System.Xml.Serialization.ReferenceFixup.fixup()
at System.Xml.Serialization.XmlSerializationReader.runFixups()
at System.Web.Services.Protocols.SoapMessageParser.execute()
at System.Web.Services.Protocols.SoapMessageSerializer.Deserialize()
at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke()
at CEClient.MFormsServer.MFormsServiceEndPointService.getForms()
at CEClient.Communicator.PollOnce()
at CEClient.Communicator.TimerCB()
at System.Threading.Timer.ring()


I can assure you that this web service works fine in .Net full
framework. After searched in google and google groups, I noticed
someone else reported the same problem 2 years ago and got no fix.

http://groups.google.com/group/micr...read/thread/608ff8332cb5bd60/c7b423d752300458

Below is the soap response. As you can see, an element with id="id4"
does exist.

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:getFormsResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://webservice.mloserver.danucom.com">
<getFormsReturn href="#id0"/>
</ns1:getFormsResponse>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
soapenc:arrayType="xsd:anyType[4]" xsi:type="soapenc:Array"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<multiRef href="#id1"/>
<multiRef href="#id2"/>
<multiRef href="#id3"/>
<multiRef href="#id4"/>
</multiRef>
<multiRef id="id2" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:Form" xmlns:ns2="urn:danucom"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<binaryDefinition xsi:type="xsd:base64Binary" xsi:nil="true"/>
<createdAt xsi:type="xsd:dateTime" xsi:nil="true"/>
<description xsi:type="xsd:string" xsi:nil="true"/>
<formId
xsi:type="xsd:string">1f1bd98z10a1883d317zx7feb10x10x1x171</formId>
<groupIds href="#id5"/>
<id xsi:type="xsd:string" xsi:nil="true"/>
<instantiable xsi:type="xsd:boolean">true</instantiable>
<name xsi:type="xsd:string">TestForm2</name>
<pdfDefinition xsi:type="xsd:base64Binary" xsi:nil="true"/>
<publishedBy xsi:type="xsd:long">0</publishedBy>
<status xsi:type="xsd:string">Active</status>
<tagIds href="#id6"/>
<textDefinition xsi:type="xsd:string" xsi:nil="true"/>
<version
xsi:type="xsd:string">1f1bd98z10a1883d317zx7feb10x10x1x171</version>
</multiRef>
<multiRef id="id3" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:Form" xmlns:ns3="urn:danucom"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<binaryDefinition xsi:type="xsd:base64Binary" xsi:nil="true"/>
<createdAt xsi:type="xsd:dateTime" xsi:nil="true"/>
<description xsi:type="xsd:string" xsi:nil="true"/>
<formId
xsi:type="xsd:string">3299f6z109dbeb49dbzx7fbd10x10x1x171</formId>
<groupIds href="#id7"/>
<id xsi:type="xsd:string" xsi:nil="true"/>
<instantiable xsi:type="xsd:boolean">true</instantiable>
<name xsi:type="xsd:string">TestProcessForm</name>
<pdfDefinition xsi:type="xsd:base64Binary" xsi:nil="true"/>
<publishedBy xsi:type="xsd:long">0</publishedBy>
<status xsi:type="xsd:string">Active</status>
<tagIds href="#id8"/>
<textDefinition xsi:type="xsd:string" xsi:nil="true"/>
<version
xsi:type="xsd:string">3299f6z109dbeb49dbzx7fbd10x10x1x171</version>
</multiRef>
<multiRef id="id4" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns4:Form" xmlns:ns4="urn:danucom"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<binaryDefinition xsi:type="xsd:base64Binary" xsi:nil="true"/>
<createdAt xsi:type="xsd:dateTime" xsi:nil="true"/>
<description xsi:type="xsd:string" xsi:nil="true"/>
<formId
xsi:type="xsd:string">19480b8z109b1df51d3zx7ff910x10x1x171</formId>
<groupIds href="#id9"/>
<id xsi:type="xsd:string" xsi:nil="true"/>
<instantiable xsi:type="xsd:boolean">true</instantiable>
<name xsi:type="xsd:string">TestForm</name>
<pdfDefinition xsi:type="xsd:base64Binary" xsi:nil="true"/>
<publishedBy xsi:type="xsd:long">0</publishedBy>
<status xsi:type="xsd:string">Active</status>
<tagIds href="#id10"/>
<textDefinition xsi:type="xsd:string" xsi:nil="true"/>
<version
xsi:type="xsd:string">19480b8z109b1df51d3zx7ff910x10x1x171</version>
</multiRef>
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns5:Form" xmlns:ns5="urn:danucom"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<binaryDefinition xsi:type="xsd:base64Binary" xsi:nil="true"/>
<createdAt xsi:type="xsd:dateTime" xsi:nil="true"/>
<description xsi:type="xsd:string" xsi:nil="true"/>
<formId
xsi:type="xsd:string">1e2a069z109d663f9bdzx7fea10x10x1x171</formId>
<groupIds href="#id11"/>
<id xsi:type="xsd:string" xsi:nil="true"/>
<instantiable xsi:type="xsd:boolean">true</instantiable>
<name xsi:type="xsd:string">TestForm1</name>
<pdfDefinition xsi:type="xsd:base64Binary" xsi:nil="true"/>
<publishedBy xsi:type="xsd:long">0</publishedBy>
<status xsi:type="xsd:string">Active</status>
<tagIds href="#id12"/>
<textDefinition xsi:type="xsd:string" xsi:nil="true"/>
<version
xsi:type="xsd:string">1fc25e5z10b145da2bczx7f3710x10x1x171</version>
</multiRef>
<multiRef id="id7" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
soapenc:arrayType="xsd:anyType[0]" xsi:type="soapenc:Array"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
<multiRef id="id9" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
soapenc:arrayType="xsd:anyType[0]" xsi:type="soapenc:Array"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
<multiRef id="id6" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
soapenc:arrayType="xsd:anyType[0]" xsi:type="soapenc:Array"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
<multiRef id="id11" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
soapenc:arrayType="xsd:anyType[0]" xsi:type="soapenc:Array"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
<multiRef id="id5" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
soapenc:arrayType="xsd:anyType[0]" xsi:type="soapenc:Array"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
<multiRef id="id12" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
soapenc:arrayType="xsd:anyType[0]" xsi:type="soapenc:Array"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
<multiRef id="id10" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
soapenc:arrayType="xsd:anyType[0]" xsi:type="soapenc:Array"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
<multiRef id="id8" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
soapenc:arrayType="xsd:anyType[0]" xsi:type="soapenc:Array"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
</soapenv:Body>
</soapenv:Envelope>

Someone please help. I really need to get this work to move forward.

Thank you very much.

Cao
 
Any compact framework gurus please look at this post and offer your
opinions, suggestions or fixes. If you need more information please let
me know. Thanks.
 
Looks like this is related to the wsdl. We deploy our web service by
writing a server-config.wsdd and have axis to generate wsdl. For any
methods that return a collection object, axis sets response type to
ArrayOf_xsd_anyType. This causes problem in compact framework and we
got the abovementioned unhelpful message.

We found 2 workarounds for above problem(assume "List getForms()" is
the problematic method):

1. manually create the wsdl and set response type to a more specific
type say ArrayOfForm which is defined this way:
<complexType name="ArrayOfForm">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="impl:Form[]"/>
</restriction>
</complexContent>
</complexType>

2. change getForms() to return Form[] instead of Collection/List. I
didn't try this but feel this will work.


Regards,
Cao
 
Back
Top