SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard bbolte's Avatar
    Join Date
    Nov 2001
    Location
    The Central Plains
    Posts
    3,304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question NuSOAP and content type

    Can't figure out how to make NuSOAP use UTF-8 for a content type. it keeps spitting out "ISO-8859-1". here's the relevant code bits that I've tried:
    PHP Code:
    $soapclient=new soapclient($url1,'wsdl');
    $soapclient->http_encoding='utf-8';
    $soapclient->defencoding='utf-8';
        
        if(
    $soapclient->fault){
            
    $retdata=$soapclient->fault;
        }else{
            if(
    $soapclient->getError()){
                
    $retdata=$soapclient->getError();
            }else{
                            
    $params=array($xmldata);
                            
    $retdata=$soapclient->call($doit,$params,$url1,$url2);
            }
        } 
    here's the request:
    Code:
    POST xxxxxxxxxxxx HTTP/1.0
    Host: xxxxxxxxxxxxx
    User-Agent: NuSOAP/0.9.5 (1.123)
    Content-Type: text/xml; charset=ISO-8859-1
    SOAPAction: "xxxxxxxxxxxxxxxxx"
    Content-Length: 1629
    I've even gone into nusoap.php and changed a couple of lines that had the ISO hard-coded in. What am I missing?

  2. #2
    SitePoint Member drlinux's Avatar
    Join Date
    Aug 2010
    Location
    Norway
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are the actual data in your $xmldata utf8_encode()'ed, or pulled from a database using that encoding?

    Which charset does the WSDL use?

    Have you tried using the built in PHP SoapClient? It is quite solid, so I have not had to use NuSOAP for a few years now. I've not had any charset issues with it either.

  3. #3
    SitePoint Wizard bbolte's Avatar
    Join Date
    Nov 2001
    Location
    The Central Plains
    Posts
    3,304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in answer to your questions: utf-8, utf-8, no

    might have to look into the built-in one, didn't realize it was there.

  4. #4
    SitePoint Wizard bbolte's Avatar
    Join Date
    Nov 2001
    Location
    The Central Plains
    Posts
    3,304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    after working on this further, I'm still getting the same issue. I've added this:

    PHP Code:
    $xmldata=utf8_encode($xmldata); 
    added this to the top of the script:

    PHP Code:
    header('Content-Type: text/html; charset=utf-8'); 
    set my php.ini:

    PHP Code:
    default_charset "utf-8" 
    and still it shows as 'charset=ISO-8859-1"! What next to do?


Tags for this Thread

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
  •