Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Page: previous  1  2 
Avatar
Alex #16
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post ID 2679
Quote by lingx825:
Sorry,there are many chinese words show as ?????????
Does it matter for the program?But the test code work fine
this is no problem

Quote by lingx825:
BTW: I use the code button to surround my code,why they don't show the line number?

you have to add a language. c# is not supported by the forum software but cpp works very well for c# code.

Quote by forums help:
You can enable syntax highlighting with [code] tags by specifying a language name as parameter. Currently the following languages are supported:

C, CPP (C++), CSS, HTML, Java, JavaScript, Perl, PHP, Python, SQL and XML.

so i use:
[code=cpp] ..... [/code]

Alex
Avatar
Alex #17
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
It doesn't matter if you load xml from a file or receive it over socket. The code which parses the xml is the same.
If it works from a file but not over a xmpp connection then there must be something different in your code, or a ver weird bug in agsXMPP. But i don't think that there is a bug in agsXMPP related, because we use this logic everywhere inside of agsXMPP and in many projects for customers.

The only way to get this fixed is when you attach a small test case to the post. Please don't attach your complete source code, KISS.

Alex
Avatar
lingx825 #18
Member since Nov 2007 · 23 posts
Group memberships: Members
Show profile · Link to this post
Hello,Alex
I try a new code
  1. void  XmppCon_OnIq(object sender, agsXMPP.protocol.client.IQ iq)
  2.         {
  3.             Console.WriteLine("##################  ON  IQ  #################");
  4.             Console.WriteLine(iq.ToString(Formatting.Indented));
  5.             Console.WriteLine("##################  ON  IQ  #################");                   
  6.                 if (iq.Query != null)
  7.                 {
  8.                     if (iq.Query.GetType() == typeof(IESQuery))
  9.                     {
  10.                         Console.WriteLine("---------------On IESQuery-------------------------");
  11.                         Console.WriteLine(iq.ToString(Formatting.Indented));
  12.                         Console.WriteLine("---------------On IESQuery-------------------------");
  13.  
  14.                         //----------Test  Code------------
  15.                         Document doc = new Document();
  16.                         doc.LoadXml(iq.ToString(Formatting.Indented));
  17.                         IQ dociq = doc.RootElement as IQ;
  18.                         IESQuery query = dociq.SelectSingleElement(typeof(IESQuery)) as IESQuery;
  19.                         IESCommandBean commandbean = query.SelectSingleElement(typeof(IESCommandBean),true) as IESCommandBean;
  20.                         Question question = query.SelectSingleElement(typeof(Question),true) as Question;
  21.                         IESCommandBaseBean basebean = commandbean.BaseBean;
  22.                                                       .
  23.                                                       .
  24.                                                       .
That's work,query,commandbean and question all get their value,althrough it's a little weird...
Avatar
lingx825 #19
Member since Nov 2007 · 23 posts
Group memberships: Members
Show profile · Link to this post
Hi,I found another strange thing in my last reply
My iq's innerXML is
<query xmlns="botwave:token"><IESCommandJavaBean>
    <commandBaseBean>
        <commandName>ies.getquestionlist</commandName>
    </commandBaseBean>
    <page>
        <pageNum>1</pageNum>
        <pageSize>10</pageSize>
        <recordCount>58</recordCount>
    </page>
     .
     .
     .
but when I run to the code
doc.LoadXml(iq.ToString(Formatting.Indented));
IQ dociq = doc.RootElement as IQ;
the dociq's innerXML became
<query xmlns="botwave:token">
      <IESCommandJavaBean>
    <commandBaseBean>
        <commandName>ies.getquestionlist</commandName>
    </commandBaseBean>
    <page><pageNum>1</pageNum>
        <pageNum>1</pageNum>
        <pageSize>10</pageSize>
        <recordCount>59</recordCount>
    </page>
     .
     .
     .
so is doc,when I read the xml from localfile
doc.LoadFile(@"c:\content.xml");
It has the same problem,any idea?
This post was edited on 2007-12-10, 03:49 by lingx825.
Avatar
Jabberer #20
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
Quote by lingx825:
It has the same problem,any idea?

sorry no, agsXMPP does not add your PageNum Tag twice or increase the recordCount from alone.
Software Developer
AG-Software
Avatar
lingx825 #21
Member since Nov 2007 · 23 posts
Group memberships: Members
Show profile · Link to this post
Sorry for the little problem,I have found out what cause it:I set the pagNum to 1 in the Page Constructor once
That made the <pagNum> appear twice~
Thanks for your patience!
Avatar
Alex #22
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Execute no other code than setting TagName and NameSpace in the empty default constructor because it called from the ElementFactory.

Did this also solve your other problems?

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page: previous  1  2 
Forum: agsXMPP RSS