Hi,
i’ve got a problem with invoking Domino-Web Services via Java Soapfactory. I don’t know what arguments i have to use when i call the “createName” function from a Soapfactory Object.
Maybe i’m completely wrong.
You have to know that it’s just for testing, i only want to pass an argument to the webservice and i want to get back the same argument, but i always get back null.
Here is my Code:
Domino Web Service Code:
Class TEST
Sub NEW
Set S = New NotesSession
End Sub
Function GetPerson(t As String) As String
GetPerson = "~~~"+t+"~~~"
End Function
End Class
Java Code:
URL endpoint = new URL("http://lntest:80/mailws.nsf/ws1?OpenWebService");
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
SOAPConnection connection = soapConnectionFactory.createConnection();
SOAPFactory soapFactory = SOAPFactory.newInstance();
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
SOAPHeader header = message.getSOAPHeader();
SOAPBody body = message.getSOAPBody();
// http://lntest/mailws.nsf/ws1?wsdl
// Name bodyName =
// soapFactory.createName("GetPerson","","urn:DefaultNameSpace");//,"uri:Domino");
Name bodyName = soapFactory.createName("GetPerson", "", "http://schemas.xmlsoap.org/soap/envelope/");// ,"uri:Domino");
SOAPBodyElement be = body.addBodyElement(bodyName);
Name paramName = soapFactory.createName("T");
SOAPElement param = be.addChildElement(paramName);
param.addTextNode("Bla");
SOAPMessage response = connection.call(message, endpoint);
SOAPBody soapBody = response.getSOAPBody();
Iterator iterator = soapBody.getChildElements();
while (iterator.hasNext()) {
System.out.println(iterator.next());
}
connection.close();
Regards
Marcus