HIi
I read in a post where you sent a sample bvm to a guy who was struggling with setting up Aware IM as a web service.
I can't find the post again, but would really like a sample as well.
I'm trying to set up a web service so that Aware IM receives a "test result" from an external application, and then stores it in internal business objects.
I read how I am supposed to set up a service and then connect it to a process, but I'm having the same problem the other guy was having with working out how to do the process bit
Any help would be appreciated
Thanks
Web Service example
-
- Posts: 28
- Joined: Mon Apr 06, 2009 9:27 pm
- Contact:
Web Service example
Peter
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
-
- Posts: 28
- Joined: Mon Apr 06, 2009 9:27 pm
- Contact:
Thanks.
Unfortunately it would seem the example you sent me if for consuming a web service, not providing a web service.
In particular I'm looking for an example to set the attributes on the custom reply for a web service.
I have created a service called "MyService02", it has no inputs but returns a custom reply called "MyReply02".
The reply has two attributes p1 which is a string and p2 which is a number
I set default values of the attributes.
I published and logged in as instructed, the WSDL looks fine, I then called the service using a ruby script, this works ok, I'm not getting any errors in the Aware IM Server log, but I am getting a com.bas.connectionserver.server.AccessDenied error in the Tomcat log.
I checked the access levels for the admin for the service and processes, and they're full access.
I'm working on a different computer, so I'll just post this then post more details from the other computer
Unfortunately it would seem the example you sent me if for consuming a web service, not providing a web service.
In particular I'm looking for an example to set the attributes on the custom reply for a web service.
I have created a service called "MyService02", it has no inputs but returns a custom reply called "MyReply02".
The reply has two attributes p1 which is a string and p2 which is a number
I set default values of the attributes.
I published and logged in as instructed, the WSDL looks fine, I then called the service using a ruby script, this works ok, I'm not getting any errors in the Aware IM Server log, but I am getting a com.bas.connectionserver.server.AccessDenied error in the Tomcat log.
I checked the access levels for the admin for the service and processes, and they're full access.
I'm working on a different computer, so I'll just post this then post more details from the other computer
Peter
-
- Posts: 28
- Joined: Mon Apr 06, 2009 9:27 pm
- Contact:
Here is my ruby code for consuming the service
This is the output
the stack trace from the tomcat log is:
Received request for service
Exception thrown in web service MyService02
I trimmed some of the trace off.
the fact that I get nil when I try to print p1 and p2 indicates the WSDL is good and the call is getting through. When I had the business space wrong before I was getting excpetions when I tried to print and errors in the Aware IM server log, saying it was an unknown business space, so I think this is pretty close.
Any help would be appreciated
Thanks
Code: Select all
require 'soap/wsdlDriver'
wsdl = "http://localhost:8080/AwareIM/services/ActiveMonitor?WSDL"
driver = SOAP::WSDLDriverFactory.new("http://localhost:8080/AwareIM/services/ActiveMonitor?WSDL").create_rpc_driver
response = driver.MyService02 "ActiveMonitor", "admin", "password"
print response, "\n"
print response.p1, "\n"
print response.p2, "\n"
Code: Select all
#<SOAP::Mapping::Object:0x35468e0>
nil
nil
Received request for service
Exception thrown in web service MyService02
Code: Select all
com.bas.connectionserver.server.AccessDeniedException null
com.bas.connectionserver.server.AccessDeniedException
at com.bas.connectionserver.server.ConnectionFactory.createLocalSocketConnection(Unknown Source)
at com.bas.webapp.webservices.ActiveMonitor.MyService02(ActiveMonitor.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
the fact that I get nil when I try to print p1 and p2 indicates the WSDL is good and the call is getting through. When I had the business space wrong before I was getting excpetions when I tried to print and errors in the Aware IM server log, saying it was an unknown business space, so I think this is pretty close.
Any help would be appreciated
Thanks
Peter
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
-
- Posts: 28
- Joined: Mon Apr 06, 2009 9:27 pm
- Contact:
I think so.Are you sure you pass correct business space name, user name and password
If I change the business space name to something invalid I get a message in the Aware IM Server log.
If I change the service name in the consumer to something incorrect, I get an error in the consumer.
However, changing the password and user name in the consumer has no effect.
So it seems that the call is getting through correctly, just the username and password are not working. This could be something wrong with my consumer.
Is there any way to get the Tomcat layer to put out more trace so I can see what is going on?
Thanks
Peter
-
- Posts: 28
- Joined: Mon Apr 06, 2009 9:27 pm
- Contact:
Thanks. I tried out the service "ServiceNoParams" with my ruby consumer:We will send you an example of providing a service.
Code: Select all
driver = SOAP::WSDLDriverFactory.new("http://localhost:8080/AwareIM/services/AwareTrial?WSDL").create_rpc_driver
response = driver.ServiceNoParams "AwareTrial","admin", "password"
BTW, the WSDL didn't show up until after I restarted the servers.
Does this work for you?
Peter
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
-
- Posts: 28
- Joined: Mon Apr 06, 2009 9:27 pm
- Contact:
I'm not that familiar with ruby either, but I'll try to print out the soap messages. That's a good idea and should help us to see what is going on.
What I meant by "Does this work for you" was: are you able to consume your own web service that you sent me without the error in the tomcat log? It doesn't have to be with ruby.
What I meant by "Does this work for you" was: are you able to consume your own web service that you sent me without the error in the tomcat log? It doesn't have to be with ruby.
Peter
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
-
- Posts: 7525
- Joined: Sun Apr 24, 2005 12:36 am
- Contact:
The problem was actually in the password value - it has to be encrypted. The encrypted value for "password" is 5f4db43b5ad965aa1dfd27a2c8feb1e7, so you need to replace "password" with the above value.
(you can use the PWD_ENCRYPT function to get encrypted values for different passwords or look at the database table)
(you can use the PWD_ENCRYPT function to get encrypted values for different passwords or look at the database table)
Aware IM Support Team