web-services

Best practice for java web services and remote exception

僤鯓⒐⒋嵵緔 提交于 2020-01-06 06:48:13
问题 I am writing a web service. So I have: public interface MyService extends Remote { public void service1(); } public class MyServiceImpl implements MyService { public void service1() { /* do something that sometimes throws an exception */ } } I was reading about RemoteException . Should I wrap all the code in service1() in a try..catch that wraps any exception in a RemoteException ? Then I will have to do it for service2() , service3() and so on. Is it better to let the invoker (a servlet in

Best practice for java web services and remote exception

点点圈 提交于 2020-01-06 06:47:08
问题 I am writing a web service. So I have: public interface MyService extends Remote { public void service1(); } public class MyServiceImpl implements MyService { public void service1() { /* do something that sometimes throws an exception */ } } I was reading about RemoteException . Should I wrap all the code in service1() in a try..catch that wraps any exception in a RemoteException ? Then I will have to do it for service2() , service3() and so on. Is it better to let the invoker (a servlet in

Is there a programming interface / web service for getting Amber Alert information? [closed]

亡梦爱人 提交于 2020-01-06 06:12:25
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I'd like to programmatically gather information about Amber Alerts and display it in an application. However, I can't seem to find an API. Does one exist? I care about NJ but the entire country would be useful too. 回答1: You can use the following site to retrieve an RSS feed that you could probably disseminate for

Is there a programming interface / web service for getting Amber Alert information? [closed]

て烟熏妆下的殇ゞ 提交于 2020-01-06 06:11:11
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I'd like to programmatically gather information about Amber Alerts and display it in an application. However, I can't seem to find an API. Does one exist? I care about NJ but the entire country would be useful too. 回答1: You can use the following site to retrieve an RSS feed that you could probably disseminate for

Converting WAR to EAR and other Glassfish stories

筅森魡賤 提交于 2020-01-06 06:06:10
问题 I am really new in this so I hopefully don't make any terrible mistake. I apologize before hand if I have. In my project I was using tomcat and deploying WAR files. But now some bosses wants to deploy EAR files. So there we go. I first downloaded Glassfish (don't know if it's the apropiate application server for a newbie like me), instaled it and all (I even deployed the hello.war in the autodeploy >_< ). Then prepared an EAR file. From what I know, I just need to create an Enterprise

Converting WAR to EAR and other Glassfish stories

眉间皱痕 提交于 2020-01-06 06:05:23
问题 I am really new in this so I hopefully don't make any terrible mistake. I apologize before hand if I have. In my project I was using tomcat and deploying WAR files. But now some bosses wants to deploy EAR files. So there we go. I first downloaded Glassfish (don't know if it's the apropiate application server for a newbie like me), instaled it and all (I even deployed the hello.war in the autodeploy >_< ). Then prepared an EAR file. From what I know, I just need to create an Enterprise

Throwing a XML Web Service Exception for invalid username / password

三世轮回 提交于 2020-01-06 05:59:46
问题 I've created a web service and am using a Soap header for authentication, as described here: http://aspalliance.com/805 I've adapted it, so that in every method, it calls a seperate "authenticate" method, which searches username and password in the db, and returns true or false. My question is, within this method, if it returns false (ie, the user isn't validated) how should i throw an exception, that filters back to the consumer application? 回答1: First of all, you'd do better to add a Login

CAML query to add a ListItem in Sharepoint

折月煮酒 提交于 2020-01-06 05:41:15
问题 my CAML query to add a ListItem (Wiki Page) doesn't work. I've tried several fields, but Sharepoint always creates empty pages. Here is my CAML so far: <Batch OnError="Continue"> <Method ID="1" Cmd="New"> <Field Name="WikiField">My Wiki Content</Field> </Method> </Batch> 回答1: Try this <Batch OnError="Continue"> <Method ID="1" Cmd="New"> <Field Name="urn:schemas-microsoft-com:office:office#WikiField">My Wiki Content</Field> </Method> </Batch> 来源: https://stackoverflow.com/questions/965581/caml

URI for RESTful Web Services

巧了我就是萌 提交于 2020-01-06 05:38:17
问题 I'm trying to understand how URIs are supposed to look like. Looking at this reference: http://en.wikipedia.org/wiki/Representational_State_Transfer#RESTful_web_services, I am a bit confused by how POST is supposed to work. The example given is this: http://example.com/resources/142. I'm associating "142" as a specific item in "resources" (thus, one could delete, update, or get the representation). The "142" is confusing to me in the context of creating a new member of a collection. What does

Connecting to Web Service in VM from client in host

为君一笑 提交于 2020-01-06 05:35:13
问题 I'm running Ubuntu 10.10 in VirtualBox with Windows 7 as host. I have a java Web Service which I deploy onto a Glassfish3 server in Ubuntu and I want to be able to reach it from the host, according to the VBox documentation I should port forward port 8080 which is the port that my client application connects to on my host. To do this I do the following command in Windows VBoxManage modifyvm Ubuntu --natpf1 glassfish,tcp,,8080,,8080 which should forward my hosts 8080 port to my VM's 8080 port,