Returning data with a doc style web service
How does one return information using a "Document" style Web Service? WLS 8.1 restricts
you to a single "in" parameter. Do I return information by using the "return"
value from the Web Service (assuming it's synchronous)? If so, what are the restrictions
on the return value. I've read the WLS 8.1 Programming Web Services document but
it's pretty lite in the area of Document style Web Services.
Thanks.
WLS 8.1 supports two document styles:
#1 document literal
#2 document wrapped literal
In the case of #1 a web service method can only
take zero or one argument. There can be a return
type (or void). The (single) argument or return type
could be any supported type, or user defined complex
types (java beans). In #1 the dispatch is done based
on the incoming document and not based on the name
of the method. You can find an example for this at:
http://manojc.com/?sample13
In the case of #2 a web service method can have
any number of arguments. The WS container will
wrap the method in to a complexType. Here,
method name will be the name of the complexType
and arguments will be added as elements of the
complexType. In this case dispatch is done
based on the method name. An example here:
http://manojc.com/?sample14
Regards,
-manoj
"Jack Ottofaro" <[email protected]> wrote in message
news:3ea55b39$[email protected]..
>
How does one return information using a "Document" style Web Service? WLS8.1 restricts
you to a single "in" parameter. Do I return information by using the"return"
value from the Web Service (assuming it's synchronous)? If so, what arethe restrictions
on the return value. I've read the WLS 8.1 Programming Web Servicesdocument but
it's pretty lite in the area of Document style Web Services.
Thanks.
Similar Messages
-
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 -
'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. -
SwA with a doc/lit web service? 8.1sp3
For WL 8.1sp3, is it possible to do SwA using a doc/lit style web service? I'm not even sure if this makes sense, and it's not mentioned on any sites I've seen.
I'm trying to experiment how you can send binary data over XML with BEA WL 8.1sp3. It only supports SwA, which I believe can be used to send binary data at its raw size. However, I wanted to have a document-style web service.
The only examples for SwA use rpc style.If you want to send binary data (i.e. an image, a PDF file, a Word document, etc.) as opposed to an XML document, then you in essence want an RPC-style web service that has an operation that takes an javax.activation.DataHandler. You can build this web service using either the <servicegen> Ant task, or the WLW IDE (a .JWS).
Here's a link to the e-docs:
http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/getstarted/conUsingSOAPAttachments.html
The one thing wrong (or missing) with that information, is that it doesn't tell you that you have to set the soap-style needs to be set to rpc. The default is document, which won't produce the the correct client proxy jar. Actually, you won't be able to produce the client proxy jar unless you set soap-style to rpc :-)
Regards,
Mike Wooten -
Return Data from Oracle using a web service in AXIS - please help
Hi Forum,
I am very new to web services and Java tech. and recently I have been assigned to work with technology and I am struggling to learn it and need your help and assistance.
I am trying to return some data from a an oracle database but I have to do that using a web service and I am using AXIS. For example below is a simple program that returns two columns for the demo EMP table
import java.sql.*;
class emp {
public static void main(String args[])
throws ClassNotFoundException, SQLException {
Class.forName("oracle.jdbc.driver.OracleDriver");
// or you can use:
// DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott", "tiger");
Statement stmt = conn.createStatement( );
ResultSet rset = stmt.executeQuery("select * from emp");
while(rset.next( )) {
System.out.println(rset.getString(1));
System.out.println(rset.getString(2));
rset.close( );
stmt.close( );
conn.close( );
} but I do not know how to convert this into a web service.
Please help.
Thanks in advance.
Regards,
RaviThe following code returns Document. I will be calling the below function to convert my Resultset to document. In my JWS file i simply call a method with parameters. can a web service method in .jws file return Document type. It shows error will doing so. Please help me.
public static Document toDocument(ResultSet rs) throws ParserConfigurationException, SQLException
Document res_doc = null;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.newDocument();
Element results = doc.createElement("Results");
doc.appendChild(results);
ResultSetMetaData rsmd = rs.getMetaData();
int colCount = rsmd.getColumnCount();
while (rs.next())
Element row = doc.createElement("Row");
results.appendChild(row);
for (int i = 1; i <= colCount; i++)
String columnName = rsmd.getColumnName(i);
Object value = rs.getObject(i);
Element node = doc.createElement(columnName);
node.appendChild(doc.createTextNode(value.toString()));
row.appendChild(node);
return res_doc;
} -
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 -
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) -
Need help with DOC type web service
hi,
I am trying to write a simple message style ( doc type ) web service but no success so far. I have tried to search for examples but no use. I already implemented some simple RPC style web services like calculator etc and able to use them. I am more interested in the DOC type ( which sends SOAP message and receives SOAP message back). Can Anybody give me an example for implementing this type of service ( very-simple say HellowWorld ) or point me to some website . I am not able to generate the response envelope. I can write the client program which will send a SOAP Envelope to this services with one parameter NAME and the services should return Hello Name but in a SOAP envelope form. I can create a SOAP message in this Client using SOAPConnection and MessageFactory etc. Your help will be really appreciated. There is very little stuff about webservices on the internet as well on this forum.
Thanks
VinodHello kwilding2,
Thanks for the quick response and pointing to some useful websites. I downloaded the code from web service essentials BUT all the examples are using SOAP RPC calls. They create a call object and call one of the service methods and a response is returned. I am little confused about this stuff. I am looking for something which returns the response in a SOAP envelope for which i think i need to use JAXM API which I already have downloaded. I have created a client which composes a SOAP envelope using SOAPConnection and other MessageFactory classes etc and can send this SOAP envelope to a web service. In return I want the web service to give the SOAP envelope.
I have gone thru xmethods.net and picked the following stock quote request and response:
Sample Request envelope:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:getQuote xmlns:ns1="urn:xmethods-delayed-quotes" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<symbol xsi:type="xsd:string">IBM</symbol>
</ns1:getQuote>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Sample Response Envelope:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:getQuoteResponse xmlns:ns1="urn:xmethods-delayed-quotes" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:float">133.625</return>
</ns1:getQuoteResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I also want the things in this order. This webservice at xmethods just returns the price for a stock, so how they say it returns this Response Envelope. Is this Envelope something implied. I am getting more confused.
any help will be appreciated.
Thanks
Vinod -
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 -
Message driven bean and message style web service
Hi,
I'm trying to deploy a message style web service with a message driven EJB as
the receiver and am getting the following exception:
<Jan 22, 2002 10:51:06 AM PST> <Warning> <EJB> <MessageDrivenBean threw an Exception
in onMessage(). The exception was:
java.lang.ClassCastException: weblogic.jms.common.ObjectMessageImpl
java.lang.ClassCastException: weblogic.jms.common.ObjectMessageImpl
at credit.message.PostDefaultPayment.onMessage(PostDefaultPayment.java:24)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:254)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
public void onMessage(Message message) {
System.out.println("onMessage");
TextMessage textmessage = (TextMessage)message. // It is throwing
the exception on this line --looks pretty normal
Has anyone seen this before? Am I missing something?
Thanks,
TimHi Tim,
I think the problem is that you are assuming that the data type, of the message
argument to the onMessage(Message message) method in your MDB, is of type TextMessage.
I agree that this seems logical, especially since you passed "a string" to the
Message-style Web Service. However, this is not the case, because the WSDL uses
the "xsd:anyType" as the data type for any argument you pass to the send() method
;-) This maps to a java.lang.Object in the WebLogic Web Services implementation,
which is why you get the casting error. Try this instead:
public void onMessage(Message msg)
try
String msgText;
ObjectMessage objMessage = (ObjectMessage)msg;
msgText = (String)objMessage.getObject();
System.out.println("[PostDefaultPayment.onMessage(Message)] msgText=" + msgText);
System.out.println("[PostDefaultPayment.onMessage(Message)] msg.getJMSType()="
+ msg.getJMSType());
System.out.println("[PostDefaultPayment.onMessage(Message)] msg.getJMSCorrelationID()="
+ msg.getJMSCorrelationID());
System.out.println("[PostDefaultPayment.onMessage(Message)] msg.getJMSMessageID()="
+ msg.getJMSMessageID());
catch(Exception e)
e.printStackTrace();
Regards,
Mike Wooten
"Tim Uy" <[email protected]> wrote:
>
Hi,
I'm trying to deploy a message style web service with a message driven
EJB as
the receiver and am getting the following exception:
<Jan 22, 2002 10:51:06 AM PST> <Warning> <EJB> <MessageDrivenBean threw
an Exception
in onMessage(). The exception was:
java.lang.ClassCastException: weblogic.jms.common.ObjectMessageImpl
java.lang.ClassCastException: weblogic.jms.common.ObjectMessageImpl
at credit.message.PostDefaultPayment.onMessage(PostDefaultPayment.java:24)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:254)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
public void onMessage(Message message) {
System.out.println("onMessage");
TextMessage textmessage = (TextMessage)message. // It
is throwing
the exception on this line --looks pretty normal
Has anyone seen this before? Am I missing something?
Thanks,
Tim -
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 -
Problem deploying document style web service(urgent help required)
I am getting this particular exception on my browser when I am trying to view the list of services after having deployed the service. The exception and complete stack trace is follows. I have also included the portion of the WSDD file giving details about the service.
And now... Some Services
AXIS error
Sorry, something seems to have gone wrong... here are the details:
Exception - org.apache.axis.ConfigurationException: java.lang.ClassCastException
java.lang.ClassCastException
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.makeNewInstance(WSDDDeployableItem.java:302)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
at org.apache.axis.deployment.wsdd.WSDDDeployment.getHandler(WSDDDeployment.java:394)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:276)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
at org.apache.axis.deployment.wsdd.WSDDChain.makeNewInstance(WSDDChain.java:125)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
at org.apache.axis.deployment.wsdd.WSDDService.makeNewInstance(WSDDService.java:430)
at org.apache.axis.deployment.wsdd.WSDDDeployment.getDeployedServices(WSDDDeployment.java:503)
at org.apache.axis.configuration.FileProvider.getDeployedServices(FileProvider.java:296)
at org.apache.axis.transport.http.AxisServlet.reportAvailableServices(AxisServlet.java:482)
at org.apache.axis.transport.http.AxisServlet.doGet(AxisServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
at java.lang.Thread.run(Thread.java:534)
org.apache.axis.ConfigurationException: java.lang.ClassCastException
java.lang.ClassCastException
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.makeNewInstance(WSDDDeployableItem.java:302)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
at org.apache.axis.deployment.wsdd.WSDDDeployment.getHandler(WSDDDeployment.java:394)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:276)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
at org.apache.axis.deployment.wsdd.WSDDChain.makeNewInstance(WSDDChain.java:125)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
at org.apache.axis.deployment.wsdd.WSDDService.makeNewInstance(WSDDService.java:430)
at org.apache.axis.deployment.wsdd.WSDDDeployment.getDeployedServices(WSDDDeployment.java:503)
at org.apache.axis.configuration.FileProvider.getDeployedServices(FileProvider.java:296)
at org.apache.axis.transport.http.AxisServlet.reportAvailableServices(AxisServlet.java:482)
at org.apache.axis.transport.http.AxisServlet.doGet(AxisServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
at java.lang.Thread.run(Thread.java:534)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.makeNewInstance(WSDDDeployableItem.java:304)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
at org.apache.axis.deployment.wsdd.WSDDDeployment.getHandler(WSDDDeployment.java:394)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:276)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
at org.apache.axis.deployment.wsdd.WSDDChain.makeNewInstance(WSDDChain.java:125)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
at org.apache.axis.deployment.wsdd.WSDDService.makeNewInstance(WSDDService.java:430)
at org.apache.axis.deployment.wsdd.WSDDDeployment.getDeployedServices(WSDDDeployment.java:503)
at org.apache.axis.configuration.FileProvider.getDeployedServices(FileProvider.java:296)
at org.apache.axis.transport.http.AxisServlet.reportAvailableServices(AxisServlet.java:482)
at org.apache.axis.transport.http.AxisServlet.doGet(AxisServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
at java.lang.Thread.run(Thread.java:534)
The snippet from the WSDD is as follows:
<handler name="RequestHandler" type="java:com.doc.service.DataHandler"/>
<service name="AddCalcService" provider="java:MSG">
<parameter name="allowedMethods" value="*"/>
<parameter name="className" value="com.doc.service.AddCalcService"/>
<requestFlow>
<handler type="RequestHandler"/>
</requestFlow>
<responseFlow>
<handler type="RequestHandler"/>
</responseFlow>
</service>
Could someone tell what the cause of this exception and how it could be resolved.Hi Bruce,
Thanks for all the links - am trudging through them now.
-Leena
Bruce Stephens <[email protected]> wrote:
Hi Lenna,
You might take a look at the SOAPBuilders interop tests.
See: http://www.whitemesa.com/r3/interop3.html and notice the DocLit
tests.
Our endpoints are http://webservice.bea.com:7001 and the code for the
client and servers can be located here:
http://webservice.bea.com/index.html#qz40
The good folks with WS-I have spent many cycles on interop issues. You
might have a look at their work:
http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a.html
Hope this is of some value,
Bruce
leena wrote:
Hi,
I am trying to build a synchronous document-style web service, andthe bea
site doesnt seem to have much documentation on it. I have a samplewritten with
SOAPElement as the input and output of my method, no schemas, my reqand response
are anyType, but im not sure if that is the best way to go. AND, itdoesnt work
yet.
Can anyone point me to a place where i can look for information ?i am on weblogic
8.1. I would eventually also want my input/output xml to be definedby my schema.
I see in examples that DOM Documents may also be passed as parameters(inand out)
? is there any place i can read up on this and decide what the bestoption for
me is ? Also, i will be running a .Net client against this, so if thereis anything
i need to keep in mind, i would appreciate it if anyone gave me anyinfo.
Thanks in advance!
leena. -
Document Style Web Services in JDeveloper
Hi,
I have been creating Web Services in JDev using a simple java class which has the following signature:
public boolean checkUserCredentials(String username, String password, int role)
I would like to start working on more complex examples, specifically document style web services. It is my understanding that the non-wrapped document style services will return an XML type with a mapping class defined during the creation process.
Can anyone point me to a good example of creating such a service in JDeveloper? It is my understanding that such a class would have a return type of XMLDocument, is that correct? If not do I define a custom object as a return type?
I have searched on this topic, but couldn't find any good examples / documentation. Apologies if im missing something.
ThanksDev update: WSDL file seems fine. The problem is that it's for a document-bare service and, by default, the Unwrap Wrapped Parameters option on step 2 of the top-down wizard is enabled and checked. This means that we try to pick apart the input message into a series of parameters, yielding the error shown because a document-bare operation must have only one input parameter.
If the Unwrap Wrapped Parameters option is unchecked, creation of the top-down service will succeed. In future, we ought to disable the option completely for everything but document-wrapped services, as that's the only time it applies.
This is covered by bug 4630382. -
Data types supported in weblogic web service
I have used byte[] (base64) array to pass binary data using weblogic in a web service, since byte[] is a java datatype that is supported, is there a definite guideline available that byte [][] ( multi-dimensional array} is not supported in weblogic 8.1? (I have tried and failed with byte [][])
ThanksHi gchirrav ,
Multi-Dimentional array support not listed in supported Data Types in weblogic 8.1.
Go through the following link, you will find supported data types.
http://e-docs.bea.com/wls/docs81/webserv/implement.html#1054236
----Anilkumar kari -
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?
Maybe you are looking for
-
N97 memory card, help?
Below is a relisting of a current problem I have not managed to fix yet ! Hi all, I have the latest firmware installed on my N97, but after the latest upgrade (clean install was done, mass mem refromatted, hard reset, etc') On checking over the phon
-
Send picture to exe application
Hi, all I'm now doing a project which have to send picture or frame in mc to external exe application and let it save those picture into jpg or other supported format. Is this possible to make ? Regards, Mephisto
-
"What's happening today" switches to the old status
Hello, I have a client with new Lync 2013 deployment. They are telling me that for the most users "what's happening today" status switches back to something they entered a few weeks ago. Any ideas? Thank you. Thank you. Eric.
-
Hi everybody, I am a college student needing to decide between a Macbook pro Retina 13 and 15 inch. I need the computer to last at least four years and will be using it as my main computer. My main tasks involve doing some app development using Xcode
-
HT1338 I have an iMAC with OS X 10.4.11. HOw can I update the OS?
I have an iMAC with OS X 10.4.11. How can I upgrade the OS?