Rest Web Service, - web-services

i am approaching the development of Restful web services for the first time. I tried to follow this guide for Netbeans . I am stuck at the testing of the web service.
When i open the
http://localhost:8080/WebServicesTest/test-resbeans.html
page, none of the root resources appears in the left menu. (there should be entities.customer and entities.discountcode)
I really can't find a solution.
Thanks in advance to anyone who likes to give me a hint.
--------------- Edit
If i click on CustomerDB --> Deploy i get an error
In-place deployment at C:\Users\utente\Documents\NetBeansProjects\CustomerDB\build\web
GlassFish Server 4, deploy, null, false
C:\Users\utente\Documents\NetBeansProjects\CustomerDB\nbproject\build-impl.xml:1071:
The module has not been deployed.
See the server log for details.
The line 1071 of build-impl.xml is
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>

I checked out the referenced tutorial.
Which exact path did you follow? Did you change anything?
Most likely your CustomerDB application is not deployed correctly (see GlassFish Server output in NetBeans) and thus is not able to expose the web service and thus is not displayed in the test page (nothing visible in the side bar).
I tried the tutorial myself and had that phenomenon when using another database ("test" instead of the sample db, which was not connectable in my installed environment), resulting in a message that "test__pm" resource was not found. I then created a conection pool and a jdbc reosurce for test and then it worked.

Related

404 On existing .svc file

I have an IIS site on a Windows 2012 R2 server. The site has an Application inside it:
The URL for this site is setup on our Active Directive servers as it is only accessible internally from our company. The URL follows the following structure:
http://NAMEoftheSERVICE.myCompanyServices.myCompany.local
The service for this site is placed in an internal folder:
http://NAMEoftheSERVICE.myCompanyServices.myCompany.local/InternalFolder/Service.svc
I have placed a number of test files both at the root level and in the internal folder:
http://NAMEoftheSERVICE.myCompanyServices.myCompany.local/HelloWorld.html
http://NAMEoftheSERVICE.myCompanyServices.myCompany.local/InternalFolder/HelloWorld.html
I can browse these files without any problems. However, I cannot browse the service at http://NAMEoftheSERVICE.myCompanyServices.myCompany.local/InternalFolder/Service.svc
The browser returns
However the file is there, and I have made sure there are no typos in the URL I put in the browser.
I have looked at similar questions but there seems not to be anything like the problem I am experiencing. The only question that looked promising was:
WCF service file not visible
But the answer for that post does not apply to my issue as I already have the configuration mentioned in that post setup as it is suggested.
I have checked the IIS-level config files for any exclusion regarding .svc files or anything similar, but could not find anyhting.
Have you got any suggestions on where to look at to solve this issue?
Solution: Install HTTP Activation feature
After running some more testing on other sites on the same server, I actually realised that the issue was specific to .svc files. I therefore made another search on Google and found that the server was missing the "HTTP Activation" feature (part of the WCF Services).
So, if you are having the same issue on .svc files follow the following steps to make sure you have the right components installed on the server:
Open Server Manager
In Server Manager, click the Manage menu, and then click Add Roles
and Features
In the Add Roles and Features wizard, click Next. Select the
installation type and click Next. Select the destination server and
click Next.
Skip the Server Roles page.
On the Select features page, expand ".Net Framework 4.5 Features",
expand "WCF Services" and select "HTTP Activation". Click Next.
On the Confirm installation selections page, click Install.
On the Results page, click Close.
The same can be achieved by running the following Powershell command:
Install-WindowsFeature -Name NET-WCF-HTTP-Activation45
This did the trick for me. I hope it can be of help to someone.

Amazon AWS Service Error

I am currently trying to set up a Virtual Machine and a Database Server for my website to launch off of. I decided to go with Amazon's AWS.
I have beeing working through This Tutorial and am at Part 3 now.
I got to the point where I started the Apache Web Server and went to my local DNS name in my browser, and successfully saw the Test Page.
I proceeded forward with Downloading "Drupal" and got to the section where it says "Configure Drupal". I am now trying to load my local DNS name in my browser again, only to get a 500 Server Error.
I'm not sure what could've went wrong, I only entered the commands in the tutorial for the whole section on "Install Drupal".
Thank you
EDIT: Also, what exactly does Drupal do? And do I need to use it?
Drupal is a CMS system, and you don't have to use it. It is only being used to provide an example for a website. Instead of installing Drupal, you can install your own site on the server if you prefer or even something like Wordpress if you're more familiar with that.
However, if you do want to follow the example your best bet for discovering the problem is to look into what the exact error is. You should be able to find more information about that in the log files located in /var/log/httpd. The error log in there should show you more details about what failed.

