RPC style web service client
hi,
i am new to web service technology. i want to create dynamic web service client for a "rpc" style web service in Netbeans.
please, can anybody guide me for this?
thanks in advance.
Hi,
To avoid creating new topic I will put my question here.
I try to create new web service (rpc-style) client in netbeans. I have rpc plugin installed. In ejb module node I right click > new > web service client >
I fill all filds, chose rpc-style and > after clicking finish - error occur:java.lang.LinkageError: com/sun/xml/rpc/processor/generator/Names
at org.netbeans.modules.websvc.registry.util.Util.getParameterType(Util.java:856)
at org.netbeans.modules.websvc.registry.jaxrpc.WrapperClientWriter.printOperations(WrapperClientWriter.java:275)
at org.netbeans.modules.websvc.registry.jaxrpc.WrapperClientWriter.writeClass(WrapperClientWriter.java:219)
at org.netbeans.modules.websvc.registry.jaxrpc.Wsdl2Java.createWrapperClients(Wsdl2Java.java:305)
at org.netbeans.modules.websvc.registry.jaxrpc.Wsdl2Java.execute(Wsdl2Java.java:229)
at org.netbeans.modules.websvc.registry.util.Util.createWSJar(Util.java:493)
at org.netbeans.modules.websvc.registry.RegistryViewImpl.registerService(RegistryViewImpl.java:221)
at org.netbeans.modules.websvc.registry.RegistryViewImpl.registerService(RegistryViewImpl.java:159)
at org.netbeans.modules.websvc.registry.netbeans.RegisterViewImplNetBeansSide.registerService(RegisterViewImplNetBeansSide.java:91)
at org.netbeans.modules.websvc.jaxrpc.client.wizard.ClientBuilder.generate(ClientBuilder.java:330)
at org.netbeans.modules.websvc.jaxrpc.client.wizard.JaxRpcClientCreator$2.run(JaxRpcClientCreator.java:319)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
I use netbeans 6.5. In my project I choose java ee 5 as in 1.4 there is no web service client option
Any ideas?
I found some rpc tutorils for netbeans 4.0 but I wonder why it couldn't be done in netbean 6.5
Regards,
Lech
Similar Messages
-
Retrieving client ip from RPC-style web service
Hi,
I've got an rpc-style web service and I would like to log the incoming client
ip address (i.e. I need to get at the HTTPRequest object). Can this be done by
passing some kind of SOAP context parameter in the argument list of my exposed
methods? If this is not doable, is implementing SOAP message handlers the way
to to go? I would rather not do the latter, as the web service is working well
and don't want to play with my code too much.
ThanksI tried this, following the example in http://e-docs.bea.com/wls/docs70/webapp/filters.html,
but I still can't get it to work. The init() method gets called, but doFilter(ServletRequest
req, ServletResponse resp, FilterChain fc) does not. The "filter" part of my
web.xml looks like:
<filter>
<filter-name>serviceFilter</filter-name>
<filter-class>webservices.ServiceFilterImpl</filter-class>
</filter>
<filter-mapping>
<filter-name>serviceFilter</filter-name>
<url-pattern>/myPattern/myWebService</url-pattern>
</filter-mapping>
The only thing I could thing of is that maybe my url-pattern is wrong, although
this seems unlikely as my web service is able to process requests sent using
http://myWLSMachine:7001/myPattern/myWebService.
In fact, in the the WLS access.log file, I have:
[07/Oct/2002:11:51:01 -0400] "POST /myPattern/myWebService HTTP/1.0" 200 3011.
Do you know if there's something in the JAX-RPC API that I could use to get at
the client ip address? I dug through the documentation and came across something
called "ServletEndpointContext", but I'm not sure if this will do the trick.
Thanks for your time,
Danielle
"manoj cheenath" <[email protected]> wrote:
One way to do this may be to write a servlet filter
and map the filter to the URL of your service.
regards,
-manoj
"Danielle Vella" <[email protected]> wrote in message
news:[email protected]..
Hi,
I've got an rpc-style web service and I would like to log the incomingclient
ip address (i.e. I need to get at the HTTPRequest object). Can thisbe
done by
passing some kind of SOAP context parameter in the argument list ofmy
exposed
methods? If this is not doable, is implementing SOAP message handlersthe
way
to to go? I would rather not do the latter, as the web service isworking
well
and don't want to play with my code too much.
Thanks -
Hi,
Has anyone tried (and maybe succeeded) in accessing an
RPC-style Web Service deployed on WebLogic Server 6.1 using
SSL? I have a Web Service deployed and am able to access it using JNDI and the
weblogic.soap.http.SoapInitialContextFactory
INITIAL_CONTEXT_FACTORY. However, when I try to set the
Context.SECURITY_PROTOCOL to "ssl" and access the secure port,
I get a "java.net.SocketException: Unexpected end of file from
the server" error message.
Does the weblogic.soap.http.SoapInitialContextFactory not
support SSL? Do I need to do the SOAP/XML messaging myself,
without being able to make use of the WebLogic convenience
classes? Thanks! RobAlright!
Glad you got it working ;-)
Actually, the problem with the protocol being hardcoded to http in the wsdl.jsp,
is a bit strange. It's unusual that the BEA engineers that coded the wsgen component
and support classes, didn't use something like the following:
<soap:address location="<%= request.getScheme() + "://" + request.getServerName()
+ ":" + request.getServerPort() %>/security/examples/webservices/security/PhoneBookService"/>
I don't use wsgen too much, because I need to have more control over the J2EE
packaging. It (wsgen) is great for spitting out stuff, but not really setup for
doing Web service packaging that use classes (i.e. helper files, frameworks, etc.)
that it doesn't generate. I think they (BEA) might be looking into integrating
the Web Services assembly process with other tools like WebGain, Forte, etc. to
alleviate these types of issues.
Anyway, glad you got it working, so now you can help somebody else (time permitting,
of course) with this topic in the future!
Regards,
Mike Wooten
"Rob Nelson" <[email protected]> wrote:
>
Mike,
Thank you very much for your response! The next to
last sentence did it for me (when you mentioned checking
that the location attribute of the soap:address element
was set properly)! I noticed that when I viewed the WSDL
file via the browser (by clicking on the link in the
index.html page), I saw http://host:<unsecure_port> when
I requested it over the unsecure port, but I saw
http://host:<secure_port> when I requested the WSDL over
the secure port. Notice it did not say https!
So, I unjarred the EAR file that was generated by my
wsgen task, and then unjarred the generated WAR file
contained therein. When I looked at wsdl.jsp, I noticed
that "http" was hard-coded in the location attribute, but
that the host name and port number were dynamically
generated. So I added a scriplet to dynamically place an
"s" after "http" (if request.isSecure()) and rejarred up
the WAR and EAR files.
Now when I deployed the EAR file, I see "https" when
I request the WSDL over the secure port, and my client
(actually your client;) works! Awesome! I really appreciate
your help! Now my only issue is why did the wsdl.jsp have
"http" hard-coded, not accounting for secure requests.
These files were generated by the WSGEN task in ANT.
I figure it's either: I have a configuration problem,
I have a problem with my ANT build script, my version of
WebLogic Server (6.1 w/SP1 built 9/18/2001) has a bug, or
maybe you just have to manually go in and modify the wsdl.jsp
file if you want to use https :(. Please let me know if
you have any insight on this, and I will also follow up
with WebLogic support. Thanks again! Rob
"Michael Wooten" <[email protected]> wrote:
Hi Rob,
I am absolutely sure the code I posted works, so we need to approach
this from
a different angle ;-)
First, I know why the Context.SECURITY_PROTOCOL approach doesn't works.
It's because
the namespace in the Web Services code examples is not the same oneas
the one
used for RMI objects, EJBs, JDBC Data Sources, etc. For those objects,
the Context.PROVIDER_URL
is something like "t3://localhost:7001", and the INITIAL_CONTEXT_FACTORY
is "weblogic.jndi.WLInitialContextFactory".
The one being used with WebLogic Web Services, is mainly just functioning
as a
mechanism for manufacturing WebServiceProxy objects, because it is a
non-instanciable!
It does this by using a subclass of javax.naming.Context called SOAPContext,
which
is completely hidden from you, but also doesn't do much except implement
the lookup()
method. The implementation of this method ignores the Context.SECURITY_URL
property,
but it does pay attention to the "java.naming.security.principal" and
"java.naming.security.credentials"
properties. You don't need these properties for SSL, just Basic Authentication.
Enough about that, though. The service end-point is a servlet right?
So this means
it has a URL that begins with http or https, which in turn means the
WebLogic
servlet engine gets the SOAP request and sends it to the StatelessSessionAdapter
servlet. To WLS, this is just like any other HTTP/HTTPS request sent
to it ;-)
There is no special "SOAP-related" HTTP/HTTPS handler in WLS, but the
SSL challenge
dance still happens. So my first question is, are you sure you havethe
HTTPS
attributes set properly in the WebLogic console. SSL/HTTPS should be
enabled and
the "Hostname Verification Ignored" checkbox should be checked. Next,
are you
sure the URL assigned to the location attribute of the <service> element
in the
WSDL is correct (i.e. https://localhost:7002)? Are you using the "dynamic
client"
approach?
Regards,
Mike Wooten
"Rob Nelson" <[email protected]> wrote:
Mike,
Thanks for your response. I downloaded the code example that
you
posted
last week, as well as the code example that you posted in October for
a similar
request (BEA Support pointed me towards that). Unfortunately, I still
can't get
the Web Service to respond to the client request when the client uses
the HTTPS
port for the WebLogic Server.
I tried two different client approaches. The first uses the client
code
that you posted in October, the WebServiceProxy approach. The second
approach
is based on the example in the WebLogic documentation, which uses the
weblogic.soap.SoapInitialContextFactory
class with the javax.naming.Context object to perform a lookup on the
service
(which closely resembles rmi without the narrowing).
Both client classes fail to invoke the the service itself viaHTTPS
(although
they both work when making HTTP requests to the unsecure port). However,
when
I run the client based on the client class that you posted in October
and make
an HTTPS request, I can see in the output where it is able to download
the WSDL
file and use it (via the WebServiceProxy) to describe the availablemethods
for
the associated Web Service. It is only when the actual invoke() method
is called
on the SoapMethod object (which in turn sends the XML request to the
Web Service
Servlet), that the server doesn't respond, and the client fails with
an UnexpectedEndOfFileException
(i.e. no response).
So, do you know why the servlet that the RPC-style Web Serviceuses
to handle
requests would not respond to HTTPS requests, when it processes HTTP
requests
without a problem (using the same client code that fails with the HTTPS
request)?
I am using WebLogic Server 6.1 w/SP1 on a Solaris 8 platform. Thanks
for any
advice you can give me! Rob
"Michael Wooten" <[email protected]> wrote:
Hi Rob,
Check out the attached zip for "insights" into how to do this. It
contains
the
code for two Web service "consumers" (that the new fangled word fora
"client")
and the web.xml and weblogic.xml for the RPC-style Web Service, that
they consume.
Hope this helps,
Mike Wooten
"Rob Nelson" <[email protected]> wrote:
Hi,
Has anyone tried (and maybe succeeded) in accessing an
RPC-style Web Service deployed on WebLogic Server 6.1 using
SSL? I have a Web Service deployed and am able to access it using
JNDI
and the
weblogic.soap.http.SoapInitialContextFactory
INITIAL_CONTEXT_FACTORY. However, when I try to set the
Context.SECURITY_PROTOCOL to "ssl" and access the secure port,
I get a "java.net.SocketException: Unexpected end of file from
the server" error message.
Does the weblogic.soap.http.SoapInitialContextFactory not
support SSL? Do I need to do the SOAP/XML messaging myself,
without being able to make use of the WebLogic convenience
classes? Thanks! Rob -
ANT task wsgen error while deploying RPC style web service
Hi
I am trying to assemble/deploy an rpc style weblogic web service using the 'wsgen'
Ant task and the build.xml scripts provided with the samples. I get this error:
Please help
Thanks,
Praveen
C:\test>ant
Buildfile: build.xml
webservice:
clean:
[delete] Deleting directory C:\test\build
init:
[mkdir] Created dir: C:\test\build
[mkdir] Created dir: C:\test\build\META-INF
[copy] Copying 5 files to C:\test\build\META-INF
compile_ejb:
[javac] Compiling 5 source files to C:\test\build
jar_ejb:
[jar] Building jar: C:\test\a_statelessSession.jar
ejbc:
all:
wsgen:
Error at line:8 col:12 ':' Already got a ':' in name
at weblogic.xml.babel.baseparser.SAXElementFactory.createSAXParseExc
on(SAXElementFactory.java:60)
at weblogic.xml.babel.parsers.StreamParser.<init>(StreamParser.java:
at weblogic.xml.babel.parsers.BabelXMLEventStream.startDocument(Babe
EventStream.java:28)
at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:6
at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:5
at weblogic.soap.WebServiceProxy.getServiceFrom(WebServiceProxy.java
at weblogic.ant.taskdefs.ejb.WSGenHelper.writeClientJar(WSGenHelper.
:1125)
at weblogic.ant.taskdefs.ejb.WSGenHelper.writeWSDL(WSGenHelper.java:
at weblogic.ant.taskdefs.ejb.WSGenHelper.saveDescriptors(WSGenHelper
a:1415)
at weblogic.ant.taskdefs.ejb.WSGenHelper.output(WSGenHelper.java:148
at weblogic.ant.taskdefs.ejb.WSGenHelper.doit(WSGenHelper.java:1517)
at weblogic.ant.taskdefs.ejb.WSGen.execute(WSGen.java:93)
at org.apache.tools.ant.Target.execute(Target.java:153)
at org.apache.tools.ant.Project.runTarget(Project.java:898)
at org.apache.tools.ant.Project.executeTarget(Project.java:536)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:213)
at org.apache.tools.ant.Target.execute(Target.java:153)
at org.apache.tools.ant.Project.runTarget(Project.java:898)
at org.apache.tools.ant.Project.executeTarget(Project.java:536)
at org.apache.tools.ant.Project.executeTargets(Project.java:510)
at org.apache.tools.ant.Main.runBuild(Main.java:421)
at org.apache.tools.ant.Main.main(Main.java:149)
BUILD SUCCESSFUL
Total time: 34 seconds
C:\test>WLS6.1, service pack 2? I didn't know there were any service packs for 6.1 and
6.0 didn't support wsgen and web services??
simon.
manoj cheenath <[email protected]> wrote:
>
>
This is a known bug which is fixed in WLS 6.1 SP2.
The workaround is to change the complex data types
to have more than one level package names.
for eg: change ....
package foo;
class Data{}
to :
package foo.bar;
class Data{}
-manoj
Praveen wrote:
Hi
I am trying to assemble/deploy an rpc style weblogic web service usingthe 'wsgen'
Ant task and the build.xml scripts provided with the samples. I getthis error:
Please help
Thanks,
Praveen
C:\test>ant
Buildfile: build.xml
webservice:
clean:
[delete] Deleting directory C:\test\build
init:
[mkdir] Created dir: C:\test\build
[mkdir] Created dir: C:\test\build\META-INF
[copy] Copying 5 files to C:\test\build\META-INF
compile_ejb:
[javac] Compiling 5 source files to C:\test\build
jar_ejb:
[jar] Building jar: C:\test\a_statelessSession.jar
ejbc:
all:
wsgen:
Error at line:8 col:12 ':' Already got a ':' in name
at weblogic.xml.babel.baseparser.SAXElementFactory.createSAXParseExc
on(SAXElementFactory.java:60)
at weblogic.xml.babel.parsers.StreamParser.<init>(StreamParser.java:
at weblogic.xml.babel.parsers.BabelXMLEventStream.startDocument(Babe
EventStream.java:28)
at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:6
at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:5
at weblogic.soap.WebServiceProxy.getServiceFrom(WebServiceProxy.java
at weblogic.ant.taskdefs.ejb.WSGenHelper.writeClientJar(WSGenHelper.
:1125)
at weblogic.ant.taskdefs.ejb.WSGenHelper.writeWSDL(WSGenHelper.java:
at weblogic.ant.taskdefs.ejb.WSGenHelper.saveDescriptors(WSGenHelper
a:1415)
at weblogic.ant.taskdefs.ejb.WSGenHelper.output(WSGenHelper.java:148
at weblogic.ant.taskdefs.ejb.WSGenHelper.doit(WSGenHelper.java:1517)
at weblogic.ant.taskdefs.ejb.WSGen.execute(WSGen.java:93)
at org.apache.tools.ant.Target.execute(Target.java:153)
at org.apache.tools.ant.Project.runTarget(Project.java:898)
at org.apache.tools.ant.Project.executeTarget(Project.java:536)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:213)
at org.apache.tools.ant.Target.execute(Target.java:153)
at org.apache.tools.ant.Project.runTarget(Project.java:898)
at org.apache.tools.ant.Project.executeTarget(Project.java:536)
at org.apache.tools.ant.Project.executeTargets(Project.java:510)
at org.apache.tools.ant.Main.runBuild(Main.java:421)
at org.apache.tools.ant.Main.main(Main.java:149)
BUILD SUCCESSFUL
Total time: 34 seconds
C:\test>
-----------------------------------------------------------------<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
This is a known bug which is fixed in WLS 6.1 SP2.
<p>The workaround is to change the complex data types
<br>to have more than one level package names.
<p>for eg: change ....
<p><font color="#3366FF">package foo;</font>
<br>class Data{}
<p>to :
<p><font color="#3333FF">package foo.bar;</font>
<br>class Data{}
<p>-manoj
<p>Praveen wrote:
<blockquote TYPE=CITE>Hi
<br>I am trying to assemble/deploy an rpc style weblogic web service
using
the 'wsgen'
<br>Ant task and the build.xml scripts provided with the samples. I get
this error:
<br>Please help
<br>Thanks,
<br>Praveen
<br>-----------------------------------------------------------------
<br>C:\test>ant
<br>Buildfile: build.xml
<p>webservice:
<p>clean:
<br> [delete] Deleting directory C:\test\build
<p>init:
<br> [mkdir] Created dir: C:\test\build
<br> [mkdir] Created dir: C:\test\build\META-INF
<br> [copy] Copying 5 files to C:\test\build\META-INF
<p>compile_ejb:
<br> [javac] Compiling 5 source files to C:\test\build
<p>jar_ejb:
<br> [jar] Building jar: C:\test\a_statelessSession.jar
<p>ejbc:
<p>all:
<p>wsgen:
<br>Error at line:8 col:12 ':' Already got a ':' in name
<br> at weblogic.xml.babel.baseparser.SAXElementFactory.createSAXParseExc
<br>on(SAXElementFactory.java:60)
<br> at weblogic.xml.babel.parsers.StreamParser.<init>(StreamParser.java:
<br> at weblogic.xml.babel.parsers.BabelXMLEventStream.startDocument(Babe
<br>EventStream.java:28)
<br> at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:6
<br> at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:5
<br> at weblogic.soap.WebServiceProxy.getServiceFrom(WebServiceProxy.java
<br>)
<br> at weblogic.ant.taskdefs.ejb.WSGenHelper.writeClientJar(WSGenHelper.
<br>:1125)
<br> at weblogic.ant.taskdefs.ejb.WSGenHelper.writeWSDL(WSGenHelper.java:
<br>)
<br> at weblogic.ant.taskdefs.ejb.WSGenHelper.saveDescriptors(WSGenHelper
<br>a:1415)
<br> at weblogic.ant.taskdefs.ejb.WSGenHelper.output(WSGenHelper.java:148
<br> at weblogic.ant.taskdefs.ejb.WSGenHelper.doit(WSGenHelper.java:1517)
<br> at weblogic.ant.taskdefs.ejb.WSGen.execute(WSGen.java:93)
<br> at org.apache.tools.ant.Target.execute(Target.java:153)
<br> at org.apache.tools.ant.Project.runTarget(Project.java:898)
<br> at org.apache.tools.ant.Project.executeTarget(Project.java:536)
<br> at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:213)
<br> at org.apache.tools.ant.Target.execute(Target.java:153)
<br> at org.apache.tools.ant.Project.runTarget(Project.java:898)
<br> at org.apache.tools.ant.Project.executeTarget(Project.java:536)
<br> at org.apache.tools.ant.Project.executeTargets(Project.java:510)
<br> at org.apache.tools.ant.Main.runBuild(Main.java:421)
<br> at org.apache.tools.ant.Main.main(Main.java:149)
<p>BUILD SUCCESSFUL
<p>Total time: 34 seconds
<p>C:\test>
<br>-----------------------------------------------------------------</blockquote>
</html> -
Runtime error with doc/lit style web services
I've written a web service client (wrapped doc/lit style) and when I try to invoke the service, I get the following runtime error. I see some have reported the same error before and I don't see a resolution for the issue. Any help to resolve the issue is appreciated.
My environment:
Standalone web service client
JARs used from JDEV 10.1.2
Java 1.4.2
I verified there are no duplicate implementations of the DOM Parser; I just use xmlparserv2.jar
Exception in thread "main" java.lang.AbstractMethodError: oracle.xml.parser.v2.X
MLElement.getNamespaceURI()Ljava/lang/String;
at org.apache.soap.util.xml.DOM2Writer.print(DOM2Writer.java:139)
at org.apache.soap.util.xml.DOM2Writer.serializeAsXML(DOM2Writer.java:98
at org.apache.soap.Utils.marshallNode(Utils.java:109)
at org.apache.soap.Body.marshall(Body.java:165)
at org.apache.soap.Envelope.marshall(Envelope.java:203)
at org.apache.soap.Envelope.marshall(Envelope.java:161)
at oracle.soap.transport.http.OracleSOAPHTTPConnection.send(OracleSOAPHT
TPConnection.java:664)
at org.apache.soap.messaging.Message.send(Message.java:125)
at emgateway.main.EMWSStub.sendRequest(EMWSStub.java:106)Hi John,
Yes this is certainly possible. The role of client, server and service
gets blurred when dealing with multiple web services. For an example,
you can take a look at the work done by WS-I for the sample application
[1], where multiple types of web services communicate with each other.
Regards,
Bruce
[1]
http://www.ws-i.org/SampleApplications/SupplyChainManagement/2003-12/SCMArchitecture1.01.pdf
John Meiser wrote:
>
Can a doc-style Web Service invoke an RPC-Style Web Service? I know that we cannot
mix RPC with Doc-style in the same Service, but I was wondering if RPC and Doc-style
can call each other.
Thanks,
John -
Can a doc-style Web Service invoke an RPC-Style Web Service? I know that we cannot
mix RPC with Doc-style in the same Service, but I was wondering if RPC and Doc-style
can call each other.
Thanks,
JohnHi John,
Yes this is certainly possible. The role of client, server and service
gets blurred when dealing with multiple web services. For an example,
you can take a look at the work done by WS-I for the sample application
[1], where multiple types of web services communicate with each other.
Regards,
Bruce
[1]
http://www.ws-i.org/SampleApplications/SupplyChainManagement/2003-12/SCMArchitecture1.01.pdf
John Meiser wrote:
>
Can a doc-style Web Service invoke an RPC-Style Web Service? I know that we cannot
mix RPC with Doc-style in the same Service, but I was wondering if RPC and Doc-style
can call each other.
Thanks,
John -
Trouble Communicating with Document-Style Web Service
I have a flash app that currently communicates with a
RPC-style web service. I changed the web service to be
document-style, and the flash app no longer sends valid requests. I
was under the impression that one could simple swtich styles, and
flash would play along. Apparently, this is not the case. Does
anyone have an insight in this area?Clarified with Partick Calahan, who is maintaining this tool.
Currently, doc style is not handled by this tool. I guess it will be
supported in the future.
Thanks.
"Karthik V" <[email protected]> wrote in message
news:[email protected]..
I'm using WebLogic Webservice Explorer v.02 (WEX).
I'm able to test rpc style web services without any problem.
But whenever I try to open a document style web service WSDL, I get the
following exception.
I would appreciate if you have any suggestions for the to over come this
issue.
java.lang.IllegalArgumentException at
weblogic.webservice.tools.wex.MessagePanel.<init>(MessagePanel.java:33)at
>
weblogic.webservice.tools.wex.ServicePanel.operationChanged(ServicePanel.jav
a:153) at
weblogic.webservice.tools.wex.ServicePanel.portChanged(ServicePanel.java:133
) at
weblogic.webservice.tools.wex.ServicePanel.serviceChanged(ServicePanel.java:
121) at
weblogic.webservice.tools.wex.ServicePanel.<init>(ServicePanel.java:69)at
>
weblogic.webservice.tools.wex.tasks.FetchWsdlTask.perform(FetchWsdlTask.java
:45) at
weblogic.webservice.tools.wex.tasks.TaskQueue.run(TaskQueue.java:47) at
java.lang.Thread.run(Unknown Source) -
Document style Web Service the standard?
Hi,
A colleague of mine just told me that we should not be building RPC style web services since document style are the standard now. Is this true? I couldn't find any such phrase in WS-I BP 1.0.
If this is not true then is it even a possiblity that in future Document style will be the standard?
Thanks, Sid.In this context I think your friend is using 'standard' to mean 'reasonably common and quite trendy at the moment'.
RPC based WS was a bad idea in because it destroys some of the loose coupling you gain using WS rather than say, CORBA, which is the number three reason for using WS. (number one being your boss spent lots of money on the tools and would look silly if you don't use them, and number two being WS tunnelling through firewalls).
Pete -
Can XI handle RPC based web services ?
Is it possible with XI 3.0 to work with RPC based webservices rather than Document based services.
If it can, can some one send me sample configuration for SOAP Receiver and SOAP Sender.
I have successfully configured an SOAP Receiver to access external web service on internet which is a document based but I am having difficulty in accessing rpc based webservice on intranet.
We are on XI 3.0 SP 14. Appreciate your comments on this topic.
Thanks
PrasadHi John!
> Is using RPC style web services supported out of the
> box within XI? I have read some forums that suggest
> only document style are and would like a definitive
> answer.
I have opened an OSS message regarding this topic and I was told that RPC-style Web Services are not supported within the XI SOAP adapter. Our current workaround which adds the missing Web Service operation using an additional XSLT mapping is not sufficient. Instead we have to change our WSDL from RPC-style into document-literal style.
Regards, Tanja -
DII client for accessing a document style web service
Hi All,
I try to access a document style web service using DII JAX-RPC client and used the wscompile tool to produce wrapper classes .
The following code I used for my work:
import java.rmi.RemoteException;
import javax.xml.namespace.QName;
import javax.xml.rpc.Call;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.encoding.XMLType;
import javax.xml.rpc.ParameterMode;
import java.net.URL;
import nutrient.*;
public class NuDII{
private static String endpoint =
"http://www.strikeiron.com/webservices/usdadata.asmx?wsdl";
private static String qnameService = "USDAData";
private static String qnamePort = "USDADataSoap";
private static String BODY_NAMESPACE_VALUE =
"http://www.strikeiron.com/";
private static String ENCODING_STYLE_PROPERTY =
"javax.xml.rpc.encodingstyle.namespace.uri";
private static String NS_XSD =
"http://www.w3.org/2001/XMLSchema";
private static String URI_ENCODING =
"http://schemas.xmlsoap.org/soap/encoding/";
private static String TYPE_NAMESPACE_VALUE =
"http://www.strikeiron.com/";
private static QName returnType = new QName(NS_XSD, "string");
public static void main(String[] args) {
try {
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(new QName(BODY_NAMESPACE_VALUE,qnameService));
QName port = new QName(BODY_NAMESPACE_VALUE,qnamePort);
QName operation = new QName(BODY_NAMESPACE_VALUE,"SearchFoodByDescription");
Call call = service.createCall(port,operation);
call.setTargetEndpointAddress(endpoint);
call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
call.setProperty(Call.SOAPACTION_URI_PROPERTY,"http://www.strikeiron.com/SearchFoodByDescription");
call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY,"");
call.setProperty(Call.OPERATION_STYLE_PROPERTY, "document");
QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
QName REQUEST_QNAME = new QName(TYPE_NAMESPACE_VALUE,"SearchFoodByDescription");
QName RESPONSE_QNAME = new QName(TYPE_NAMESPACE_VALUE, "SearchFoodByDescriptionResponse");
call.setReturnType(RESPONSE_QNAME, nutrient.SearchFoodByDescriptionResponse.class);
//call.setReturnType(stringArray);
call.setOperationName(new QName(BODY_NAMESPACE_VALUE,"SearchFoodByDescription"));
call.addParameter("FoodKeywords", REQUEST_QNAME,nutrient.SearchFoodByDescription.class,ParameterMode.IN);
call.addParameter("FoodGroupCode", REQUEST_QNAME, nutrient.SearchFoodByDescription.class,ParameterMode.IN);
SearchFoodByDescription sfd = new SearchFoodByDescription("BabyFoods","1900");
//Object[] params = new Object[2];
//params[0]= new String("BabyFoods");
//params[1]= new String("1900");try
Object[] params = {sfd};
Object result = call.invoke(params);
System.out.println(result);
} catch (Exception ex) {
ex.printStackTrace();
when I start to execute the client I got the following error:
java.rmi.RemoteException: Server was unable to process request. --> Object refer
ence not set to an instance of an object.
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:462)
at NuDII.main(NuDII.java:68)
Shall any body assist me to solve problem.you may have a little better luck in the JNI forum.
-
XML Parser Error while creating Web service Client using JAX RPC
hello evryone,
Im facing XML Parser Error while creating web service client using JAX RPC. Im using Net Beans IDE for development purpose. I have wrote configuration file for client. Now i want to create Client stub. However i dont know how to do this in Net Beans. So i tried to do it from Command promt using command :
wscompile -gen:client -d build -classpath build config-wsdl.xml
here im getting Error:
error parsing configuration file: XML parsing error: com.sun.xml.rpc.sp.ParseException:10: XML declaration may only begin entities
Please help me out.
Many thanks in advance,
KaceeCan i use the client generated using jdeveloper 11g to import into the oracle forms 10g, i.e., form builder 10g. Currently this is the version we have in our office.
-
Using message-style web service by a Microsoft client
Does anyone have a sample Microsoft client using message-style web service? BEA
does not provide one. I found MS client does not receive messages published between
2 calls to method "receive", while the sample Java client ConsumerClient.java
does.
ConsumerClient.java is like:
while(true){
Object result = method.invoke(null);
sleep(20000); // not in sample, added for my test
System.out.println(result);
My VBScript code is like:
Set SC = CreateObject("MSSOAP.SoapClient")
SC.mssoapinit "http://localhost:7001/msg/Receiver/Receiver.wsdl", "", "", ""
While TRUE
Res = SC.receive
WScript.echo "Res = " & Res
Res = ""
' do something that takes 20 seconds
Wend
I added 20 seconds between calls so I can publish a message between 2 calls. I
found the Java client receives the message but the VBScript client doesn't. Has
anyone else observed this?Hi Kevin,
Thanks for your feedback.
Header support is planed for the next major release.
regards,
-manoj
Kevin Jiang wrote:
Hi Manoj,
Can you use SOAP header to pass session id accross instead of HTTP header? MS
SOAP toolkit 2.0 support access to SOAP header.
My app needs to use topic instead of queue. But as I said earlier, I can use MS
XML toolkit to access HTTP header. So I have a work around.
Thanks for all your responses with regard to this question!
Kevin
manoj cheenath <[email protected]> wrote:
Hum! i thought you were not able to receive message at all. now
i understood the problem. yes we are using http header to pass
session id accross, in the case of web service client who wants
to subscribe to JMS topics. I cant think of any other way to do
this. if you have any suggestions, i very much like to hear it.
for your application is it possible to use queues instead of topics?
we do not use http session information in the case of JMS queues.
-manoj
Kevin Jiang wrote:
Hi Manoj,
Your sample code is basically same as mine. It would also lose messagespublished
between calls to "receive" method.
I figured out what's going on. Undocumented by BEA, the web servicesends JMS
session ID in HTTP header along with first message. When client makessubsequent
calls to "receive", this ID must be sent back. I found this by usinga SOAP trace
tool.
Unfortunately, MS SOAP toolkit doesn't support access to HTTP header.So one has
to use MS XML toolkit to use message-style web service, when writingMS clients.
manoj cheenath <[email protected]> wrote:
an example of using message style web services with
ms soap toolkit is attached. let me know if this works
for you.
regards,
-manoj
Kevin Jiang wrote:
Hi Manoj,
I just changed anyType to string and the problem still happens.
Thanks,
Kevin
manoj cheenath <[email protected]> wrote:
I have not tryed message style web services with MS soap toolkit.
I think the problem is because the WSDL for the message style
web service use xsd:anyType as the return type and MS soap is
not able to understand it. can you pls modify the xsd:anyType to
xsd:string (or someother base type) in the WSDL.
SC.mssoapinit can load wsdl stored as a local file. so it should
be easy to make this change.
regards,
-manoj
Kevin Jiang wrote:
Does anyone have a sample Microsoft client using message-style
web
service? BEA
does not provide one. I found MS client does not receive messages
published
between
2 calls to method "receive", while the sample Java client ConsumerClient.java
does.
ConsumerClient.java is like:
while(true){
Object result = method.invoke(null);
sleep(20000); // not in sample, added for my test
System.out.println(result);
My VBScript code is like:
Set SC = CreateObject("MSSOAP.SoapClient")
SC.mssoapinit "http://localhost:7001/msg/Receiver/Receiver.wsdl",
While TRUE
Res = SC.receive
WScript.echo "Res = " & Res
Res = ""
' do something that takes 20 seconds
Wend
I added 20 seconds between calls so I can publish a message between2 calls. I
found the Java client receives the message but the VBScript clientdoesn't. Has
anyone else observed this? -
Document Style web service in process - Please Help
All,
I have created a simple Document-oriented web service and deployed to a standalone OC4J container using the following code:
********************* Interface ***********************
import org.w3c.dom.*;
interface PrimeNumberService
//method to check the primality of the number passed in Element variable
public Element isPrime(Element e) ;
******************** Implementation *******************
@version 1.0
Development Environment : Oracle9i JDeveloper
Name of the File : PrimeNumberServiceImpl.java
Creation/Modification History :
13-Apr-2002 Created
Overview:
This class file defines methods to implement PrimeNumberWebService.
The method isPrime() is exposed by the Web Service.
import org.w3c.dom.*;
import oracle.xml.parser.v2.*;
import java.io.*;
public class PrimeNumberServiceImpl implements PrimeNumberService
public PrimeNumberServiceImpl()
* This method is exposed by the Web Service to check if the number is
* prime. It extracts the number for input element and checks if it is
* prime or not and return the output in the XML Element.
* The input element is of the form <number>23</number>
public Element isPrime(Element e)
// define an XML Element that will be returned to the client
Element processedEl=null;
try{
// get the first clild of input element
Node enode = e.getFirstChild();
//get the value of input element and parse it
String value= enode.getNodeValue();
double number = Double.parseDouble(value);
String answer=null;
// check if the input number is prime
answer = checkPrime(number);
// create element from the answer
processedEl =createElement(answer);
}catch(Exception ex){
ex.printStackTrace();
return null;
// return output to client
return processedEl;
* This method creates an XML element from the input string values and return it
* The Element is of the form <answer>value</answer>
private Element createElement(String value){
// create a Document object
Document xmldoc = new XMLDocument();
// create an element with name "answer"
Element e1 = xmldoc.createElement("answer");
// append the element to document object
xmldoc.appendChild(e1);
// create a Text object from input values and append it to above element
Text t = xmldoc.createTextNode(value);
e1.appendChild(t);
return (Element)xmldoc.getFirstChild();
* This method check if the input number is prime or not
private String checkPrime(double num){
//For a prime number mod(power(2,number),number) is equal to 2
if ( Math.IEEEremainder( Math.pow(2.0,num) ,num)==2){
System.out.println ("the number is: " + num);
return "The number " + num + " is prime";}
else{
System.out.println ("the number is: " + num);
return "The number " + num + " is not prime";}
************************ Generated WSDL ***************
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="PrimeNumberService"
targetNamespace="http://tempuri.org/PrimeNumberService.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://tempuri.org/PrimeNumberService.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" >
<documentation>
WSDL for Service: PrimeNumberService, generated by Oracle WSDL toolkit (version: 1.1)
</documentation>
<types>
<schema targetNamespace="http://tempuri.org/PrimeNumberService.xsd" xmlns:tns="http://tempuri.org/PrimeNumberService.xsd" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
</types>
<message name="isPrimeOutput">
<part name="return" element="xsd:any"/>
</message>
<message name="isPrimeInput">
<part name="param0" element="xsd:any"/>
</message>
<portType name="PrimeNumberServicePortType">
<operation name="isPrime">
<input message="tns:isPrimeInput"/>
<output message="tns:isPrimeOutput"/>
</operation>
</portType>
<binding name="PrimeNumberServiceBinding" type="tns:PrimeNumberServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<operation name="isPrime">
<soap:operation soapAction="urn:PrimeNumberService/isPrime"/>
<input>
<soap:body use="literal" namespace="urn:PrimeNumberService"/>
</input>
<output>
<soap:body use="literal" namespace="urn:PrimeNumberService"/>
</output>
</operation>
</binding>
<service name="PrimeNumberService">
<port name="PrimeNumberServicePort" binding="tns:PrimeNumberServiceBinding">
<soap:address location="http://hp-xeon-01:9799/primenumberws/primenumberService"/>
</port>
</service>
</definitions>
I get the following error when trying to deploy:
Error:
[Error ORABPEL-10902]: compilation failed
[Description]: XML parsing failed because "undefined part element.
In WSDL at "http://hp-xeon-01:9799/primenumberws/primenumberService?WSDL", message part element "{http://www.w3.org/2001/XMLSchema}any" is not defined in any of the schemas.
Please make sure the spelling of the element QName is correct and the WSDL import is complete.
[Potential fix]: n/a.
Please let me know what I'm doing wrong.
Regards,
JeffI think this thread is duplicate of "Document style web service receive and send org.w3c.Element" message thread.
- Rakesh -
'Payload not Serializable' with custom WSDL data types in message-style web service
I'm implementing a message-style web service which publishes to a JMS Queue.
I had the web service built and deployed, but noticed that the "sendRequest" message's
part was of type "xsd:anyType." This is not specific enough for our interface,
since it is externally facing and needs to describe the object we're expecting
on the back end.
So I replaced xsd:anyType with mynamespace:MyType, which is defined as a complex
type in the same WSDL document.
My problem is that when I test the web service with the new WSDL (using the client.jar),
I get a server-side exception from the DestinationSendAdapter.doPost() method.
The exception reads:
javax.servlet.ServletException: Payload not Serializable
at weblogic.soap.server.servlet.DestinationSendAdapter.doPost(DestinationSendAdapter.java:129)
The domain object ('classic' JavaBean) that it should map to on the server side
extends a class that implements Serializable, so it should inherit the trait.
So my questions are:
1) Did I properly go about trying to restrict the object type that gets sent to
my Destination?
2) If no, what is the correct way? If yes, why am I receiving the Payload not
Serializable error if the domain object implements Serializable?
Thanks in advance.Resolved:
Apparently this is the right approach, as it boiled down to a classpath issue
on the client-side. Thanks anyway. -
How to prevent downloading wsdl in weblogic web service client
Hi,
I get a problem regarding weblogic web service client. My working environment:
weblogic server 8.1
Windows XP SP2
JDK 1.4
I use the weblogic tool to generate the client jar file from the wsdl file.
<target name="generate-client">
<clientgen wsdl="ACCESS.wsdl"
packageName="xxxxxx.client"
clientJar="${client}/${AccessClient_jar_file}"
keepGenerated="true"
saveWSDL="true"
/>
<javac srcdir="${source}"
destdir="${client}"
includes="**/AccessClient.java">
<classpath>
<pathelement path="${client}/${AccessClient_jar_file}"/>
</classpath>
</javac>
</target>
After that, I create a client java file to invoke the service deploy in the server.
public static void main(String[] argv)
throws Exception
int transactionId = 100;
int id = 1000;
// Setup the global JAXM message factory
System.setProperty("javax.xml.soap.MessageFactory", "weblogic.webservice.core.soap.MessageFactoryImpl");
// Setup the global JAX-RPC service factory
System.setProperty( "javax.xml.rpc.ServiceFactory", "weblogic.webservice.core.rpc.ServiceFactoryImpl");
AccessServicePorts ws = new AccessServicePorts_Impl(argv[0]);
AccessService port = ws.getAccessService();
// Resource - create
Resource resource = new Resource();
resource.setRES_CD("Create ResCo");
resource.setCODE_CODE("code_cod");
resource.setRES_TYPE("Resource typ");
resource.setCOMMON_FIELD(common);
AccessDefaultResult resultItems = port.createResource(resource);
System.out.println("createResource : " + resultItems);
I find that this web service client always issue 2 http requests to invoke an web service method deployed in server.
1st http reqeust:
GET /AccessEpol/EpolServiceSoap?WSDL HTTP/1.1
User-Agent: Java/1.4.2_08
Host: 127.0.0.1:8001
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
the return result is the wsdl downloaded from the server.
2nd http request is the real web service request.
The question is how could I eliminate the 1st http request because it's really unnecessary. I use other web service client like Axis 1.x, Axis client never has the http request to download the wsdl from the server.
I read through weblogic web service document. It do mentions that put saveWSDL="true" in the clientgen ant task. the default value for saveWSDL is true already. I did try saveWSDL="false" also. None of them can eliminate the 1st http request.
appreciate for any answer my question?Hi David,
thanks for the reply.
More or less I agree some points you mentioned above.
I did use Axis 1.x to test the inter-operability. The web service was developed in Weblogic 8.1 and is a part of an existing web application. It will be merged to existing application deployed in weblogic 8.1.
I also program the web service client to test the web service.
The implementation of the server and client will be handed over the project team and training for supporting or continuous development have to be conducted by me. So I don't like to use two types of technologies which will make thing complex.
I found this issue when I tried to protected the web service endpoint, eg http://localhost:7001/epol/service, using the web application Basic mechanism. The wsdl URL http://localhost:7001/epol/service?WSDL is also protected in this case. Unfortunately the username/password pair is not sent to the server when the weblogic client download the WSDL from the server. In this case, the client failed and throw exception.
Maybe you are looking for
-
Why can I not get Instagram on my iPad Air?
I Have an iPad Air and I cannot get Instagram but on other iPads you can. I'm really confused on why.
-
Problem with JAXB Unmarshall - javax.xml.bind.UnmarshalException
Hi, I'm getting an expection while unmarshalling using JAXB. The error is as follows : DefaultValidationEventHandler: [ERROR]: unexpected element (uri:"http://www.etrade.com/ee/systemdomainao/search", local:"Context_Id"). Expected elements are <{}con
-
HI ALL, My alv output is getting truncated at output.How can i avoid it from truncating.Pls helpme. thanks karthik
-
Regarding my laptop display problem
hello, my laptop model no HP ENVY6 1011TU. when i start my laptop i get with 4 screen,i reststart it several times still it won't get recovered.when i do it again and again then i get with normal.plz tell me the solution This question was solved. Vie
-
I am running a very simple query against a table select * from nom_hierarchy where signf=1; This query causes a Ora-03113 error to occur. If I do a select * from nom_hierarchy where signf<>1; it works! the column signf is defined as NUMBER(1,0) not n