PDA

View Full Version : SOAP and Domino



jgrrl
05-01-2006, 09:59 AM
I'm attempting to communicate from Pentaho to Domino via a SOAPclient. I'm using your web services xAction example as a test. The Domino SOAPConnect requires the following information in order to do the SOAP call which I can't seem to figure from the URL in your example.

This sets up the SOAPclient:
SOAPclient("A String in URL format that specifies the location of the service.")

This makes the call:
SOAPclient.invoke("The name of the RPC service",
"The name of the method you are calling",
"An array representing the arguments to the invoked method. If any of these objects is a SOAPParameter, the name property of the SOAPParameter will be used as the name of the parameter. Otherwise, each argument will be named "argn", where n is a sequence number that is assigned for you")

Any help defining these parameters would be of great help to me.

Thank You,
Jennifer

jdixon
05-01-2006, 10:48 AM
Try something like this. I don't have Domino installed so I have put this together based on information I could find on the web.



%INCLUDE "SoapConnect"
Dim session As New NotesSession
Dim doc As NotesDocument
Dim myArgs() As Variant
Dim result As String
Set doc = session.DocumentContext
Dim pentahoClient As New SOAPClient(
"http://localhost:8080/pentaho/ServiceAction?" )
myArgs( 0 ) = New SOAPParameter( "solution", "samples" )
myArgs( 1 ) = New SOAPParameter( "path", "services" )
myArgs( 2 ) = New SOAPParameter( "action", "report2.xaction" )
myArgs( 3 ) = New SOAPParameter( "region", "Central" )
myArgs( 4 ) = New SOAPParameter( "department", "Sales" )
result = pentahoClient.invoke("http://www.pentaho.org", "ExecuteActivity", myArgs)


Let me know how you get on.

James

jgrrl
05-01-2006, 01:06 PM
Thanks for your example James, it was quite helpful. I changed the code a bit to fit the "Web Service Example" in our version of Pentaho to the code below


%INCLUDE "Soapconnect"
Sub Initialize
On Error Goto printerr
Dim session As New NotesSession
Dim doc As NotesDocument
Dim myArgs(2) As Variant
Dim result As String

Set doc = session.DocumentContext
Dim pentahoClient As New SOAPClient(" http://home1:8080/pentaho/ServiceAction?" )
Set myArgs( 0 ) = New SOAPParameter( "solution" , "samples" )
Set myArgs( 1 ) = New SOAPParameter( "path" , "rules" )
Set myArgs( 2 ) = New SOAPParameter( "action" , "CurrentPositionTitles.xaction" )
result = pentahoClient.invoke( "http://www.pentaho.org" , "ExecuteActivity" , myArgs)
Print result
Exit Sub

printerr:
If errSOAPfault Then
Print "SOAP ERROR " +pentahoClient.fault.faultcode
Else
Print "Error is "+ Error+" on line "+Cstr(Erl)
End If

End Sub

The more extensive error in my logfile says


05/01/2006 01:49:58 PM HTTP JVM: [SOAPException: faultCode=SOAP-ENV:Client; msg=A 'http://schemas.xmlsoap.org/soap/envelope/:Fault' element must contain a: 'faultcode' element.; targetException=java.lang.IllegalArgumentException: A 'http://schemas.xmlsoap.org/soap/envelope/:Fault' element must contain a: 'faultcode' element.]
05/01/2006 01:49:58 PM HTTP JVM: at org.apache.soap.rpc.Call.invoke(Call.java:294)
05/01/2006 01:49:58 PM HTTP JVM: at SOAPCall.NotesMain(SOAPCall.java:99)
05/01/2006 01:49:58 PM HTTP JVM: at lotus.domino.AgentBase.runNotes(Unknown Source)
05/01/2006 01:49:58 PM HTTP JVM: at lotus.domino.NotesThread.run(NotesThread.java:218)
05/01/2006 01:49:58 PM Agent '(SOAPtest) | SOAPtest' error: No RESUME

Now I don't expect you to waste time troubleshooting our server, but if you could look it over and see if I'm missing a parameter or something.

Thanks,
Jennifer

jdixon
05-01-2006, 08:33 PM
The good news is it looks like the message is getting to the Pentaho server. The bad news is I think we have two errors here.

Firstly your call to the Pentaho server is generating an error of some kind when it attempts to execute the action sequence.
Secondly we are not returning the error message thru SOAP in the format that Domino is expecting.

I will try to change the SOAP fault response for the next build we release.

In the mean time can you look in the server log for the Pentaho server for any error messages.

James

jgrrl
05-02-2006, 10:19 AM
Well it looks like we've made some progress since my last post. We revised the code to the code below.



%INCLUDE "Soapconnect"
Sub Initialize
On Error Goto printerr
Dim session As New NotesSession
Dim doc As NotesDocument
Dim myArgs(0) As Variant
Dim result As String

Set doc = session.DocumentContext
Dim pentahoClient As New SOAPClient(" http://home1:8080/pentaho/ServiceAction?solution=samples&path=rules&action=CurrentPositionTitles.xaction"«»)
result = pentahoClient.invoke( "http://pentaho.org" , "ExecuteActivityResponse" , myArgs)
Print result
Exit Sub

printerr:
If errSOAPfault Then
Print "SOAP ERROR " +pentahoClient.fault.faultcode + "" + result
Resume Next
Else
Print "Error is "+ Error+" on line "+Cstr(Erl)
End If

End Sub


Now we are getting no errors on the Pentaho server and the error below in Domino:

SOAP ERROR
No Deserializer found to deserialize a ':rule-result' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.

Any ideas? Thanks again for your feedback,
Jennifer

begunrom
05-29-2006, 05:02 AM
Does the release of Pentaho-1.1.6 include the fixes for the above mentioned problem?