Cant Find my Axis2 Web Service deployed on OpenShift

I deployed a web service developed using Apache Axis2 on Openshift.
When I try accessing the axis2 index.jsp, I can see the index page which only contains the default Version.
Q:
How do I get to display the web service other web services I created as I can view them on my localhost through the browser in Eclipse?
I have done a few searches online and seen some suggestions as to making adjustments to axis2.xml. In that regard, I have tried changing the contextRoot parameter and the servicePath without no success though I am not too sure if I am making the right changes.
My project structure in Eclipse is shown below:
SieveService
+...
+Java Resources
++src
+++Model
++++some model classes
+++Services
++++SieveServiceService.java
++Libraries
+...
+WebContent
++axis2-web
+++...
I had the same problem and that's occurs because openshift's tomcat server only deploys services in aar format, meanwhile in localhost deploys aar and exploded files too.
You need to create a aar file with your services and put it into your WebContent/WEB-INF/services/ directory. You need to update the services.list file too with the name of your services.
After that you must see your services in your openshift server.

Debug web service running on local machine?

I'm using PowerBuilder Classic 12.1 to deploy a .NET Web Services target to IIS 7 running on my local machine. I'd like to be able to debug it. The documentation from Sybase says I should be able to. But when I run the debugger it says "Attaching to ASP.NET worker" and "Time left: 20 seconds". It counts down to 0 and then I see "Failed attaching to ASP.NET worker process."
I'm running PowerBuilder as an administrator, so I don't think that's the problem.
Suggestions?
Open your your project object that you are using to deploy with. If you have multiple project objects, then right click on your target in the tree-view painter and click preferences to open a dialog that let's you choose which target object will be used for deployment. Choose the one that is set with DEBUG symbol on and set to debug build.
I have had good luck debugging PB Web Services both IIS hosted and self-hosted.
I also found this in the PowerBuilder help file for you:
Using the DEBUG symbol
If you used the DEBUG conditional compilation symbol in code for the nonvisual objects you deploy as a Web service and you want this code to run, you must make sure that the enable DEBUG symbol check box is selected before you deploy the project. If you plan to debug the assembly or Web service, you should make sure the project is deployed as a debug build.
** added additional details here on 1-26-13
This blog article will help you get WCF debugging to work in PowerBuilder.NET.
Testing & Debugging PowerBuilder.NET WCF Web Services

Deploying a Web service (WAR) application in Weblogic 11g with WS- Security enabled - Error

I am trying to deploy our proprietary web service application (WAR) into Weblogic 11g server. I have created the WAR using Eclipse Indigo and Java 1.6.
I got the below error,
Messages An error occurred during activation of changes, please see
the log for details. Error encountered during prepare phase of
deploying WebService module 'TWSWebSec.war'. When processing
WebService module 'TWSWebSec.war'. Can't find wsdl
/wsdls/wsc10/wscoor.wsdl When processing WebService module
'TWSWebSec.war'. Can't find wsdl /wsdls/wsc10/wscoor.wsdl
The deployment has been successfully installed.
I tried with a hack of creating wscoor.wsdl into the specified folder and created a new WAR, this time the error was that it is a premature closure of file, which meant the file is identified and there is nothing in the file to read.
After this, i tried to input manually the service, interfaces, operation as per the created Service endpoint interfaces/ Web services, this time i got the error
An error occurred during activation of changes, please see the log
for details. Error encountered during prepare phase of deploying
WebService module 'TWSWebSec.war'. When processing WebService module
'TWSWebSec.war'. Can't find wsdl
/wsdls/wsc11/wstx-wscoor-1.1-wsdl-200702.wsdl When processing
WebService module 'TWSWebSec.war'. Can't find wsdl
/wsdls/wsc11/wstx-wscoor-1.1-wsdl-200702.wsdl The deployment has
been successfully installed.
Am I missing anything here? Is it a configuration problem? Do I need to update any JARs I use?
Please help. Also let me know if more information required?
I post this because there is a chance that you may be in a case that is similar to what I experienced. I had the same error (i.e. "can't find wsdl") yesterday afternoon when trying to make WebLogic deploy a client created with Eclipse's web service generator using CXF. It just never worked. Today I replaced that client with one made one using WebLogic's generator, also in Eclipse, where it is found under Oracle, WebLogic, Web and Service Client. That worked for me. It seems that WebLogic uses Metro and not CXF. There is certainly nothing wrong with CXF but it does not seem to make a good pair with WebLogic.
Best regards Johannes