Autor Beitrag
traceurmicha
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 160
Erhaltene Danke: 9

Win XP SP2, Win 7 Pro., Ubuntu 9, Debian 5
C#, ASP.NET, MSSQL, PHP(Microsoft Visual Studio 2010 Ultimate, SharpDevelop 4, Microsoft SQL Server2008 Express, Eclipse for PHP)
BeitragVerfasst: Do 14.11.13 20:56 
Hallo, ich bin gerade am verzweifeln.
Ich habe einen Webservice mit einer WSDL datei geschrieben. Diesen Webservice will ich über die jQuery erweiterung jquery.soap ansprechen. Aber ich kriege einfach kein Ergebnis.
Was mache ich falsch, bzw. wie mache ich es denn richtig? Ich bekomme andauernd einen 404 Fehler.

Service.php
ausblenden PHP-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
<?php
function add($a$b){
    return $a+$b;
}

$server = new SoapServer("math.wsdl");
$server->addFunction("add");
$server->handle();
?>


math.wsdl
ausblenden volle Höhe XML-Daten
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:
<?xml version='1.0' encoding='UTF-8' ?>
<definitions name='Math'
    targetNamespace = 'http://localhost/ffwneu/math.wsdl'
    xmlns:tns = 'http://localhost/ffwneu/math.wsdl'
    xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
    xmlns:xsd='http://www.w3.org/2001/XMLSchema'
    xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
    xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
    xmlns='http://schemas.xmlsoap.org/wsdl/'>
<message name='addRequest'>
  <part name='a' type='xsd:int'/>
  <part name='b' type='xsd:int'/>
</message>
<message name='addResponse'>
  <part name='Result' type='xsd:int'/>
</message>
<portType name='addPortType'>
  <operation name='add'>
    <input message='tns:addRequest'/>
    <output message='tns:addResponse'/>
  </operation>
</portType>
<binding name='addBinding' type='tns:addPortType'>
  <soap:binding style='rpc'
    transport='http://schemas.xmlsoap.org/soap/http'/>
  <operation name='add'>
    <soap:operation soapAction='urn:Math#add'/>
    <input>
      <soap:body use='encoded' namespace='urn:Math'
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
    </input>
    <output>
      <soap:body use='encoded' namespace='urn:Math'
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
    </output>
  </operation>
</binding>
<service name='addService'>
  <port name='addPort' binding='addBinding'>
    <soap:address location='http://localhost/ffwneu/Service.php'/>
  </port>
</service>
</definitions>


javascript aufruf

ausblenden JavaScript-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
function ShowDiag(){
  $.soap({
    url: 'http://localhost/ffwneu/math.wsdl/',
    method: 'add',
    data: {
        a: 1,
        b: 2
    },

    success: function (soapResponse) {
        alert("ja");
    },
    error: function (SOAPResponse) {
        alert(SOAPResponse.content);
    }
});
    
    //$("#galleryDialog").dialog("open");
}

_________________
Programmieren ist ein Rennen zwischen den Softwareentwicklern, die versuchen größere und bessere idiotensichere Programme zu schreiben und dem Universum, welches versucht größere und bessere Idioten zu produzieren. Zur Zeit liegt das Universum in Führung.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 14.11.13 22:05 
Stimmt das, dass im JavaScript in der URL nach "math.wsdl" noch ein Slash kommt?

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
traceurmicha Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 160
Erhaltene Danke: 9

Win XP SP2, Win 7 Pro., Ubuntu 9, Debian 5
C#, ASP.NET, MSSQL, PHP(Microsoft Visual Studio 2010 Ultimate, SharpDevelop 4, Microsoft SQL Server2008 Express, Eclipse for PHP)
BeitragVerfasst: Mo 18.11.13 09:56 
Momentan ja, aber es ist egal ob mit oder ohne Slash, ich bekomme immer die selbe Fehlermeldung...

_________________
Programmieren ist ein Rennen zwischen den Softwareentwicklern, die versuchen größere und bessere idiotensichere Programme zu schreiben und dem Universum, welches versucht größere und bessere Idioten zu produzieren. Zur Zeit liegt das Universum in Führung.