Error in xml document at (1,280)

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default Error in xml document at (1,280)

    I try to call a logon webservice method with 3 parameters that are
    strings.
    the return value should be a xml string including all information on a
    user object. When I execute the web service from visual studio test
    environment the webservice method run fine and I get the expected xml
    string. But when I try to call this method from a asp.NET page the
    method failed and I get the following error message:

    Error in xml document at (1,280)

    I try to debug the web service (that is currently on my local machine)
    and I see that the user object is correctly serialized and return. But
    the caller of this method is catching a exception. and in the caller
    the xml string is empty.
    I already try to find help on the web like some similar post or white
    papers but nothing seems to match.

    I already tried to change the return value into the user object but I
    get the same problem, it was working in the test envirronment but not
    from a asp.net Page.

    I saw that the problem could be due to derived data class. Is that
    true? if it is , is there a work around?

    I already made a few web services (but not based on derived data
    class) that run perfectly by returning either objects or strings but I
    never encountered this problem.

    here is the Schema of my webservice provided from Webservice studio
    1.0

    <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns:s0="http://www.sogecore.com/webservices/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    targetNamespace="http://www.sogecore.com/webservices/"
    xmlns="http://schemas.xmlsoap.org/wsdl/">
    <types>
    <s:schema elementFormDefault="qualified"
    targetNamespace="http://www.sogecore.com/webservices/">
    <s:element name="Logon">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="Login"
    type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="Password"
    type="s:string" />
    <s:element minOccurs="0" maxOccurs="1"
    name="LogicalUserId" type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="LogonResponse">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="LogonResult"
    type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="string" nillable="true" type="s:string" />
    </s:schema>
    </types>
    <message name="LogonSoapIn">
    <part name="parameters" element="s0:Logon" />
    </message>
    <message name="LogonSoapOut">
    <part name="parameters" element="s0:LogonResponse" />
    </message>
    <message name="LogonHttpGetIn">
    <part name="Login" type="s:string" />
    <part name="Password" type="s:string" />
    <part name="LogicalUserId" type="s:string" />
    </message>
    <message name="LogonHttpGetOut">
    <part name="Body" element="s0:string" />
    </message>
    <message name="LogonHttpPostIn">
    <part name="Login" type="s:string" />
    <part name="Password" type="s:string" />
    <part name="LogicalUserId" type="s:string" />
    </message>
    <message name="LogonHttpPostOut">
    <part name="Body" element="s0:string" />
    </message>
    <portType name="LoginSoap">
    <operation name="Logon">
    <documentation>Check user login and grant access to user if
    successfull.</documentation>
    <input message="s0:LogonSoapIn" />
    <output message="s0:LogonSoapOut" />
    </operation>
    </portType>
    <portType name="LoginHttpGet">
    <operation name="Logon">
    <documentation>Check user login and grant access to user if
    successfull.</documentation>
    <input message="s0:LogonHttpGetIn" />
    <output message="s0:LogonHttpGetOut" />
    </operation>
    </portType>
    <portType name="LoginHttpPost">
    <operation name="Logon">
    <documentation>Check user login and grant access to user if
    successfull.</documentation>
    <input message="s0:LogonHttpPostIn" />
    <output message="s0:LogonHttpPostOut" />
    </operation>
    </portType>
    <binding name="LoginSoap" type="s0:LoginSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
    style="document" />
    <operation name="Logon">
    <soap:operation
    soapAction="http://www.sogecore.com/webservices/Logon"
    style="document" />
    <input>
    <soap:body use="literal" />
    </input>
    <output>
    <soap:body use="literal" />
    </output>
    </operation>
    </binding>
    <binding name="LoginHttpGet" type="s0:LoginHttpGet">
    <http:binding verb="GET" />
    <operation name="Logon">
    <http:operation location="/Logon" />
    <input>
    <http:urlEncoded />
    </input>
    <output>
    <mime:mimeXml part="Body" />
    </output>
    </operation>
    </binding>
    <binding name="LoginHttpPost" type="s0:LoginHttpPost">
    <http:binding verb="POST" />
    <operation name="Logon">
    <http:operation location="/Logon" />
    <input>
    <mime:content type="application/x-www-form-urlencoded" />
    </input>
    <output>
    <mime:mimeXml part="Body" />
    </output>
    </operation>
    </binding>
    <service name="Login">
    <port name="LoginSoap" binding="s0:LoginSoap">
    <soap:address location="http://localhost/wsadmar/arlogin.asmx"
    />
    </port>
    <port name="LoginHttpGet" binding="s0:LoginHttpGet">
    <http:address location="http://localhost/wsadmar/arlogin.asmx"
    />
    </port>
    <port name="LoginHttpPost" binding="s0:LoginHttpPost">
    <http:address location="http://localhost/wsadmar/arlogin.asmx"
    />
    </port>
    </service>
    </definitions>

    I hope someone could be of any help to me,
    thank you in advance for any advice

    Eric
    Eric Guest

  2. Similar Questions and Discussions

    1. Javascript error while inserting document
      I do support at a school where the teachers use Contribute to update their webpages. A few teachers have newsletters in MS Publisher and they insert...
    2. Error Occured While Processing Document
      I just installed ColdFusion 6.1 today on a Windows 2000 Server running IIS 5.0. I configured it to use IIS as the external server. The installation...
    3. Error in XML Document
      Hi A web method which returns a dataset works fine when the web service it belongs to is running locally. When run on a remote server I get the...
    4. Error encountered while scanning the document
      Hi, Adobe Acrobat 6.0.1 Professional running on Win XP Professional I need to save several PDFs with compatibility for version 4.0 and higher....
    5. XML error: junk after document element
      I am trying to parse and xml document: <?xml version="1.0"?> <!DOCTYPE PrequalResponse PUBLIC "-//New Edge Networks//DTD Pilot Prequalification...
  3. #2

    Default Re: Error in xml document at (1,280)

    [email]eric57e@hotmail.com[/email] (Eric) wrote in message news:<bc870bf3.0409130245.74794281@posting.google. com>...
    > I try to call a logon webservice method with 3 parameters that are
    > strings.
    > the return value should be a xml string including all information on a
    > user object. When I execute the web service from visual studio test
    > environment the webservice method run fine and I get the expected xml
    > string. But when I try to call this method from a asp.NET page the
    > method failed and I get the following error message:
    >
    > Error in xml document at (1,280)
    >
    > I try to debug the web service (that is currently on my local machine)
    > and I see that the user object is correctly serialized and return. But
    > the caller of this method is catching a exception. and in the caller
    > the xml string is empty.
    > I already try to find help on the web like some similar post or white
    > papers but nothing seems to match.
    >
    > I already tried to change the return value into the user object but I
    > get the same problem, it was working in the test envirronment but not
    > from a asp.net Page.
    >
    > I saw that the problem could be due to derived data class. Is that
    > true? if it is , is there a work around?
    >
    > I already made a few web services (but not based on derived data
    > class) that run perfectly by returning either objects or strings but I
    > never encountered this problem.
    >
    > here is the Schema of my webservice provided from Webservice studio
    > 1.0
    >
    > <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    > xmlns:s="http://www.w3.org/2001/XMLSchema"
    > xmlns:s0="http://www.sogecore.com/webservices/"
    > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    > xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
    > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    > targetNamespace="http://www.sogecore.com/webservices/"
    > xmlns="http://schemas.xmlsoap.org/wsdl/">
    > <types>
    > <s:schema elementFormDefault="qualified"
    > targetNamespace="http://www.sogecore.com/webservices/">
    > <s:element name="Logon">
    > <s:complexType>
    > <s:sequence>
    > <s:element minOccurs="0" maxOccurs="1" name="Login"
    > type="s:string" />
    > <s:element minOccurs="0" maxOccurs="1" name="Password"
    > type="s:string" />
    > <s:element minOccurs="0" maxOccurs="1"
    > name="LogicalUserId" type="s:string" />
    > </s:sequence>
    > </s:complexType>
    > </s:element>
    > <s:element name="LogonResponse">
    > <s:complexType>
    > <s:sequence>
    > <s:element minOccurs="0" maxOccurs="1" name="LogonResult"
    > type="s:string" />
    > </s:sequence>
    > </s:complexType>
    > </s:element>
    > <s:element name="string" nillable="true" type="s:string" />
    > </s:schema>
    > </types>
    > <message name="LogonSoapIn">
    > <part name="parameters" element="s0:Logon" />
    > </message>
    > <message name="LogonSoapOut">
    > <part name="parameters" element="s0:LogonResponse" />
    > </message>
    > <message name="LogonHttpGetIn">
    > <part name="Login" type="s:string" />
    > <part name="Password" type="s:string" />
    > <part name="LogicalUserId" type="s:string" />
    > </message>
    > <message name="LogonHttpGetOut">
    > <part name="Body" element="s0:string" />
    > </message>
    > <message name="LogonHttpPostIn">
    > <part name="Login" type="s:string" />
    > <part name="Password" type="s:string" />
    > <part name="LogicalUserId" type="s:string" />
    > </message>
    > <message name="LogonHttpPostOut">
    > <part name="Body" element="s0:string" />
    > </message>
    > <portType name="LoginSoap">
    > <operation name="Logon">
    > <documentation>Check user login and grant access to user if
    > successfull.</documentation>
    > <input message="s0:LogonSoapIn" />
    > <output message="s0:LogonSoapOut" />
    > </operation>
    > </portType>
    > <portType name="LoginHttpGet">
    > <operation name="Logon">
    > <documentation>Check user login and grant access to user if
    > successfull.</documentation>
    > <input message="s0:LogonHttpGetIn" />
    > <output message="s0:LogonHttpGetOut" />
    > </operation>
    > </portType>
    > <portType name="LoginHttpPost">
    > <operation name="Logon">
    > <documentation>Check user login and grant access to user if
    > successfull.</documentation>
    > <input message="s0:LogonHttpPostIn" />
    > <output message="s0:LogonHttpPostOut" />
    > </operation>
    > </portType>
    > <binding name="LoginSoap" type="s0:LoginSoap">
    > <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
    > style="document" />
    > <operation name="Logon">
    > <soap:operation
    > soapAction="http://www.sogecore.com/webservices/Logon"
    > style="document" />
    > <input>
    > <soap:body use="literal" />
    > </input>
    > <output>
    > <soap:body use="literal" />
    > </output>
    > </operation>
    > </binding>
    > <binding name="LoginHttpGet" type="s0:LoginHttpGet">
    > <http:binding verb="GET" />
    > <operation name="Logon">
    > <http:operation location="/Logon" />
    > <input>
    > <http:urlEncoded />
    > </input>
    > <output>
    > <mime:mimeXml part="Body" />
    > </output>
    > </operation>
    > </binding>
    > <binding name="LoginHttpPost" type="s0:LoginHttpPost">
    > <http:binding verb="POST" />
    > <operation name="Logon">
    > <http:operation location="/Logon" />
    > <input>
    > <mime:content type="application/x-www-form-urlencoded" />
    > </input>
    > <output>
    > <mime:mimeXml part="Body" />
    > </output>
    > </operation>
    > </binding>
    > <service name="Login">
    > <port name="LoginSoap" binding="s0:LoginSoap">
    > <soap:address location="http://localhost/wsadmar/arlogin.asmx"
    > />
    > </port>
    > <port name="LoginHttpGet" binding="s0:LoginHttpGet">
    > <http:address location="http://localhost/wsadmar/arlogin.asmx"
    > />
    > </port>
    > <port name="LoginHttpPost" binding="s0:LoginHttpPost">
    > <http:address location="http://localhost/wsadmar/arlogin.asmx"
    > />
    > </port>
    > </service>
    > </definitions>
    >
    > I hope someone could be of any help to me,
    > thank you in advance for any advice
    >
    > Eric
    After further investigation I finally found that the string returned
    by the webmethod end with the following characters . Hexadecimal &#x0;


    &lt;/Groups&gt;
    &lt;/User&gt;&#x0;&#x0;&#x0;&#x0;&#x0;&#x0;&#x0;&#x0;&# x0;&#x0;&#x0;&#x0;&#x0;&#x0;&#x0;&#x0;&#x0;&#x0;&# x0;&#x0;&#x0;&#x0;&#x0;&#x0;&#x0;&#x0;&#x0;&#x0;&# x0;&#x0;&#x0;&#x0;&#x0;</LogonResult>
    </LogonResponse>
    </soap:Body>
    </soap:Envelope>


    I supposed this is the null terminated character.
    So now my question is the following, this is the way I get the string
    from serialization:

    XmlSerializer xmlSer=new XmlSerializer( obj.GetType() );
    MemoryStream st=new MemoryStream();
    xmlSer.Serialize(st,obj);
    byte[] buff=st.GetBuffer();
    UTF8Encoding encoding=new UTF8Encoding(false, true);
    xml = encoding.GetString(buff);
    st.Close();

    how can i avoid these characters at the end of the serialization flow.
    should I use another encoding type like ASCII or should I remove
    manually the bad characters at the end.

    May be my way of doing this is not the smartest. If some one has a
    better way , It would be nice to share it with me.
    thanks in advance.

    Eric
    Eric Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139