Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERJaxWS examples #558

Merged
merged 15 commits into from
Apr 20, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion Build/build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,36 @@
</antcall>
</target>

<target name="WebService_Created.all">
<antcall target="global.application.${build.action}" >
<param name="project.type" value="application" />
<param name="project.principal.class" value="er.examples.erjaxws.Application" />
<param name="project.name" value="WebService_Created" />
<param name="project.dir" value="Examples/ERJaxWS/WebService_Created" />
<param name="wo.external.root.bundles" value="${frameworks.wonder.core}/ERJaxWS" />
</antcall>
</target>

<target name="WebService_Imported.all">
<antcall target="global.application.${build.action}" >
<param name="project.type" value="application" />
<param name="project.principal.class" value="er.examples.erjaxws.Application" />
<param name="project.name" value="WebService_Imported" />
<param name="project.dir" value="Examples/ERJaxWS/WebService_Imported" />
<param name="wo.external.root.bundles" value="${frameworks.wonder.core}/ERJaxWS" />
</antcall>
</target>

<target name="WebService_Stateful.all">
<antcall target="global.application.${build.action}" >
<param name="project.type" value="application" />
<param name="project.principal.class" value="er.examples.erjaxws.Application" />
<param name="project.name" value="WebService_Stateful" />
<param name="project.dir" value="Examples/ERJaxWS/WebService_Stateful" />
<param name="wo.external.root.bundles" value="${frameworks.wonder.core}/ERJaxWS" />
</antcall>
</target>

<target name="ERXPartialBaseModel.all">
<antcall target="global.framework.${build.action}" >
<param name="project.name" value="ERXPartialBaseModel" />
Expand Down Expand Up @@ -1402,7 +1432,7 @@

<target name="common.applications.all" depends="BugTracker.all, ERMailer.all, Uber.all, SecretPal.all, ERXTest.all, PluginTest.all, WOTested.all" />

<target name="common.examples.all" depends="ERSeleniumExample.all, ERIndexingExample.all, ERMovies.all, D2WComponentTour.all, AjaxExample.all, AjaxExample2.all, TickTockMan.all, ERComponentTour.all, ERRestRouteExample.all, Movies.all, ERWebSocketExample.all, ERJasperReportsExample.all, BackgroundTasks.all, ERCayenneExample.all, ERDistributionExampleModel.all, ERDistributionExampleServer.all, ERDistributionExampleClient.all, MooToolsExample.all, ERPDFExamples.all, JqueryMobileExample.all, TextSearchDemo.all, ERXPartialsExampleApp.all" />
<target name="common.examples.all" depends="ERSeleniumExample.all, ERIndexingExample.all, ERMovies.all, D2WComponentTour.all, AjaxExample.all, AjaxExample2.all, TickTockMan.all, ERComponentTour.all, ERRestRouteExample.all, Movies.all, ERWebSocketExample.all, ERJasperReportsExample.all, BackgroundTasks.all, ERCayenneExample.all, ERDistributionExampleModel.all, ERDistributionExampleServer.all, ERDistributionExampleClient.all, MooToolsExample.all, ERPDFExamples.all, JqueryMobileExample.all, TextSearchDemo.all, ERXPartialsExampleApp.all, WebService_Created.all, WebService_Imported.all, WebService_Stateful.all" />

<target name="dynareporting.frameworks.all" depends="DRGrouping.all, WRReporting.all" />
<target name="dynareporting.examples.all" depends="DocsByExample.all, DynaReporter.all" />
Expand Down
6 changes: 5 additions & 1 deletion Examples/ErJaxWS/README.txt → Examples/ERJaxWS/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ The wsdl had been imported using

wsimport -s Sources -keep <url to wsdl>

Please note, that the classes had been generated using Java 7.
If you want to compile this under Java 6, you have to regenerate
these using wsimport from Java 6.

3. WebService_Stateful

Expand All @@ -27,4 +30,5 @@ shows you how to

- provide and use a stateful WebService

- use WebFaults, generated by throwing Exceptions
- use WebFaults, generated by throwing Exceptions

Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ bin
build
*.xcodeproj
*.pbxproj
ant.*
ant.*
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package your.app;
package er.examples.erjaxws;

import javax.xml.ws.Endpoint;

import your.app.ws.Calculator;
import er.examples.erjaxws.ws.Calculator;
import er.extensions.appserver.ERXApplication;
import er.extensions.appserver.ws.ERJaxWebService;
import er.extensions.appserver.ws.ERJaxWebServiceRequestHandler;
Expand All @@ -24,6 +24,11 @@ public Application() {

// create a standalone endpoint using Jax WS mechanisms
Endpoint.publish("http://localhost:9999/ws/Calculator", new Calculator());

}

