Announcement

Collapse
No announcement yet.

Axis2 - WSDL mit XML-RPC Client aufrufen

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Axis2 - WSDL mit XML-RPC Client aufrufen

    Hallo zusammen,

    habe folgenden Client geschrieben:

    import java.util.Vector;
    import org.apache.xmlrpc.XmlRpcClient;

    public class XMLRPCTestClient {
    public static void main (String args[]) {
    try {
    String MethodName = "printVinstance";

    XmlRpcClient xmlrpc = new XmlRpcClient
    ("http://localhost:8080/axis2/services/ReadMetaData?wsdl");

    Vector params = new Vector ();

    Vector result = (Vector) xmlrpc.execute (MethodName, params);

    for (int i=0; i < result.size(); i++) {
    System.out.println (result.elementAt(i));
    }

    } catch (Exception e) {
    System.err.println (e.toString());
    }
    }
    }

    Die Methode printVinstance bekommt keine Paramter übergeben und gibt ein String Array zurück. Wenn ich das Programm ausführe erhalte ich die Fehlermeldung

    "java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/axis2/services/ReadMetaData?wsdl"

    was anscheinend darauf hindeutet das die URL nicht gefunden wird.
    Der Aufruf von "http://localhost:8080/axis2/services/ReadMetaData" hat leider auch nichts gebracht. Mit einem Stub-Client funktionierts einwandfrei. Weiß jemand Rat?

    Gruß
    Mario

  • #2
    Ich bin gerade etwas schlauer geworden. Und zwar wenn ich TCPMon dazwischen schalte erhalte ich folgendes:

    Request:

    POST /axis2/services/ReadMetaData?wsdl HTTP/1.1
    Content-Length: 102
    Content-Type: text/xml
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Java/1.5.0_18
    Host: 127.0.0.1:5555
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-alive

    <?xml version="1.0"?>
    <methodCall>
    <methodName>printVinstance</methodName>
    <params></params>
    </methodCall>

    Response:


    HTTP/1.1 500 Internal Server Error
    Server: Apache-Coyote/1.1
    Content-Type: text/xml;charset=UTF-8
    Transfer-Encoding: chunked
    Date: Thu, 10 Sep 2009 12:15:31 GMT
    Connection: close

    1e1
    <?xml version='1.0' encoding='UTF-8'?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action>
    </soapenv:Header>
    <soapenv:Body>
    <soapenv:Fault>
    <faultcode></faultcode>
    <faultstring>First Element must contain the local name, Envelope , but found methodCall</faultstring>
    <detail />
    </soapenv:Fault>
    </soapenv:Body>
    </soapenv:Envelope>0

    Anscheinend kann Axis2 XML-RPC nicht verarbeiten!? Muß ich vielleicht eine conf-Datei modifizieren damit der Request verstanden wird?

    Comment

    Working...
    X