Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. C# and NUSOAP, blank results

C# and NUSOAP, blank results

Scheduled Pinned Locked Moved C#
wcfcsharpphpsysadmindata-structures
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Patricio Tapia
    wrote on last edited by
    #1

    Hi i'm working in a C# client proyect, that client call SOAP methos from a PHP NUSOAP this is the method using in PHP (nusoap)

    require\_once('lib/nusoap.php');
    $server = new soap\_server();
    $ns='http://localhost/';
    $server->configurewsdl('ApplicationServices',$ns);
    $server->wsdl->schematargetnamespace=$ns;
    $server->register('prueba',array('texto' => 'xsd:string'),array('return' => 'xsd:string'),$ns);
    $POST\_DATA = isset($GLOBALS\['HTTP\_RAW\_POST\_DATA'\])
                ? $GLOBALS\['HTTP\_RAW\_POST\_DATA'\] : '';
    

    // pass our posted data (or nothing) to the soap service
    $server->service($POST_DATA);

    function prueba($texto) {
    	$var1 = "Tu texto es: " . $texto;
    	return $var1;
    }
      exit();
    

    ?>

    well, the soap code works fine. Now, the C# client

    namespace soap1
    {
    [System.Web.Services.WebServiceBinding(Namespace = "http://localhost/", Name = "ApplicationServices")]
    public class localhost1 : System.Web.Services.Protocols.SoapHttpClientProtocol
    {

        \[System.Diagnostics.DebuggerStepThrough()\]
        public localhost1()
        {
            this.Url = "http://localhost/logeo.php";
        }
    
        \[System.Web.Services.Protocols.SoapDocumentMethod("http://localhost/logeo.php",
            RequestNamespace = "http://localhost/",
            ResponseNamespace = "http://localhost/",
            Use = System.Web.Services.Description.SoapBindingUse.Literal,
            ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)\]
    
        public string prueba(string texto)
        {
            object\[\] resultado = this.Invoke("prueba", new object \[\] { texto });
            return(Convert.ToString(resultado\[0\]));
        }
        //\[System.Diagnostics.DebuggerStepThrough\]
    

    }

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void button1\_Click(object sender, EventArgs e)
        {
            localhost1 app1 = new localhost1();
            string s = app1.prueba("pato");
            MessageBox.Show(s);
        }
    

    }
    }

    now, the c# code here, works fine and they detect my php method ¿the problem? well, in that line

    string s = app1.prueba("pato");

    the "s" variable has in blank, no result, no value return i test the SOAP server code in a SOAP client code and works fine, return a string value, but in this c#, no string value returns. why?? :confused: NOTE: Sorr

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups