Jax-rpc endpoint interface
in richard mansion-haffel book, endpint interface (which extends java.rmi.Remote ) is mentioned .
but when i try to build a sample application in weblogic or axis , endpoint interface is not yet all used.
the implementation class is used directly.
can any one please tell me abt endpoint interface..
I had found a solution on this. By changing the SessionBean extends EJBObject to Remote, then problem solved.
But here I had a newer challenge, this is the error log:
2006-05-15 15:37:00,296 ERROR gov.mohr.ems.core.entity.logic.PersistenceWebServicesTest - javax.xml.rpc.ServiceException: modeler error: expected root element "definitions" (in namespace "http://schemas.xmlsoap.org/wsdl/"), found element "html" (in namespace "http://www.w3.org/1999/xhtml")
Similar Messages
-
Deploying related JAX-RPC endpoints
Hi,
I've got some JAX-RPC endpoints that are basically two interfaces to a whole heap of behind the scenes classes that they both share. It seems it's not possible to deploy two endpoints in the same WAR. What would be the recommended way to deploy these so that I only need deploy these classes once, and there will only be one instance of them in the servlet that both interface implementations reference?
On a similar note, is there a similar practice that could be applied to JSP's, as I have 3 jsp "web sites" that need to be fairly distinct in their deployment, but they share some common jsp's as static includes and some classes. What's the best way to deploy the shared includes and java classes so that they are deployed to the tomcat server once and used by all 3 jsp sites?
I'm using jwsdp 1.0.01
Thanks for any helpI saw this discussion and had come to the same conclusion. However there is more to it.
If you deploy a service as HTTP secure, then how do you tell the client to get the WSDL? Because the wscompile for the client does not support authentication.
I tried to put the WSDL on a separate (non-secure) end-point, but it does not seem to work. Even when I define the two endpoints separately in the jaxrpc-ri.xml e.g.
<webServices
xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/dd"
version="1.0"
targetNamespaceBase="urn:IMEIWS"
typeNamespaceBase="urn:IMEIWS"
urlPatternBase="/ws">
<endpoint
name="IMEIWebService"
displayName="IMEI Web Service from Wilabs"
description="A web service."
interface="com.wilabs.imeiws.server.IMEIWebServiceInterface"
implementation="com.wilabs.imeiws.server.IMEIWebServiceImpl"
port="{urn:IMEIWS}IMEIWebServiceInterfacePort"
model="/WEB-INF/model.gz"/>
<endpoint
name="IMEIWebServiceWSDL"
displayName="IMEI Web Service WSDL"
description="A web service to obtain the WSDL."
interface="com.wilabs.imeiws.wsdl.IMEIWebServiceInterface"
implementation="com.wilabs.imeiws.wsdl.IMEIWebServiceImpl"
port="{urn:IMEIWS}IMEIWebServiceWSDLPort"
model="/WEB-INF/model.gz"/>
<endpointMapping
endpointName="IMEIWebService"
urlPattern="/imeiws"/>
<endpointMapping
endpointName="IMEIWebServiceWSDL"
urlPattern="/wsdl"/>
</webServices>
I get only one in the jaxrpc-ri-runtime.xml i.e.:
name='IMEIWebService'
interface='com.wilabs.imeiws.server.IMEIWebServiceInterface'
implementation='com.wilabs.imeiws.server.IMEIWebServiceImpl'
tie='com.wilabs.imeiws.server.IMEIWebServiceInterface_Tie'
model='/WEB-INF/model.gz'
wsdl='/WEB-INF/IMEIWebService.wsdl'
service='{urn:IMEIWS}IMEIWebService'
port='{urn:IMEIWS}IMEIWebServiceInterfacePort'
urlpattern='/imeiws'/> -
JAX-RPC and Parameter Interfaces
I am designing the Web Service interface for our project using JAX-RPC, and have enjoyed the ease with which I can create Web Service deployments and WSDL documents.
However, some of the developers on my team have chosen to create their Data Transfer Objects as a pair of Interface and Implementation classes. This works okay in scenario where the WS caller is "pulling" data from my service. However, it doesn't work in the scenario where the caller is "pushing" data to the service because JAX-RPC can't make the connection between the interface and implementation classes used in my service interface.
For example, suppose there are four classes in the project: MyService, MyServiceImpl, Foo, and FooImpl. The MyService class uses Foo in it's method signatures. How does JAX-RPC know to instantiate an instance of FooImpl for incoming requests?
public class MyServiceImpl implements MyService {
// not ok
public void doStuff (Foo arg) { ... }
// ok
public Foo giveMeStuff () { ... }
It would be nice if JAX-RPC provided annotations that facilitated making connections between interfaces and implementation classes used in service inputs and outputs. For example:
@WebServiceInterface {
Implementation=FooImpl
public Foo {
Any thoughts? Thanks,
Scott Kidder
http://urlgrey.net/Found some answer from the following link
http://forum.java.sun.com/thread.jsp?forum=331&thread=465860 -
EJB 3.0 and JAX-RPC 1.1 Not Working Together
I've came across a strange behavior when building a JAX-RPC 1.1 service in WebLogic 10 on top of a EJB 3.0 bean:
Business Interface
@Remote
@WebService(targetNamespace="http://coronelado.sf.net")
public interface AuthenticationBO {
boolean login(String email, String password) throws AuthenticationBOException;
Bean
@Stateless(name="AuthenticationBO")
@TransactionManagement(BEAN)
@WLHttpTransport(contextPath="coronelado-service", serviceUri="AuthenticationBOService")
@WebService(endpointInterface="net.sf.coronelado.business.AuthenticationBO")
public class AuthenticationBOBean implements AuthenticationBO {
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
<enterprise-beans>
<session>
<ejb-name>AuthenticationBO</ejb-name>
<service-endpoint>net.sf.coronelado.business.AuthenticationBO</service-endpoint>
</session>
</enterprise-beans>
</ejb-jar>After I deploy the bean, two web services, not one, are listed in the console: AuthenticationBOService and AuthenticationBOBeanService (a duplicate), and the following error message is printed:
[JAM] Warning: failed to resolve class net.sf.coronelado.business.AuthenticationBOBeanAm I missing something here?http://fernandoribeiro.eti.br/2007/06/27/bug-in-weblogic-10-web-services/
-
Newbie to attachment with JAX-RPC
Hi,
I am new to Web Services. I am developing a web services using oracle technology. I use JDeveloper 10g to create my web services using stateless Java class. Everything are so simple with clicking here and there to generate my WSDL file, web service stub and so on. Oracle use their own servlet as shown below.
<servlet-name>MyWebService1</servlet-name>
<servlet-class>oracle.j2ee.ws.StatelessJavaRpcWebService</servlet-class>I had created my interface and implements (Hello.java & HelloImpl.java respectively). Having a method public String sayHello(String param).
Now, I want to send a attachment (or more than one) to the client using JAX-RPC. My problem now is don't-know-where-to-start. I have gone through a few example but most of the examples are so misleading. I understand that the endpoint of a web services is from servlet. Am I suppose to start my coding to attach the document(*.doc, *.pdf, and so on) to the SOAP object in my Hello.java or HelloImpl.java? Correct me if I am wrong.
Anyone out there has a sample code of how-to send attachment with JAX-RPC with step-by-step (especially using oracle jdeveloper 10g if exist) article, if any?
Please help, I am lost. Thanks in advance.
regards,
yientauHi,
I am new to Web Services. I am developing a web services using oracle technology. I use JDeveloper 10g to create my web services using stateless Java class. Everything are so simple with clicking here and there to generate my WSDL file, web service stub and so on. Oracle use their own servlet as shown below.
<servlet-name>MyWebService1</servlet-name>
<servlet-class>oracle.j2ee.ws.StatelessJavaRpcWebService</servlet-class>I had created my interface and implements (Hello.java & HelloImpl.java respectively). Having a method public String sayHello(String param).
Now, I want to send a attachment (or more than one) to the client using JAX-RPC. My problem now is don't-know-where-to-start. I have gone through a few example but most of the examples are so misleading. I understand that the endpoint of a web services is from servlet. Am I suppose to start my coding to attach the document(*.doc, *.pdf, and so on) to the SOAP object in my Hello.java or HelloImpl.java? Correct me if I am wrong.
Anyone out there has a sample code of how-to send attachment with JAX-RPC with step-by-step (especially using oracle jdeveloper 10g if exist) article, if any?
Please help, I am lost. Thanks in advance.
regards,
yientau -
JAX-RPC documentliteral with -model option problems in JWSDP 2.0
Hello,
I am trying to deploy a service generated with JAX-RPC. Howeverr when I write URL (http://localhost:8080/webservicedeployable/webservice001) in a browser I am getting message: 404 Not Found: Invalid request. Appending ?WSDL shows propers wsdl code, so endpoint URL is allright.. There is my config file delow:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
<service name="webservice001"
targetNamespace="http://scdjws/webservices/wsdl"
typeNamespace="http://scdjws/webservices/types"
packageName="com.service001">
<interface name="service.MyServicePort" servantName="service.MyServiceImpl"/>
</service>
</configuration>I am using command:
wscompile -gen:server -f:documentliteral -s "C:\Documents and Settings\Michal\jbproject\mojservice\src\" -classpath WEB-INF/classes -d build -model webservice001.xml.gz config.xml -keepmy jaxrpc-ri.xml is:
<?xml version="1.0" encoding="utf-8"?>
<webServices xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/dd"
version="1.0"
targetNamespaceBase="http://java.sun.com/xml/ns/jax-rpc/wsi/wsdl"
typeNamespaceBase="http://java.sun.com/xml/ns/jax-rpc/wsi/types"
urlPatternBase="/ws">
<endpoint name="service001"
displayName="Service 001"
description="This is service001"
interface="service.MyServicePort"
implementation="service.MyServiceImpl"
model="/webservice001.xml.gz"/>
<endpointMapping endpointName="service001"
urlPattern="/webservice001"/>
</webServices>I am using Tomcat 5.5.16 and JWSDP 2.0.
Making a call to the service throws exception:
java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/webservicedeployable/webservice001
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:791)
Thank you in advance for all suggestion.
MichalHi,
I reselved the problem by just copying the FastInfoset to the jaxrpc\lib directory (I am sure this should work in a different way).
Well, the next problem I am getting is that the "XMLStreamWriter" class cannot be found. This class is contained in jsr173_api.jar.
I guess my main question is the following:
Which projects are necessary to get this simple helloWorld example to work?
I did set the JWSDP_HOME varible. Is there another setting I have to make to have all necessary jar-files available and to be able to run the samples?
Could anybody point me to a tutorial that does not only show a few lines of code (as the HelloWorld sample in the JWSDP-Tutorial) but that would instead lead me through a step-by-step sample application that I write by myself and actually runs at the end? The example in the JWSDP-Tutorial uses all kinds of existing config files which are not explained.
Thanks for your help. -
[Beginner] Help! How to change the packet name for an jax-rpc example
Hi
I am new to the JWSDP, I tried to build and deploy the helloservice application (the example in
tutorial), it works fine. But I want to change the packet name from helloservice to books, it
returns error message during the building process.
Here is what I did.
I changed the folder name from helloservice to books.
In helloIF.java and helloImp1.java, changed to "package books"
In build.properties:
example=books
war.path=${tut.root}/examples/jaxrpc/books/${dist}/${deployable.war}
context.path=${hello.context}
portable.war=${context.path}-portable.war
deployable.war=${context.path}.war
In jaxrpc-ri.xml,
<?xml version="1.0" encoding="UTF-8"?>
<webServices
xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/dd"
version="1.0"
targetNamespaceBase="urn:foo"
typeNamespaceBase="urn:foo"
urlPatternBase="/ws">
<endpoint
name="MyHello"
displayName="HelloWorld Service"
description="A simple web service"
interface="books.HelloIF"
model="/WEB-INF/model.gz"
implementation="books.HelloImpl"/>
<endpointMapping
endpointName="MyHello"
urlPattern="/hello"/>
</webServices>
In config-interface.xml,
<?xml version="1.0" encoding="UTF-8"?>
<configuration
xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
<service
name="MyHelloservice"
targetNamespace="urn:foo"
typeNamespace="urn:foo"
packageName="books">
<interface name="books.HelloIF"/>
</service>
</configuration>
When I run "ant build", it returns the following error message:
run-wscompile:
[echo] Running wscompile:
[echo] C:\jwsdp-1.3\apache-ant\../jaxrpc/bin/wscompile.bat -define -d bui
ld -nd build -classpath build config-interface.xml -model build/mo
del.gz
[exec] error parsing configuration file: XML parsing error: com.sun.xml.rpc
.sp.ParseException:1: com.sun.xml.rpc.sp/P-067
[exec] Result: 1
All I want to do is just change the packet name, anyone know how to do it?
Please help me.
Thank you.For future reference, please post JAXRPC related questions to [email protected]
There is something syntatically wrong with your config.xml. Try reverting back to the original, and try that. Then try modifying it again making sure to only change the packageName. -
JAX-RPC client problems and proxy
I have deployed a JAX-RPC service in JBoss, but on the client side, I am getting NullPointerException when I attempt to access the service. I believe I'm not creating the proxy in the client properly. Where I need help is:
1. What should the proper ENDPOINT URI be for the service (my variable "destination" shown below).
2. What should the code in createProxy() look like?
WEB Services Shows:
===================
VehicleInfoService ACTIVE
Address: http://myhost:8080/VehicleInfoService/vehicle
WSDL: http://myhost:8080/VehicleInfoService/vehicle?WSDL
Port QName: {http://myhost:8080/wsdl/VehicleInfoService}VehicleInfoServiceIFPort
Remote interface: testsoap.VehicleInfoServiceIF
Implementation class: testsoap.VehicleInfoServiceImpl
Model: http://myhost:8080/VehicleInfoService/vehicle?model
CLIENT CODE
============
import javax.xml.rpc.*;
import javax.xml.rpc.Stub;
import testsoap.*;
public class TestSOAP
VehicleInfoServiceIF vehicleInfoServiceInf;
private String statusMessage = null;
private static String destination = "http://myhost:8080/VehicleInfoService/v
ehicle";
public TestSOAP()
try
Stub stub = createProxy();
// Address of the service
stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
destination);
vehicleInfoServiceInf = (VehicleInfoServiceIF)stub;
catch (Exception ex)
statusMessage = "Error creating Proxy stub: " + ex.getMessage();
private static Stub createProxy()
return(Stub)(new VehicleInfoService_Impl());To reply to own posting, I finally discovered that I had a problem with my config.xml file. Once I corrected that, I was able to modify the createProxy entry to:
private static Stub createProxy()
return(Stub)(new testacp.VehicleInfoService_Impl().getVehicleInfoServiceIFPo
rt());
Corrected config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<configuration
xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
<wsdl location="http://mybox:8080/VehicleInfoService/vehicle?WSDL"
packageName="testsoap"/>
</configuration>
These changes fixed my problem. With the correct entries in config.xml, I no longer got compile errors with "getVehicleInfoServiceIFPort Not Found". -
Cannot Run JAX-RPC Hello Service Example
Hello,
I am trying to run the helloservice example from the Java Web Services Tutorial v 1.3 (Chapter 12). Upon running the ant build task, I get the following error.
BUILD FAILED
file:C:/jwstutorial13/examples/jaxrpc/common/targets.xml:151: Warning: Could not
find file C:\jwstutorial13\examples\jaxrpc\helloservice\build\model.gz to copy.
I tried running the ant generate-sei-service task separately. This appears to complete successfully, yet, there is no model file generated.
Any help/suggestions/insights would be very much appreciated!
Thanks,
SheilaThanks!
I did that before posting my original message. I'm obviously missing something (noting jumps out at me, as far as being wrong.)
My files look like this:
File: build.xml (C:\jwstutorial13\examples\jaxrpc\helloservice\build.xml)
<!DOCTYPE project [
<!ENTITY jaxrpctargets SYSTEM "../common/targets.xml">
]>
<project name="jaxrpc-tutorial" default="build" basedir=".">
<property file="../../common/build.properties"/>
<property file="../common/build.properties"/>
<property file="build.properties"/>
&jaxrpctargets;
<target name="build" depends="build-service"
description="Executes the targets needed to build the service.">
</target>
</project>
==================================================================================
File: build.properties (C:\jwstutorial13\examples\jaxrpc\helloservice\build.properties).
example=helloservice
war.path=${tut.root}/examples/jaxrpc/helloservice/${dist}/${deployable.war}
context.path=${hello.context}
portable.war=${context.path}-portable.war
deployable.war=${context.path}.war
==================================================================================
File: build.properties (C:\jwstutorial13\examples\jaxrpc\common\build.properties)
# This file contains properties common to the tutorial examples
# for JAX-RPC.
# tut.root=C:/wspack-docs
tut.root=${tutorial.install}
hello.context=hello-jaxrpc
secure.context=secure-jaxrpc
mutualauth.context=secure-mutualauth
url.pattern=/hello
key.store=${tutorial.home}/jwstutorial13/examples/jaxrpc/mutualauth/keystore.jks
key.store.password=changeit
trust.store=${tutorial.home}/jwstutorial13/examples/jaxrpc/mutualauth/cacerts.jks
trust.store.password=changeit
hello.endpoint=http://${host}:${port}/${hello.context}${url.pattern}
secure.endpoint=http://${host}:${port}/${secure.context}${url.pattern}
mutualauth.endpoint=https://${host}:${secure.port}/${mutualauth.context}${url.pattern}
build=build
src=src
dist=dist
client.jar=client.jar
model.file=model.gz
config.wsdl.file=config-wsdl.xml
config.interface.file=config-interface.xml
jwsdp.shared=${jwsdp.home}/jwsdp-shared
jaxp.home=${jwsdp.home}/jaxp
jaxrpc.home=${jwsdp.home}/jaxrpc
saaj.home=${jwsdp.home}/saaj
wscompile.dir=${jaxrpc.home}/bin
wsdeploy.dir=${jaxrpc.home}/bin
javamail.jar=${jwsdp.shared}/lib/mail.jar
jaf.jar=${jwsdp.shared}/lib/activation.jar
jaxp-api.jar=${jaxp.home}/lib/jaxp-api.jar
dom.jar=${jaxp.home}/lib/endorsed/dom.jar
sax.jar=${jaxp.home}/lib/endorsed/sax.jar
xalan.jar=${jaxp.home}/lib/endorsed/xalan.jar
xercesImpl.jar=${jaxp.home}/lib/endorsed/xercesImpl.jar
jaxrpc-api.jar=${jaxrpc.home}/lib/jaxrpc-api.jar
jaxrpc-impl.jar=${jaxrpc.home}/lib/jaxrpc-impl.jar
jaxrpc-spi.jar=${jaxrpc.home}/lib/jaxrpc-spi.jar
commons-logging.jar=${jwsdp.shared}/lib/commons-logging.jar
saaj-api.jar=${saaj.home}/lib/saaj-api.jar
saaj-impl.jar=${saaj.home}/lib/saaj-impl.jar
relaxngDatatype.jar=${jwsdp.shared}/lib/relaxngDatatype.jar
xsdlib.jar=${jwsdp.shared}/lib/xsdlib.jar
jax-qname.jar=${jwsdp.shared}/lib/jax-qname.jar
ant.jar=${jwsdp.home}/apache-ant/lib/ant.jar
==================================================================================
This is where I thought the problem might be, but I can't determine what's wrong. The pathelements in this file, were set in build.properties ((C:\jwstutorial13\examples\jaxrpc\common\build.properties), referenced above.
File: targets.xml (C:\jwstutorial13\examples\jaxrpc\common\targets.xml)
<!-- targets.xml: Referenced by the build.xml files, this file
contains targets common to all of the jaxrpc examples. -->
<path id="compile.classpath">
<pathelement location="${javamail.jar}"/>
<pathelement location="${jaf.jar}"/>
<pathelement location="${jaxp-api.jar}"/>
<pathelement location="${dom.jar}"/>
<pathelement location="${sax.jar}"/>
<pathelement location="${xalan.jar}"/>
<pathelement location="${xercesImpl.jar}"/>
<pathelement location="${jaxrpc-api.jar}"/>
<pathelement location="${jaxrpc-impl.jar}"/>
<pathelement location="${jaxrpc-spi.jar}"/>
<pathelement location="${commons-logging.jar}"/>
<pathelement location="${saaj-api.jar}"/>
<pathelement location="${saaj-impl.jar}"/>
<pathelement location="${relaxngDatatype.jar}"/>
<pathelement location="${xsdlib.jar}"/>
<pathelement location="${jax-qname.jar}"/>
<pathelement location="${ant.jar}"/>
<pathelement location="${build}/shared"/>
</path>
<path id="run.classpath">
<path refid="compile.classpath"/>
<pathelement location="${dist}/${client.jar}"/>
</path>
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" />
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask" />
<taskdef name="list" classname="org.apache.catalina.ant.ListTask" />
<taskdef name="start" classname="org.apache.catalina.ant.StartTask" />
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask" />
<taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/>
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
<taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask"/>
<target name="install" description="Install web application"
depends="build">
<install url="${url}" username="${username}" password="${password}"
path="/${context.path}" war="file:${example.path}/${build}"/>
</target>
<target name="deploy"
description="Deploys a Web application">
<deploy url="${url}" username="${username}" password="${password}"
path="/${context.path}" war="file:${war.path}"
/>
</target>
<target name="undeploy"
description="Undeploys a Web application">
<undeploy url="${url}" username="${username}" password="${password}"
path="/${context.path}"
/>
</target>
<target name="redeploy"
description="Undeploys and deploys a Web aplication">
<antcall target="undeploy" />
<antcall target="deploy" />
</target>
<target name="list"
description="Lists Web applications">
<echo message="Listing the applications...."/>
<list
url="${url}"
username="${username}"
password="${password}"
/>
</target>
<target name="start"
description="Starts a Web application">
<echo message="Starting the application...."/>
<start
url="${url}"
username="${username}"
password="${password}"
path="/${context.path}"
/>
</target>
<target name="stop"
description="Stops a Web application">
<echo message="Stopping the application...."/>
<stop
url="${url}"
username="${username}"
password="${password}"
path="/${context.path}"
/>
</target>
<target name="prepare"
description="Creates the build directory" >
<echo message="Creating the required directories...." />
<mkdir dir="${build}/${example}" />
</target>
<target name="prepare-dist"
description="Creates the dist directory" >
<echo message="Creating the required directories...." />
<mkdir dir="${dist}" />
</target>
<target name="set-wscompile" >
<condition property="wscompile" value="${wscompile.dir}/wscompile.bat">
<os family="windows"/>
</condition>
<condition property="wscompile" value="${wscompile.dir}/wscompile.sh">
<not>
<os family="windows"/>
</not>
</condition>
</target>
<target name="set-wsdeploy" >
<condition property="wsdeploy" value="${wsdeploy.dir}/wsdeploy.bat">
<os family="windows"/>
</condition>
<condition property="wsdeploy" value="${wsdeploy.dir}/wsdeploy.sh">
<not>
<os family="windows"/>
</not>
</condition>
</target>
<target name="compile-service" depends="prepare"
description="Compiles the server-side source code">
<echo message="Compiling the server-side source code...."/>
<javac srcdir="${src}"
destdir="${build}"
includes="*.java"
excludes="*Client.java">
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="setup-web-inf"
description="Copies files to build/WEB-INF">
<echo message="Setting up ${build}/WEB-INF...."/>
<delete dir="${build}/WEB-INF" />
<copy todir="${build}/WEB-INF/classes/${example}">
<fileset dir="${build}/${example}" />
<fileset dir="${build}/${example}" />
</copy>
<copy file="${build}/${model.file}" todir="${build}/WEB-INF" />
<copy file="web.xml" todir="${build}/WEB-INF" />
<copy file="jaxrpc-ri.xml" todir="${build}/WEB-INF" />
</target>
<target name="package-service" depends="prepare-dist"
description="Packages the WAR file">
<echo message="Packaging the WAR...."/>
<delete file="${dist}/${portable.war}" />
<jar jarfile="${dist}/${portable.war}" >
<fileset dir="${build}" includes="WEB-INF/**" />
</jar>
</target>
<target name="process-war" depends="set-wsdeploy"
description="Runs wsdeploy to generate the ties and
create a deployable WAR file">
<delete file="dist/${deployable.war}" />
<antcall target="run-wsdeploy">
<param name="param1" value="-o dist/${deployable.war} dist/${portable.war}"/>
</antcall>
</target>
<target name="run-wscompile" depends="prepare,set-wscompile"
description="Runs wscompile">
<echo message="Running wscompile:"/>
<echo message=" ${wscompile} ${param1}"/>
<exec executable="${wscompile}">
<arg line="${param1}"/>
</exec>
</target>
<target name="run-wsdeploy" depends="prepare,set-wsdeploy"
description="Runs wsdeploy">
<echo message="Running wsdeploy:"/>
<echo message=" ${wsdeploy} ${param1}"/>
<exec executable="${wsdeploy}">
<arg line="${param1}"/>
</exec>
</target>
<target name="generate-sei-service"
description="Runs wscompile to generate the model file">
<antcall target="run-wscompile">
<param name="param1" value="-define -d ${build} -nd ${build}
-classpath ${build} ${config.interface.file}
-model ${build}/${model.file}"/>
</antcall>
<delete file="${build}/MyHelloService.wsdl"/>
</target>
<target name="generate-interface"
description="Runs wscompile to generate the service endpoint
interface">
<antcall target="run-wscompile">
<param name="param1" value="-import -d ${build} -nd ${build}
-f:norpcstructures -classpath ${build} ${config.wsdl.file}"/>
</antcall>
</target>
<target name="generate-stubs"
description="Runs wscompile to generate the client stub classes">
<antcall target="run-wscompile">
<param name="param1" value="-gen:client -d ${build}
-classpath ${build} ${config.wsdl.file}"/>
</antcall>
</target>
<target name="compile-client" depends="prepare"
description="Compiles the client-side source code" >
<echo message="Compiling the client source code...."/>
<javac srcdir="${src}"
destdir="${build}"
includes="*.java">
<classpath refid="compile.classpath"/>
<classpath path="${build}" />
</javac>
</target>
<target name="package-client" depends="prepare-dist"
description="Builds the JAR file that contains the client">
<echo message="Building the client JAR file...."/>
<delete file="${dist}/${client.jar}" />
<jar jarfile="${dist}/${client.jar}" >
<fileset dir="${build}" />
</jar>
</target>
<target name="package-dynamic" depends="prepare-dist"
description="Builds the JAR file that contains the dynamic proxy client">
<echo message="Building the client JAR file...."/>
<delete file="${dist}/${client.jar}" />
<jar jarfile="${dist}/${client.jar}" >
<fileset dir="${build}" includes="**/HelloClient.class" />
<fileset dir="${build}" includes="**/HelloIF.class" />
</jar>
</target>
<target name="build-service" depends="clean,compile-service,generate-sei-service,
setup-web-inf,package-service,process-war"
description="Executes the targets needed to build the service.">
</target>
<target name="build-static" depends="clean,generate-stubs,
compile-client,package-client"
description="Executes the targets needed to build a static stub client.">
</target>
<target name="build-dii" depends="clean,prepare,compile-client,package-client"
description="Executes the targets needed to build a DII client.">
</target>
<target name="build-dynamic" depends="clean,prepare,generate-interface,
compile-client,package-dynamic"
description="Executes the targets needed to build a dynamic proxy client.">
</target>
<target name="build-webclient" depends="clean,generate-stubs"
description="Executes the targets needed to build a web client.">
</target>
<target name="run-client"
description="Runs a stand-alone (non-J2EE) client">
<java classname="${client.class}" fork="yes" >
<arg line="${endpoint.address}" />
<classpath refid="run.classpath" />
</java>
</target>
<target name="run-secure-client"
description="Runs a client with basic authentication over SSL">
<java classname="${client.class}" fork="yes" >
<arg line="${username} ${password} ${endpoint.address}" />
<classpath refid="run.classpath" />
</java>
</target>
<target name="run-mutualauth-client"
description="Runs a client with mutual authentication over SSL">
<java classname="${client.class}" fork="yes" >
<arg line="${key.store} ${key.store.password}
${trust.store} ${trust.store.password}
${endpoint.address}" />
<classpath refid="run.classpath" />
</java>
</target>
<target name="clean"
description="Removes the build directory">
<delete dir="${build}" />
</target>
<target name="listprops" depends="set-wscompile"
description="Displays values of some of the properties of this
build file">
<echo message="jaxrpc.home = ${jaxrpc.home}" />
<echo message="wscompile = ${wscompile}" />
<echo message="build = ${build}" />
<echo message="src = ${src}" />
<echo message="dist = ${dist}" />
<echo message=" " />
<echo message="example = ${example}" />
<echo message="client.jar = ${client.jar}" />
<echo message="client.class = ${client.class}" />
<echo message=" " />
<echo message="host = ${host}" />
<echo message="port = ${port}" />
<echo message="secure.port = ${secure.port}" />
<echo message="trust.store = ${trust.store}" />
<echo message="trust.store.password = ${trust.store.password}" />
<echo message=" " />
<echo message="username = ${username}" />
<echo message="password = ${password}" />
<echo message="url = ${url}" />
<echo message=" " />
<echo message="context.path = ${context.path}" />
<echo message="secure.context.path = ${secure.context.path}" />
<echo message="url.pattern = ${url.pattern}" />
<echo message="endpoint.address = ${endpoint.address}" />
<echo message="secure.endpoint = ${secure.endpoint}" />
<echo message=" " />
<echo message="war.path = ${war.path}" />
<echo message="portable.war = ${portable.war}" />
<echo message="deployable.war = ${deployable.war}" />
</target>
==================================================================================
File: targets.xml ( C:\jwstutorial13\examples\common\targets.xml)
<taskdef name="list" classname="org.apache.catalina.ant.ListTask"/>
<taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/>
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask"/>
<taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask"/>
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"/>
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
<target name="list" description="List web applications" >
<list url="${url}" username="${username}" password="${password}" />
</target>
<target name="install" description="Install web application"
depends="build">
<install url="${url}" username="${username}" password="${password}"
path="/${context.path}" war="file:${build}"/>
</target>
<target name="reload" description="Reload web application"
depends="build">
<reload url="${url}" username="${username}" password="${password}"
path="/${context.path}"/>
</target>
<target name="remove" description="Remove web application">
<remove url="${url}" username="${username}" password="${password}"
path="/${context.path}"/>
</target>
<target name="package"
description="Packages the WAR file">
<echo message="Packaging the WAR...."/>
<delete file="dist/${war.file}" />
<jar jarfile="dist/${war.file}" >
<fileset dir="${build}" />
</jar>
</target>
<target name="deploy" description="Deploy a Web application">
<deploy url="${url}" username="${username}" password="${password}"
path="/${context.path}" war="file:/${example.path}/dist/${war.file}"
/>
</target>
<!--<target name="deploy" description="Deploy a Web application">
<deploy url="${url}" username="${username}" password="${password}"
path="/${context.path}" war="file:/${example.path}/dist/${war.file}"
/>
</target> -->
<target name="undeploy" description="Undeploy web application">
<undeploy url="${url}" username="${username}" password="${password}"
path="/${context.path}"/>
</target>
==================================================================================
File: build.properties (C:\jwstutorial13\examples\common\build.properties)
tutorial.home=C:/jwstutorial13
tutorial.install=${tutorial.home}
username=******
password=********
host=localhost
port=8080
secure.port=8443
url=http://${host}:${port}/manager
==================================================================================
Finally, here is how I've got my PATH Environmental Variable Set:
PATH:
%JWSDP_HOME%\apache-ant\bin;%JWSDP_HOME%\jwsdp-shared\bin;%JWSDP_HOME%\bin;%JAVA_HOME%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\WBEM;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\
I set this up according to the instructions at the beginning of the tutorial.
JWSDP_HOME: C:\jwsdp-1.3
JAVA_HOME: C:\j2sdk1.4.1_05
Thanks again for your help.
Sheila -
In the tutorial
Access J2EE 1.4 JAX-RPC Java Web Services from Web Clients
http://www.oracle.com/technology/products/jdev/101/howtos/jaxrpc/java14_ws_web_clients.html#creating_web_service
A MyWebService1SEI.java interface is also required to be added to generate a JAX-RPC Web service.The MyWebService1SEI.java interface does not get generated as indicated in the tutorial.
If the Web service is generated with
File>New>Business Tier>Java Web Service with the
Autogenerate Service Endpoint Interface checkbox selected,
the MyWebService1SEI.java interface does not get generated.
The Autogenerate Service Endpoint Interface feature does not autogenerate java interface. -
Problem verify web services HelloWorld JAX-RPC
I have executed the tutorial Jax-RPC HelloWorld,
but when I verify the web service my browser display
A Web Service is installed at this URL.
This endpoint is incorrectly configured. Please check the location and contents of the configuration file.
which it is the problem?
you can help me?
thanksCheck if the endpoint property of the build.properties file
(ex. endpoint=...ttp://localhost:8080/SmsWSservice/SMS/SmsWSIF)
matches exactly (is case sensitive) the url pattern element content (ex. <servlet-mapping>
<servlet-name>JAXRPCEndpoint</servlet-name>
<url-pattern>/SMS/*</url-pattern>
</servlet-mapping>) of the web.xml file.
In the examples above the url-pattern "SMS" must match the part of the URL between "...ttp://localhost:8080/SmsWSservice/" and the reference of the interface ("SmsWSIF).
Hope it helps -
Weblogic 8, no jax-rpc context info available error
i've developed some web services using the jwsdp 1.3. they deploy and run fine in jwsdp 1.3 and also in jboss 3.2. i deployed the same web services in weblogic 8.1 with no problems. when i access the web service and the wsdl, i get the following error:
Web Services
No JAX-RPC context information available.
my jaxrpc-ri.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<webServices
xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/dd"
version="1.0"
targetNamespaceBase="urn:Foo"
typeNamespaceBase="urn:Foo"
urlPatternBase="/ws">
<endpoint
name="JobService"
displayName="WorkPoint Job Service"
description="WorkPoint Job Service for API calls"
interface="com.workpoint.webservices.JobServiceIF"
wsdl="/WEB-INF/JobService.wsdl"
model="/WEB-INF/JobService.xml.gz"
implementation="com.workpoint.webservices.JobServiceImpl"/>
<endpoint
name="ServerConfigService"
displayName="WorkPoint ServerConfig Service"
description="WorkPoint ServerConfig Service for API calls"
interface="com.workpoint.webservices.ServerConfigServiceIF"
wsdl="/WEB-INF/ServerConfigService.wsdl"
model="/WEB-INF/ServerConfigService.xml.gz"
implementation="com.workpoint.webservices.ServerConfigServiceImpl"/>
<endpoint
name="WorkItemService"
displayName="WorkPoint Job Service"
description="WorkPoint Job Service for API calls"
interface="com.workpoint.webservices.WorkItemServiceIF"
wsdl="/WEB-INF/WorkItemService.wsdl"
model="/WEB-INF/WorkItemService.xml.gz"
implementation="com.workpoint.webservices.WorkItemServiceImpl"/>
<endpointMapping
endpointName="JobService"
urlPattern="/JobService"/>
<endpointMapping
endpointName="ServerConfigService"
urlPattern="/ServerConfigService"/>
<endpointMapping
endpointName="WorkItemService"
urlPattern="/WorkItemService"/>
</webServices>any ideas on what is going on? also, what is the urlPatternBase used for?I had this problem when I created custom web services : some classes where not generated in the right folder (ie package name).
Check the content of the generated war to see if all the necessary classes and files are in it and in the right place. -
Publish a JAX-RPC Java Web Service - HELP
Hi,
I try to generate a JAX-RPC web services as described in the tutorial : http://www.oracle.com/technology/tech/webservices/htdocs/series/jaxrpc1/index.html. but when generating the web services I have an exception : an unexpected error was encountered. Generation aborted. and when I click details I have the following message :
java.io.FileNotFoundException: C:\jdev10g\jdev\mywork\WS2-TestOracle\Project1\src\__temp_assembler\public_html\WEB-INF\wsdl\MyWebService3.wsdl (Le chemin d'accès spécifié est introuvable)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at oracle.ide.net.FileURLFileSystemHelper.openInputStream(FileURLFileSystemHelper.java:481)
at oracle.ide.net.URLFileSystemHelperDecorator.openInputStream(URLFileSystemHelperDecorator.java:242)
at oracle.ide.net.URLFileSystem.openInputStream(URLFileSystem.java:1028)
at oracle.jdevimpl.webservices.generator.JAXRPCGenerator.populateWSDLWithEndpoint(JAXRPCGenerator.java:2153)
at oracle.jdevimpl.webservices.generator.JAXRPCGenerator.generateServiceImpl(JAXRPCGenerator.java:896)
at oracle.jdevimpl.webservices.generator.JAXRPCGenerator.generateService(JAXRPCGenerator.java:241)
at oracle.jdeveloper.webservices.JAXRPCSvcModel.saveEdit(JAXRPCSvcModel.java:1613)
at oracle.jdevimpl.webservices.wizard.WebServicePublishWizard.runWizard(WebServicePublishWizard.java:504)
at oracle.jdevimpl.webservices.wizard.WebServicePublish.invoke(WebServicePublish.java:95)
at oracle.ide.WizardManager.invokeWizard(WizardManager.java:484)
at oracle.ide.WizardManager$1.run(WizardManager.java:538)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Can any one help,
Thanks,The MyWebService1SEI.java interface does not get generated as indicated in the tutorial.
If the Web service is generated with
File>New>Business Tier>Java Web Service with the
Autogenerate Service Endpoint Interface checkbox selected,
the MyWebService1SEI.java interface does not get generated.
The Autogenerate Service Endpoint Interface feature does not autogenerate java interface. -
Using JAX-RPC handlers to proxy web service traffic
Hi,
I want to use JAX-RPC handlers to proxy web service traffic. In some instances the handler should modifiy / verify the message before forwarding the request to the remote web service end-point. Hence, the handler should forward the call by invoking the remote web service. In some cases the result from invoking the remove service should be post-processed by another proxy handler. To ensure that the result from invoking the remote service is available for post-processing I assume that the handler invoking the remote service must add the response message to the message context ( e g setProperty method) in the handler. Is this correctly understood?
I would like to understand that this is a technically feasible and reasonable approach of using JAX-RPC. I'd really appreciate some feedback here.
Many thanks,
TomHi Eric,
Thanks for your response. we are trying to access WSRR( manages end point urls for 7 different environments) and generate the end point dynamically at the design time. As we figured out WSRR is not compatible with OSB we are trying to implement these client side (OSB Proxy service) handlers which would get the dynamic endpoint depending on the environment used. I was able to create the handlers for this and set the jar in the classpath but the client service which should be using these handlers have to have these handlers defined in the deployment descriptor(web.xml) which am unable to see with a OSB project.
Will there be a deployment descriptor(web.xml/webservices.xml) associated with Proxy services on OSB? Or Is there any other way to add custom JAX-RPC Handlers to a proxy service? Or is there any way to connect to WSRR directly?
Thanks,
Swetha -
How to use user-defined packages in JAX-RPC web service
I am trying to use Object of my class located in my package in jax-rpc webservice,the code is
package supercomputer;
import Hello.*;
public class SuperImpl implements SuperIF
public String sendParam(String data)
Temp ob=new Temp();
int i=ob.get1(10000);
return data+"returned by supercomputer";
Temp is located in Hello package,I have jar the Hello package as Hello.jar and has set its classpath in targets.xml of Ant tool.
The code compiles well and service is deployed successfully,but when i try to call the service from the client its gives me following error.
[echo] Running the supercomputer.SuperClient program....
[java] java.rmi.ServerException: Missing port information
[java] at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:357)
[java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
[java] at supercomputer.SuperIF_Stub.sendParam(SuperIF_Stub.java:60)
[java] at supercomputer.SuperClient.main(Unknown Source)
I dont know if it deploys why it gives error on client side.
Please tell how to use user-defined packages and class in jax-rpc service code ,i am not talking about passing user-defined parameters i am just talking about making objects of user defined classes in jax-rpc service.I think there is some problem in classpath.
Please guide me in doing that.
Thanks,
FarrukhFarrukh,
I don't know if your error is about a missing class from your custom package, ... what track did you followed to say that?
To use your package in the implementation of you web service, you should only follow the rules of making a web application: put your package jar in your \lib directory inside WEB-INF/ or your package classes unjared in classes (also in WEB-INF/).
As I already said, I have doubts that your error should be originated from a missing class from your package, but:
-try to see the logs (errors?) when you deploy your web service that could give a hint about the problem.
-try to see if you can access your endpoint through your browser to see if there is a online status
-display your config/WSDL file, and the steps you did to build your web service.
regards,
Pedro Salazar.
Maybe you are looking for
-
How do I tell FMS to only serve a section of a file using server-side ActionScript?
We have a bunch of mp3 files on our server and we'd like to serve only particular sections of particular files to users. For example, hello.mp3 might be four minutes long, but when user 1 tries to play it, he should only be able to play the section
-
CS2 PROBLEM -- ANY MODERATELY LARGE OPERATION SHUTS DOWN MY LAPTOP
Hi. Need help, if anyone has recommendations. I have Photoshop CS2 on my traveling HP Pavilion zd7000 laptop. 4 gigs of RAM. About 3 gigs of available C drive. Any time I try and paste an image larger than 5 megs, my laptop uddenly goes completely de
-
Server based sequential number
Hello! I have this form on which I need to place a sequence number for control reasons. How can I create this field? As PDFs can't write or read txt files, let alone over networks, I suppose I must call a webservice to read the sequence number somewh
-
JMS Message ID retrieval using Java
Hi, I have built a flow the sequence which is JMS Producer(BPEl)->JMS Consumer(Bpel)->A Bpel composite inserting into database. Now i have deliberately faulted the bpel instance. now i want to capture the faulted consumer bpelcomposite instance id wh
-
Expdp fail and create table SYS_EXPORT_SCHEMA_20
Hi Gurus I am using Oracle 10.2.0.3 in AIX env My database size is around 1600 GB. Sometime my expdp fail and create table like SYS_EXPORT_SCHEMA_20, SYS_EXPORT_SCHEMA_05. As I run expdp from system user , I notice that it create this type of table i