Results 1 to 4 of 4

Thread: xml parse error for character

  1. #1
    ccfc1986 is offline Member
    Join Date
    Aug 2010
    Posts
    9

    Default xml parse error for character

    Hey all,

    My ticketing page takes users input from a form, and posts it which is then grabbed and used in the ticket creation. We have come across an issue when a right single quotation mark is used ( ’ ). We get an error when trying to do the set_entry(). Is there a way we can strip this input of any things the XML cannot parse correctly? I know we could use ereg_replace() to do this, is that the best way?

    Let me know if you have any questions about my questions, as im sure its rather confusing!

    Tony

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: xml parse error for character

    I don't think that's the source of your problem.

    I know I've done that a number of times and the xml encoder seems to always handle it correctly. I just ran a test to confirm and all was fine, regardless of me typing in the value or copy/paste from your post.
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    ccfc1986 is offline Member
    Join Date
    Aug 2010
    Posts
    9

    Default Re: xml parse error for character

    Here is the exact error i am getting when trying to submit a ticket with the character mentioned in my first post. I could give it any data i wanted, but as soon as i entered a right single quote, it gave me the following:

    Error Client: error in msg parsing: XML error parsing SOAP payload on line 6: Invalid character HERE IS ERRORS:
    Client: error in msg parsing: XML error parsing SOAP payload on line 6: Invalid character

    HERE IS RESPONSE:
    HTTP/1.0 500 Internal Server Error Date: Wed, 29 Sep 2010 16:52:57 GMT Server: Apache/2.2.11 (Unix) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8k SVN/1.5.5 PHP/5.2.9 mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0 X-Powered-By: PHP/5.2.9 Status: 500 Internal Server Error X-SOAP-Server: NuSOAP/0.7.2 (41404) Content-Length: 701 Connection: close Content-Type: text/xml; charset=UTF-8 Clienterror in msg parsing: XML error parsing SOAP payload on line 6: Invalid character

    HERE IS RESULT:
    Array ( [faultcode] => Client [faultactor] => [faultstring] => error in msg parsing: XML error parsing SOAP payload on line 6: Invalid character [detail] => )

    This is the code i am using to get the values to use in my ticket from my form: (the issue is when the single right quote is placed in the description or title field (TITLE/DESCR)
    Code:
    $set_entry_params = array(
    				'session' => $session_id,
    				'module_name' => 'Cases', 
    				'name_value_list'=>array(
    							array('name'=>'contact_id','value'=>$contact_id),
    							array('name'=>'status', 'value'=>'New'), 
    							array('name'=>'priority', 'value'=>$PRIORITY), 
    							array('name'=>'account_id','value'=>$ACCOUNTID), 
    							array('name'=>'name','value'=>$TITLE), 
    							array('name'=>'description','value'=>$DESCR), 
    							array('name'=>'case_request_type_dom_c', 'value'=>$TYPE),
    							array('name'=>'priority', 'value'=>$PRIORITY),
    							array('name'=>'case_platform_dom_c', 'value'=>$PLATFORM),
    							array('name'=>'case_module_dom_c_c', 'value'=>$MODULE),
    							array('name'=>'case_submodule_dom_c', 'value'=>$COMP),
    							array('name'=>'account_contact_c', 'value'=>$CONTACT),
    							array('name'=>'case_version_c', 'value'=>$VERSION),
    							array('name'=>'type', 'value'=>'support_desk')
    									));
    		$caseResult = $client->call('set_entry',$set_entry_params);
    		$err = $client->getError();
    				if ($err) {
    				// Display the error
    				echo '<h2>Error</h2><pre>' . $err . '</pre>';
    				echo '<b>HERE IS ERRORS:</b><BR>';
    				echo $client->error_str;
    				echo '<BR><BR><b>HERE IS RESPONSE:</b><BR>';
    				echo $client->response;
    				echo '<BR><BR><b>HERE IS RESULT:</b><BR>';
    				print_r($caseResult);
    				}
    Thank you for any responses/help with this issue!

    Tony

  4. #4
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: xml parse error for character

    I ran into a similar problem some time back but it was actually unrelated to the data.

    In my case it was related to the number of custom fields defined for the module in question, but I was getting the error when I was calling get_available_fields(), not set_entry().

    I wonder if your error is somehow related to the number of fields too (assuming you have any).
    Regards,

    Angel Magaņa
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 2009-04-09, 08:46 PM
  2. Replies: 4
    Last Post: 2006-11-02, 04:20 PM
  3. Replies: 1
    Last Post: 2006-09-28, 09:24 AM
  4. Replies: 1
    Last Post: 2006-09-07, 12:38 PM
  5. Replies: 3
    Last Post: 2006-02-12, 01:03 PM

Bookmarks

Posting Permissions

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