// modify URL to auto open in Browser to show the wsdl
@Override
public String directConnectURL() {
return super.directConnectURL() + "/ws/Calculator?wsdl";
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package your.app;
package er.examples.erjaxws;

import com.webobjects.appserver.WOActionResults;
import com.webobjects.appserver.WOApplication;
import com.webobjects.appserver.WORequest;

import er.examples.erjaxws.components.Main;
import er.extensions.appserver.ERXDirectAction;

import your.app.components.Main;

public class DirectAction extends ERXDirectAction {
public DirectAction(WORequest request) {
super(request);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package your.app;
package er.examples.erjaxws;

import er.extensions.appserver.ERXSession;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package your.app.components;
package er.examples.erjaxws.components;

import com.webobjects.appserver.WOContext;

import er.examples.erjaxws.Application;
import er.examples.erjaxws.Session;
import er.extensions.components.ERXComponent;
import your.app.Application;
import your.app.Session;

@SuppressWarnings("serial")
public class BaseComponent extends ERXComponent {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package your.app.components;
package er.examples.erjaxws.components;

import com.webobjects.appserver.WOContext;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package your.app.ws;
package er.examples.erjaxws.ws;

import javax.jws.WebService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ classes.dir=bin
project.name=WebService_Created
project.name.lowercase=webservice_created
project.type=application
principalClass=your.app.Application
principalClass=er.examples.erjaxws.Application
customInfoPListContent=
embed.Local=true
embed.System=true
Expand Down
6 changes: 6 additions & 0 deletions Examples/ERJaxWS/WebService_Imported/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
target
bin
build
*.xcodeproj
*.pbxproj
ant.*
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package your.app;
package er.examples.erjaxws;

import your.app.ws.impl.CalculatorImpl;
import er.examples.erjaxws.ws.impl.CalculatorImpl;
import er.extensions.appserver.ERXApplication;
import er.extensions.appserver.ws.ERJaxWebService;
import er.extensions.appserver.ws.ERJaxWebServiceRequestHandler;
Expand All @@ -20,4 +20,10 @@ public Application() {
this.registerRequestHandler(wsHandler, this.webServiceRequestHandlerKey());

}

// modify URL to auto open in Browser to show the wsdl
@Override
public String directConnectURL() {
return super.directConnectURL() + "/ws/Calculator?wsdl";
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package your.app;
package er.examples.erjaxws;

import com.webobjects.appserver.WOActionResults;
import com.webobjects.appserver.WOApplication;
import com.webobjects.appserver.WORequest;

import er.examples.erjaxws.components.Main;
import er.extensions.appserver.ERXDirectAction;

import your.app.components.Main;

public class DirectAction extends ERXDirectAction {
public DirectAction(WORequest request) {
super(request);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package your.app;
package er.examples.erjaxws;

import er.extensions.appserver.ERXSession;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package your.app.components;
package er.examples.erjaxws.components;

import com.webobjects.appserver.WOContext;

import er.examples.erjaxws.Application;
import er.examples.erjaxws.Session;
import er.extensions.components.ERXComponent;
import your.app.Application;
import your.app.Session;

@SuppressWarnings("serial")
public class BaseComponent extends ERXComponent {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package your.app.components;
package er.examples.erjaxws.components;

import com.webobjects.appserver.WOContext;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package your.app.ws;
package er.examples.erjaxws.ws;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package your.app.ws;
package er.examples.erjaxws.ws;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package your.app.ws;
package er.examples.erjaxws.ws;

import javax.jws.WebMethod;
import javax.jws.WebParam;
Expand All @@ -12,11 +12,11 @@

/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.4-b01
* Generated source version: 2.2
* JAX-WS RI 2.1.6 in JDK 6
* Generated source version: 2.1
*
*/
@WebService(name = "Calculator", targetNamespace = "http://ws.app.your/")
@WebService(name = "Calculator", targetNamespace = "http://ws.erjaxws.examples.er/")
@XmlSeeAlso({
ObjectFactory.class
})
Expand All @@ -32,8 +32,8 @@ public interface Calculator {
*/
@WebMethod
@WebResult(targetNamespace = "")
@RequestWrapper(localName = "add", targetNamespace = "http://ws.app.your/", className = "your.app.ws.Add")
@ResponseWrapper(localName = "addResponse", targetNamespace = "http://ws.app.your/", className = "your.app.ws.AddResponse")
@RequestWrapper(localName = "add", targetNamespace = "http://ws.erjaxws.examples.er/", className = "er.examples.erjaxws.ws.Add")
@ResponseWrapper(localName = "addResponse", targetNamespace = "http://ws.erjaxws.examples.er/", className = "er.examples.erjaxws.ws.AddResponse")
public int add(
@WebParam(name = "arg0", targetNamespace = "")
int arg0,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

package er.examples.erjaxws.ws;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Logger;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;


/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.1.6 in JDK 6
* Generated source version: 2.1
*
*/
@WebServiceClient(name = "CalculatorService", targetNamespace = "http://ws.erjaxws.examples.er/", wsdlLocation = "http://127.0.0.1:50684/cgi-bin/WebObjects/WebService_Created.woa/ws/Calculator?wsdl")
public class CalculatorService
extends Service
{

private final static URL CALCULATORSERVICE_WSDL_LOCATION;
private final static Logger logger = Logger.getLogger(er.examples.erjaxws.ws.CalculatorService.class.getName());

static {
URL url = null;
try {
URL baseUrl;
baseUrl = er.examples.erjaxws.ws.CalculatorService.class.getResource(".");
url = new URL(baseUrl, "http://127.0.0.1:50684/cgi-bin/WebObjects/WebService_Created.woa/ws/Calculator?wsdl");
} catch (MalformedURLException e) {
logger.warning("Failed to create URL for the wsdl Location: 'http://127.0.0.1:50684/cgi-bin/WebObjects/WebService_Created.woa/ws/Calculator?wsdl', retrying as a local file");
logger.warning(e.getMessage());
}
CALCULATORSERVICE_WSDL_LOCATION = url;
}

public CalculatorService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}

public CalculatorService() {
super(CALCULATORSERVICE_WSDL_LOCATION, new QName("http://ws.erjaxws.examples.er/", "CalculatorService"));
}

/**
*
* @return
* returns Calculator
*/
@WebEndpoint(name = "CalculatorPort")
public Calculator getCalculatorPort() {
return super.getPort(new QName("http://ws.erjaxws.examples.er/", "CalculatorPort"), Calculator.class);
}

/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns Calculator
*/
@WebEndpoint(name = "CalculatorPort")
public Calculator getCalculatorPort(WebServiceFeature... features) {
return super.getPort(new QName("http://ws.erjaxws.examples.er/", "CalculatorPort"), Calculator.class, features);
}

}
Loading