Socket, rmi or web services
Hi,
I am gunna use an applet to create a multi user online game. The game will be turn based (board game).
To create a connection between two clients (through a server) can anyone advise whether to use sockets, rmi or web services?
Thanks.
use the one you know best.
if you don't know any of them, it doesn't much matter. what are the advantages of each?
(1) sockets appear simple, but you have to do all the work. lowest level of all. can't go through a firewall.
(2) RMI will feel more like dealing with objects. you just call methods on objects; you don't have to know that it's a proxy. you don't need an app server for RMI. it'll be harder to go through firewalls unless you know how to do HTTP tunnelling and RMI over IIOP.
(3) Web services are XML and HTTP based. You can go through firewalls to connect to the server without a problem. Complex if you don't know Web services.
%
Similar Messages
-
RMI or Web Service to implement P2P ????
Hi mates
Actually I'm going to develop an P2P information sharing system and I'm confused whether I use RMI or Web Service to implement this system.
I'll relay on XML document to be sent among peers .
could you help me please to select on of those two methods : RMI or Web Service .
for Web Service : Do I have to install Tomcat server in each peer ?
Thanks a lot .
Yasseenyasseen wrote:
Are you sure ?
I get myself ready to use Web service to implement my system but you shocked me !Yes, I'm sure. (see Wiki [*Peer-to-peer*|http://en.wikipedia.org/wiki/Peer-to-peer])
Web services uses [*SOAP*|http://en.wikipedia.org/wiki/SOAP].
Regards,
Joe -
Hi,
I have a question about the scalability of RMI with Oracle JVM.
What we intend to do is have about 10 SOAP webservices all interacting with our Oracle 8i instance. One of the developers suggestion is to use the Sun Java/SOAP Toolkit to make the WS stub code on UNIX and write java classes on the UNIX box to talk to more Java Classes in Oracle (using RMI), which in turn then pass data to Oracle PL/SQL packages which do the main bulk of the work (and the same of course happens in reverse). Our webservices will be called very often however (maybe about 1 call every 10 secs) at the moment possibly increasing to several calls per second in busy periods.
However i have heard that RMI really does not scale well at all (in fact another group of people I've talked to in our organisation advise us not to use it, and claim Oracle advise the same).
My suggestion was to handle it all in PL/SQL and use the utl_tcp package to handle the http traffic (with the possibility of migrating to Oracle 9i + utl_http). (along the same lines as http://otn.oracle.com/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html)
Any suggestions on this would be most appreciated.
Thanks.In general I would concur with your thoughts on RMI. For some doc backup check out two pieces:
http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96656/invokeap.htm#1011867
and then also the de-support of J2EE characteristics in general:
http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96656/intro.htm#1006743
The basic focus of the Java engine is on J2SE applications.
To answer the SOAP approach, the development effort is primarily focussing on using the SOAP Java stack and loading it into the database as per this paper and example:
Paper: http://otn.oracle.com/tech/webservices/htdocs/dbwebservices/Database_Web_Services.pdf
Example:
http://otn.oracle.com/sample_code/tech/java/jsp/samples/wsclient/Abstract.html
This gives the same result as the PL/SQL example you point to but on a service by service approach a fairly simplified development approach. This should work in 8i as well (use these instructions to set up the stack: http://otn.oracle.com/sample_code/tech/java/jsp/loadjars.htl)
That said, the PL/SQL approach should also work (though like you say it needs to be tailored to 8i's PL/SQL capabilities) but you don't get much help from the product beyond UTL_HTTP whereas the Java approach gives a pre-built infrastructure that can also be upgraded as we move to JAX-RPC, the emerging standardized Java approach to implementing Web services.
Mike. -
hi Guys
can anybody tell me why developers always prefer to use Web Service instead of RMI
ThankMakes their CV (resume) more buzzword-compliant and impressive
But seriously, RMI allows Java apps to invoke methods on other Java apps. Web services are language-agnostic, so Java apps can integrate with C++, or PERL or any other language for which there exists a web services API. Other times, RMI cannot be used because, for instance, the application server doesn't allow it. Web services can be a way around this (but not the only way)
You hit on an important point, though, which my seemingly jokey initial response addresses. Oftentimes, developers will use web services where RMI would have sufficed, and then claim it's "in case we want to talk to other langauges". In fact, that's often not a requirement, and the developers in question have over-engineered the solution simply in order to use web services for the sake of it, hence my response. I call that sort of thinking "CV-driven development" - using a technology so that you can say you have used it, rather than to satisfy an actual business or technical requirement -
RMI exception calling web service from proxy class
I am getting the following error attempting to call a web service from a proxy. It appears to relate to the type of objects I am trying to send vs the type that is expected. Following the exception I am adding a copy of the control where calling the web service is sucessful, a copy of the proxy class that I am using to make this unsucessful call, and the controller.jpf that has the formBean where I am creating my objects
Caught Exception Calling the Web Service from the Proxy. The Exception is the f
ollowing: java.rmi.RemoteException: web service invoke failed: javax.xml.soap.SO
APException: failed to serialize class org.openuri.www.CreateAccountCheckingReq
uestweblogic.xml.schema.binding.SerializationException: type mapping lookup fail
ure on class=class controls.CheckingService$anyType TypeMapping=TYPEMAPPING SIZE
=5
ENTRY 1:
class: org.openuri.www.CreateAccountCheckingResponse
xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingResponse
ser: org.openuri.www.CreateAccountCheckingResponseCodec@c0f4da
deser: org.openuri.www.CreateAccountCheckingResponseCodec@b1dd4
ENTRY 2:
class: org.openuri.www.FundingInfoAnonType
xsd_type: ['http://www.openuri.org/']:lcl0:FundingInfoAnonType
ser: org.openuri.www.FundingInfoAnonTypeCodec@1d36711
deser: org.openuri.www.FundingInfoAnonTypeCodec@13a59e
ENTRY 3:
class: org.openuri.www.AccountInfoAnonType
xsd_type: ['http://www.openuri.org/']:lcl0:AccountInfoAnonType
ser: org.openuri.www.AccountInfoAnonTypeCodec@1de5959
deser: org.openuri.www.AccountInfoAnonTypeCodec@bbf788
ENTRY 4:
class: org.openuri.www.CustomerInfoAnonType
xsd_type: ['http://www.openuri.org/']:lcl0:CustomerInfoAnonType
ser: org.openuri.www.CustomerInfoAnonTypeCodec@7824f9
deser: org.openuri.www.CustomerInfoAnonTypeCodec@1c35fe1
ENTRY 5:
class: org.openuri.www.CreateAccountCheckingRequest
xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingRequest
ser: org.openuri.www.CreateAccountCheckingRequestCodec@1cbcd7b
deser: org.openuri.www.CreateAccountCheckingRequestCodec@11f60ce
; nested exception is:
javax.xml.soap.SOAPException: failed to serialize class org.openuri.www
.CreateAccountCheckingRequestweblogic.xml.schema.binding.SerializationException:
type mapping lookup failure on class=class controls.CheckingService$anyType Typ
eMapping=TYPEMAPPING SIZE=5
ENTRY 1:
class: org.openuri.www.CreateAccountCheckingResponse
xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingResponse
ser: org.openuri.www.CreateAccountCheckingResponseCodec@c0f4da
deser: org.openuri.www.CreateAccountCheckingResponseCodec@b1dd4
ENTRY 2:
class: org.openuri.www.FundingInfoAnonType
xsd_type: ['http://www.openuri.org/']:lcl0:FundingInfoAnonType
ser: org.openuri.www.FundingInfoAnonTypeCodec@1d36711
deser: org.openuri.www.FundingInfoAnonTypeCodec@13a59e
ENTRY 3:
class: org.openuri.www.AccountInfoAnonType
xsd_type: ['http://www.openuri.org/']:lcl0:AccountInfoAnonType
ser: org.openuri.www.AccountInfoAnonTypeCodec@1de5959
deser: org.openuri.www.AccountInfoAnonTypeCodec@bbf788
ENTRY 4:
class: org.openuri.www.CustomerInfoAnonType
xsd_type: ['http://www.openuri.org/']:lcl0:CustomerInfoAnonType
ser: org.openuri.www.CustomerInfoAnonTypeCodec@7824f9
deser: org.openuri.www.CustomerInfoAnonTypeCodec@1c35fe1
ENTRY 5:
class: org.openuri.www.CreateAccountCheckingRequest
xsd_type: ['http://www.openuri.org/']:lcl0:CreateAccountCheckingRequest
ser: org.openuri.www.CreateAccountCheckingRequestCodec@1cbcd7b
deser: org.openuri.www.CreateAccountCheckingRequestCodec@11f60ce
Java Control for the web service:
package controls;
import weblogic.webservice.context.WebServiceContext;
* @jc:location http-url="http://localhost:7001/Checking.jws"
* @jc:wsdl file="#CheckingWsdl"
* @jc:handler callback="MessageHandler" operation="MessageHandler"
public interface CheckingService extends com.bea.control.ControlExtension, com.bea.control.ServiceControl
public static class CustomerInfo
implements java.io.Serializable
public java.lang.String FirstName;
public java.lang.String LastName;
public java.lang.String MiddleName;
public int SSN;
public int CustomerNumber;
public java.util.Calendar CreationDate;
public java.util.Calendar LastModifiedDate;
public static class FundingInfo
implements java.io.Serializable
public float Amount;
public java.util.Calendar CurrentDate;
public int AccountNumber;
public static class anyType
implements java.io.Serializable
public com.bea.xml.XmlObject[] t;
public static class AccountInfo
implements java.io.Serializable
public int AccountNumber;
public float Balance;
public int CustomerNumber;
public java.util.Calendar LastModifiedDate;
public WebServiceContext context = CheckingService.context;
* @jc:protocol form-post="false" form-get="false"
public AccountInfo CreateAccountChecking (CustomerInfo CustomerInfo, FundingInfo FundingInfo, anyType CommonHeader);
static final long serialVersionUID = 1L;
/** @common:define name="CheckingWsdl" value::
<?xml version="1.0" encoding="utf-8"?>
<!-- @editor-info:link autogen="false" source="" -->
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:jms="http://www.openuri.org/2002/04/wsdl/jms/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://www.openuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://www.openuri.org/">
<types>
<s:schema targetNamespace="http://www.openuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema">
<s:element name="CreateAccountCheckingRequest">
<s:complexType>
<s:sequence>
<s:element name="CustomerInfo">
<s:complexType>
<s:sequence>
<s:element name="FirstName" type="s:string" nillable="false"/>
<s:element name="LastName" type="s:string" nillable="false"/>
<s:element name="MiddleName" type="s:string" nillable="true"/>
<s:element name="SSN" type="s:int"/>
<s:element name="CustomerNumber" type="s:int"/>
<s:element name="CreationDate" type="s:dateTime"/>
<s:element name="LastModifiedDate" type="s:dateTime"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="FundingInfo">
<s:complexType>
<s:sequence>
<s:element name="Amount" type="s:float"/>
<s:element name="CurrentDate" type="s:dateTime"/>
<s:element name="AccountNumber" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CommonHeader" type="s:anyType"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CreateAccountCheckingResponse">
<s:complexType>
<s:sequence>
<s:element name="AccountInfo">
<s:complexType>
<s:sequence>
<s:element name="AccountNumber" type="s:int"/>
<s:element name="Balance" type="s:float"/>
<s:element name="CustomerNumber" type="s:int"/>
<s:element name="LastModifiedDate" type="s:dateTime"/>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="string" nillable="true" type="s:string"/>
</s:schema>
</types>
<message name="CreateAccountCheckingSoapIn">
<part name="parameters" element="s0:CreateAccountCheckingRequest"/>
</message>
<message name="CreateAccountCheckingSoapOut">
<part name="parameters" element="s0:CreateAccountCheckingResponse"/>
</message>
<portType name="CheckingSoap">
<operation name="CreateAccountChecking">
<input message="s0:CreateAccountCheckingSoapIn"/>
<output message="s0:CreateAccountCheckingSoapOut"/>
</operation>
</portType>
<binding name="CheckingSoap" type="s0:CheckingSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="CreateAccountChecking">
<soap:operation soapAction="http://www.openuri.org/CreateAccountChecking" style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="Checking">
<port name="CheckingSoap" binding="s0:CheckingSoap">
<soap:address location="http://localhost:7001/Checking.jws"/>
</port>
</service>
</definitions>
FOLLOWING IS THE PROXY CLASS THAT IS UNSUCCESSFUL
import controls.CheckingService.anyType;
import java.util.ArrayList;
import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.rpc.handler.HandlerRegistry;
import org.openuri.CreateAccountCheckingResponseDocument.CreateAccountCheckingResponse;
import org.openuri.www.CustomerInfoAnonType;
import org.openuri.www.FundingInfoAnonType;
import weblogic.jws.proxies.*;
import weblogic.webservice.context.WebServiceContext;
import weblogic.webservice.context.WebServiceSession;
import weblogic.webservice.core.handler.WSSEClientHandler;
import weblogic.webservice.tools.pagegen.result;
import weblogic.xml.security.UserInfo;
import weblogic.xml.security.wsse.Security;
import weblogic.xml.security.wsse.SecurityElementFactory;
//import weblogic.jws.proxies.WebServiceB;
//import weblogic.jws.proxies.WebServiceB_Impl;
//import weblogic.jws.proxies.WebServiceBSoap;
public class CheckingWSProxy
public static void CallWS(Controller.CreateAccountCheckingForm form)
String user;
String pass;
try{
* Instantiate the main proxy class. The proxy class has the same name as the
* web service, with "_Impl" appended.
Checking myservice = new Checking_Impl("http://localhost:7001/ConsumerAccountApp/schemas/CheckingService.wsdl");
WebServiceContext context = myservice.context();
WebServiceSession session = context.getSession();
* Registers a handler for the SOAP message traffic.
HandlerRegistry registry = myservice.getHandlerRegistry();
List list = new ArrayList();
list.add(new HandlerInfo(WSSEClientHandler.class, null, null));
registry.setHandlerChain(new QName("Checking"), list);
* Set the username and password token for SOAP message sent from the client, through
* the proxy, to the web service.
user = form.getUsername();
pass = form.getPassword();
UserInfo ui = new UserInfo(user, pass);
session.setAttribute(WSSEClientHandler.REQUEST_USERINFO, ui);
* Adds the username / password token to the SOAP header.
SecurityElementFactory factory = SecurityElementFactory.getDefaultFactory();
Security security = factory.createSecurity(null);
security.addToken(ui);
session.setAttribute(WSSEClientHandler.REQUEST_SECURITY, security);
* Get the protocol-specific proxy class.
CheckingSoap msg=myservice.getCheckingSoap();
* Invoke the web service method
msg.createAccountChecking((CustomerInfoAnonType)form.getProxyCustomerInfo(), (FundingInfoAnonType)form.getProxyFundingInfo(), (Object)form.get_CommonHeader());
catch (Exception ex)
System.out.println("Caught Exception Calling the Web Service from the Proxy. The Exception is the following: " + ex.toString());
FOLLOWING IS THE FORMBEAN IN THE CONTROLLER.JPF FILE
* FormData get and set methods may be overwritten by the Form Bean editor.
public static class CreateAccountCheckingForm extends FormData
private anyType _CommonHeader;
private controls.CheckingService.FundingInfo _FundingInfo;
private controls.CheckingService.CustomerInfo _CustomerInfo;
private java.util.Date dOut;
private java.util.Calendar cOut;
private CustomerInfo proxyCustomerInfo;
private FundingInfo proxyFundingInfo;
private String stringDate;
private String currentDate;
private String lastModifiedDate;
private String creationDate;
private String systemMessage;
private String username;
private String password;
private String accountType;
private String trashTransferAccount;
private String trashAccountNumber;
private boolean secureFlag;
public void set_CustomerInfo(controls.CheckingService.CustomerInfo _CustomerInfo)
_CustomerInfo.CreationDate = parseDate(getCreationDate());
_CustomerInfo.LastModifiedDate = parseDate(getLastModifiedDate());
this._CustomerInfo = _CustomerInfo;
public controls.CheckingService.CustomerInfo get_CustomerInfo()
if(this._CustomerInfo == null)
this._CustomerInfo = new controls.CheckingService.CustomerInfo();
_CustomerInfo.CreationDate = dateNow();
_CustomerInfo.LastModifiedDate = dateNow();
return this._CustomerInfo;
public CustomerInfo getProxyCustomerInfo()
this.proxyCustomerInfo = (CustomerInfo)this._CustomerInfo;
return this.proxyCustomerInfo;
public void set_FundingInfo(controls.CheckingService.FundingInfo _FundingInfo)
_FundingInfo.CurrentDate = parseDate(getCurrentDate());
this._FundingInfo = _FundingInfo;
public controls.CheckingService.FundingInfo get_FundingInfo()
if(this._FundingInfo == null)
this._FundingInfo = new controls.CheckingService.FundingInfo();
_FundingInfo.CurrentDate = dateNow();
return this._FundingInfo;
public FundingInfo getProxyFundingInfo()
this.proxyFundingInfo = (FundingInfo)this._FundingInfo;
return this.proxyFundingInfo;
public void set_CommonHeader(anyType _CommonHeader)
this._CommonHeader = _CommonHeader;
public anyType get_CommonHeader()
if(this._CommonHeader == null)
this._CommonHeader = new anyType();
return this._CommonHeader;
public java.util.Calendar dateNow()
this.dOut = new Date();
Calendar cOut = this.cOut.getInstance();
cOut.setTime(this.dOut);
this.cOut = cOut;
return this.cOut;
public java.util.Calendar parseDate( String strDate )
SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
Calendar cOut = this.cOut;
df4.setLenient( false );
try
this.dOut = df4.parse( strDate );
} catch ( ParseException e )
cOut.getInstance();
cOut.setTime(dOut);
this.cOut = cOut;
return this.cOut;
public void setStringDate( String stringDate )
this.stringDate = stringDate;
public String getStringDate()
return this.stringDate;
public void setCurrentDate( String currentDate )
this.currentDate = currentDate;
public String getCurrentDate()
SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
this.currentDate = df4.format(_FundingInfo.CurrentDate.getTime());
return this.currentDate;
public void setLastModifiedDate( String lastModifiedDate )
this.lastModifiedDate = lastModifiedDate;
public String getLastModifiedDate()
SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
this.lastModifiedDate = df4.format(_CustomerInfo.LastModifiedDate.getTime());
return this.lastModifiedDate;
public void setCreationDate( String creationDate )
this.creationDate = creationDate;
public String getCreationDate()
SimpleDateFormat df4 = new SimpleDateFormat( "MM/dd/yyyy" );
this.creationDate = df4.format(_CustomerInfo.CreationDate.getTime());
return this.creationDate;
public void setUsername( String username )
this.username = username;
public String getUsername()
return this.username;
public void setPassword( String password )
this.password = password;
public String getPassword()
return this.password;
public void setAccountType( String accountType )
this.accountType = accountType;
public String getAccountType()
return this.accountType;
public void setTrashTransferAccount( String trashTransferAccount )
this.trashTransferAccount = trashTransferAccount;
public String getTrashTransferAccount()
return this.trashTransferAccount;
public void setTrashAccountNumber( String trashAccountNumber )
this.trashAccountNumber = trashAccountNumber;
public String getTrashAccountNumber()
return this.trashAccountNumber;
public void setSystemMessage( String systemMessage )
this.systemMessage = systemMessage;
public String getSystemMessage()
return this.systemMessage;
public void setSecureFlag( boolean secureFlag )
this.secureFlag = secureFlag;
public boolean getSecureFlag()
return this.secureFlag;
}This exception means that xml namespaces are different.
Etc. soap has xml element which doesn't belong to namespace of parent xml element and namespace is set without prefix.
I had such problem.
Try to set namespace prefix for this element.
Example:
<el1>
<el2 xmlns="http://..."/>
</el1>
Should be
<el1>
<q:el2 xmlns:q="http://..."/>
</el1> -
AxisFault seen while invoking document style web service
I am seeing the following stacktrace when I try to invoke a document-style web service.
<partnerRole name="MyWebService1_Role">
<ServiceName>{http://idm.oracle.com/}MyWebService1</ServiceName>
<PortType>{http://idm.oracle.com/}MyWebService1</PortType>
<Address>null</Address>
</partnerRole>
<conversationId>bpel://localhost/default/ProvisioningFromDAS~1.0/4202-BpInv0-BpSeq0.3-3</conversationId>
<properties>{}</properties>
</partnerLink>
<2005-09-06 09:23:37,650> <DEBUG> <default.collaxa.cube.ws> <WSIFInvocationHandler::invoke> Fault happened
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
faultSubcode:
faultString: caught exception while handling request: expected element is missing: {http://idm.oracle.com/}attribute
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:caught exception while handling request: expected element is missing: {http://idm.oracle.com/}attribute
at org.collaxa.thirdparty.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
at org.collaxa.thirdparty.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
at org.collaxa.thirdparty.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1083)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
What could this mean ?Hi,
I am getting a similar issue. I created a Document-style/literal webservice and deployed on Weblogic 9.2 . Then I generated client stubs using clientgen. I get the following exception stack trace:
java.rmi.RemoteException: web service invoke failed: javax.xml.soap.SOAPException:
failed to serialize class java.lang.Objectweblogic.xml.schema.binding.SerializationException: type mapping lookup failure on
class=class com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl TypeMapping=TYPEMAPPING SIZE=3
ENTRY 1:
class: java.lang.Object
xsd_type: ['http://xmlns.ozarkexpress.com/business/sell']:stns:echoDocumentResponse
ser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@1125127
deser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@18dfef8
ENTRY 2:
class: java.lang.Object
xsd_type: ['http://xmlns.ozarkexpress.com/business/sell']:stns:echoDocument
ser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@15e83f9
deser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@2a5330
ENTRY 3:
class: java.lang.Object
xsd_type: ['http://www.w3.org/2001/XMLSchema']:xsd:anyType
ser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@bb7465
deser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@d6c16c -
Question about document/literal web service
Hello every body.
I have some question about document/literal web service.
I’ve been working with Axis before.
Axis has four valid signatures for your message-style service methods:
public Element [] method(Element [] bodies);
public SOAPBodyElement [] method (SOAPBodyElement [] bodies);
public Document method(Document body);
public void method(SOAPEnvelope req, SOAPEnvelope resp);
The same I am trying to do with WebLogic API for webservices.
But when I am trying to test web service (public Document method (Document body); )
I have serialized exceptions for org.w3c.dom.Document.
Do I have to write a custom class for org.w3c.dom.Document serialization?
If yes can you give me some idea or example?
The all idea behind this web service is. I have just one web service and mane classes for XML processing. Depends what xml document will be during runtime, web service will be using different class for xml processing. It works fine with Axis, but in case of WebLogic I have some problem.
One more question… How I have to call this web service from java client?
I have seen this example http://www.manojc.com/?sample31 ,
but this web service looks like (Document helloDom()). I need to send Document.
This example works for Dynamic Proxy, but does not work for static call.
Any ideas?? Thank in advance.Hi,
I am getting a similar issue. I created a Document-style/literal webservice and deployed on Weblogic 9.2 . Then I generated client stubs using clientgen. I get the following exception stack trace:
java.rmi.RemoteException: web service invoke failed: javax.xml.soap.SOAPException:
failed to serialize class java.lang.Objectweblogic.xml.schema.binding.SerializationException: type mapping lookup failure on
class=class com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl TypeMapping=TYPEMAPPING SIZE=3
ENTRY 1:
class: java.lang.Object
xsd_type: ['http://xmlns.ozarkexpress.com/business/sell']:stns:echoDocumentResponse
ser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@1125127
deser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@18dfef8
ENTRY 2:
class: java.lang.Object
xsd_type: ['http://xmlns.ozarkexpress.com/business/sell']:stns:echoDocument
ser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@15e83f9
deser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@2a5330
ENTRY 3:
class: java.lang.Object
xsd_type: ['http://www.w3.org/2001/XMLSchema']:xsd:anyType
ser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@bb7465
deser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@d6c16c -
Can any one help me finding the example of document based web serives developed
using plain java classes.
I tried the way mentioned in documentation, if I use rpc style and pass xml as
string it is working fine. but if I use document base, it is not working.The example dom.zip doesn't work properly.
I got following error when I was running the example on JDeveloper 9.0.3. Any
suggestion ?
C:\JDEV903\jdk\bin\javaw.exe -ojvm -classpath C:\MyStudy\java\WS3\classes;C:\JDEV903\jdev\lib\jdev-rt.jar;C:\MyStudy\java\1\dom\client.jar;D:\bea\weblogic700\server\lib\webserviceclient+ssl.jar;D:\bea\weblogic700\server\lib\weblogic.jar;C:\JDEV903\jdev\lib\jdev-rt.jar;C:\JDEV903\soap\lib\soap.jar;C:\JDEV903\lib\xmlparserv2.jar;C:\JDEV903\jlib\javax-ssl-1_2.jar;C:\JDEV903\jlib\jssl-1_2.jar;C:\JDEV903\j2ee\home\lib\activation.jar;C:\JDEV903\j2ee\home\lib\mail.jar;C:\JDEV903\j2ee\home\lib\http_client.jar;C:\JDEV903\lib\xmlparserv2.jar;C:\JDEV903\lib\xmlcomp.jar
-Dhttp.proxyHost=proxy.ouhk.edu.hk -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=localhost|ouhk-15msmdomah|sun17.ouhk.edu.hk|sun18.ouhk.edu.hk|www.ouhk.edu.hk|www4.ouhk.edu.hk
wl.client.wsServletClient
java.rmi.RemoteException: web service invoke failed; nested exception is:
javax.xml.soap.SOAPException: failed to serialize xml:weblogic.xml.schema.binding.SerializationException:
type mapping lookup failure on class=class weblogic.apache.xerces.dom.DocumentImpl
TypeMapping=TYPEMAPPING SIZE=0
javax.xml.soap.SOAPException: failed to serialize xml:weblogic.xml.schema.binding.SerializationException:
type mapping lookup failure on class=class weblogic.apache.xerces.dom.DocumentImpl
TypeMapping=TYPEMAPPING SIZE=0
void weblogic.webservice.core.DefaultPart.toXML(javax.xml.soap.SOAPElement, java.lang.Object,
weblogic.xml.schema.binding.SerializationContext, boolean, javax.xml.rpc.encoding.TypeMapping)
DefaultPart.java:260
void weblogic.webservice.core.DefaultMessage.toXML(javax.xml.soap.SOAPMessage,
java.lang.Object[])
DefaultMessage.java:455
java.lang.Object weblogic.webservice.core.DefaultOperation.invoke(java.util.Map,
java.lang.Object[], java.io.PrintStream)
DefaultOperation.java:403
java.lang.Object weblogic.webservice.core.DefaultOperation.invoke(java.util.Map,
java.lang.Object[])
DefaultOperation.java:359
java.lang.Object weblogic.webservice.core.rpc.StubImpl._invoke(java.lang.String,
java.util.Map)
StubImpl.java:225
java.lang.Object examples.dom.EchoDomServicePort_Stub.echoDom(java.lang.Object)
EchoDomServicePort_Stub.java:33
void wl.client.wsServletClient.main(java.lang.String[])
wsServletClient.java:76
Process exited with exit code 0.
Rajesh Mirchandani <[email protected]> wrote:
See if this helps
http://dev2dev.bea.com/direct/webservice/index.html
kaushik wrote:
Can any one help me finding the example of document based web serivesdeveloped
using plain java classes.
I tried the way mentioned in documentation, if I use rpc style andpass xml as
string it is working fine. but if I use document base, it is not working.--
Rajesh Mirchandani
Developer Relations Engineer
BEA Support -
Invoking web service from OBIEE11g failed socket timeout
Hi,
I encountered an error when I invoke web service from OBIEE 11g. The web serivce resides on Websphere running on other machine.
An error says that "Invoking web service failed due to socket timeout." and it seems that it stopped in just 40 secs.
Is there any settings of WebLogic server to avoid this? This web service normally runs for more than 60 sec.
I have checked several parameters in WebLogic admin console and changed those values, but I still receive the same error.
Invoking the same web service from SOAPUI sustains for more than 60 secs.
Regards,
Fujio SoneharaDon't be too surprised. Sun figured this bug out in short order. I got the same error message when trying to do the same thing, just for the heck of it. Reference this article for details.
http://java.sun.com/webservices/docs/ea2/jaxrpc/ReleaseNotes.html
It contains information about bugs fixed in the WSDP EA2. So in answer to your question, download the newer pack from
http://java.sun.com/webservices/downloads/webservicespack.html
and your bug will go away. Happy Coding.
Legal Problems?
Legal Solutions, for a lot less than you might think.
[email protected]
http://www.prepaidlegal.com/go/pritchard45 -
RESTFUL Web Services vs Socket Programming Performance
Hi guys,
I will have an application which will have a service serving about to 30 million users/day and a mean of 5 requests/user.
It means that there will be about 150 million requests per day. I will have two servers behind a load balancer and my clients will be both Java and C++.
I think to implement RESTFUL Web Services but afraid of performance issues.
Did you have a knowledge about the performances of web service and socket programming in such a high loaded project?
Tnx.
Ayberkayberkcansever wrote:
Hi guys,
I will have an application which will have a service serving about to 30 million users/day and a mean of 5 requests/user.
It means that there will be about 150 million requests per day. I will have two servers behind a load balancer and my clients will be both Java and C++.
I think to implement RESTFUL Web Services but afraid of performance issues.
Did you have a knowledge about the performances of web service and socket programming in such a high loaded project?It depends on the CPUs, RAM, disks, and network configurations of those servers.
It depends on how the requests are distributed throughout the day.
It depends on how big the requests are and how big the responses are. -
Open client socket from within a Web Service
Hello,
I need to open a client TCP/IP socket from within a Web Service-type WebLogic
Workshop app. When I try to read from the socket, the socket read operation hangs.
When I use the same code in a J2SE Java app on the same machine using Eclipse
everything works fine. It also works fine from within WebLogic, if I use a "URL"
object instead of a "Socket" object. (However, I cannot use this type of connection.)
Can anyone tell me how to work with raw TCP/IP sockets in this situation?Hi Udi,
I have tested my code from within a Servlet and it works fine.
The Servlet and the Web Service both call the same simple JAVA class. This class wants to access a DB, and therefor, I am using the Data Source.
When the Servlet calls the class, everything works fine. But when I use the Web Service to call this class, I get the Exception "No attributes are implemented".
I hope this information helps you understanding my problem?
Thank you very much for your help.
Kind regards,
Nadine -
Java Web Services accessing rmi server
Hi,
I want to access the rmi server from a java web services.My java web services is running under Sun application server9.The rmi server is not using any application server.Please help me to sort out the problem.
Bye
BinayWhat's the problem exactly? I assume you understand that the RMI server has to run like any RMI server, it has to bind itself into a Registry; the Web server acts as an RMI client so it has to look up the Registry to get a remote reference so it can call the required remote methods.
-
Hi,
I have a question about the scalability of RMI with Oracle JVM.
What we intend to do is have about 10 SOAP webservices all interacting with our Oracle 8i instance. One of the developers suggestion is to use the Sun Java/SOAP Toolkit to make the WS stub code on UNIX and write java classes on the UNIX box to talk to more Java Classes in Oracle (using RMI), which in turn then pass data to Oracle PL/SQL packages which do the main bulk of the work (and the same of course happens in reverse). Our webservices will be called very often however (maybe about 1 call every 10 secs) at the moment possibly increasing to several calls per second in busy periods.
However i have heard that RMI really does not scale well at all (in fact another group of people I've talked to in our organisation advise us not to use it, and claim Oracle advise the same).
My suggestion was to handle it all in PL/SQL and use the utl_tcp package to handle the http traffic (with the possibility of migrating to Oracle 9i + utl_http). (along the same lines as http://otn.oracle.com/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html)
Any suggestions on this would be most appreciated.
Thanks.In general I would concur with your thoughts on RMI. For some doc backup check out two pieces:
http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96656/invokeap.htm#1011867
and then also the de-support of J2EE characteristics in general:
http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96656/intro.htm#1006743
The basic focus of the Java engine is on J2SE applications.
To answer the SOAP approach, the development effort is primarily focussing on using the SOAP Java stack and loading it into the database as per this paper and example:
Paper: http://otn.oracle.com/tech/webservices/htdocs/dbwebservices/Database_Web_Services.pdf
Example:
http://otn.oracle.com/sample_code/tech/java/jsp/samples/wsclient/Abstract.html
This gives the same result as the PL/SQL example you point to but on a service by service approach a fairly simplified development approach. This should work in 8i as well (use these instructions to set up the stack: http://otn.oracle.com/sample_code/tech/java/jsp/loadjars.htl)
That said, the PL/SQL approach should also work (though like you say it needs to be tailored to 8i's PL/SQL capabilities) but you don't get much help from the product beyond UTL_HTTP whereas the Java approach gives a pre-built infrastructure that can also be upgraded as we move to JAX-RPC, the emerging standardized Java approach to implementing Web services.
Mike. -
How far Web service is better than RMI??
Hi buddies,
can anyone pls tell me *"How far Web Services are more preferable than RMI?"*
i am totally confused of various kind of answers?
thanx in advance.
bye,
subbuRMI transmits objects via Serialization so is much more space and time efficient over a LAN.
Web Services transmits XML over HTTP so it can generally negotiate firewalls, which can be a major problem with RMI systems.
Web Services don't support callbacks or small transactions very well, where RMI does (firewalls permitting).
The security features built into Web Services or available via XML are superior to RMI over SSL in a number of ways.
Basically RMI is best where you want to export an extensive API via a LAN. Web Services are best when you want to export a few simple transactions via the Web. -
Weblogic invoking web service failed due to socket timeout
Hi,
I encountered an error when I invoke web service from OBIEE 11g. The web serivce resides on Websphere running on other machine.
An error says that "Invoking web service failed due to socket timeout." and it seems that it stopped in just 40 secs.
Is there any settings of WebLogic server to avoid this? This web service normally runs for more than 60 sec.
I have checked several parameters by WebLogic admin console and changed those values, but I still receive same errors.
Regards,
Fujio SoneharaHey Eason,
As I had previously mentioned, I have checked the FE server certs and have mentioned the signing algorithm it used to sign the certs, which was sha1DSA and not sha1RSA, I even checked my CA list of issued certs and have found all certs are signed the same.
Signature algorithm: sha1DSA
Signature Hash Algorithm: sha1
Public Key: RSA (1024 bit)
I could run request and reinstall all day long it will still get the same certs signed with the algo..
Doing some research I attempted to see if I could change the signing cert for a specific cert template that was being used to issue the Lync FE certs... however seems that from according to
this, that I'd have to completely rebuild my CA before I'd be able to request and issue a cert with the proper signing algorithm?!
This
says its possible but not supported, what do I do in this situation? Is my only option to rebuild teh entire CA and cert infrastructure?
I noticed my CSP is set to Microsoft Base DSS Cryptographic Provider, and under the CSP folder there is no "CNGHashAlgorithm" key so I'm using a "Next Gen CSP" apparently? Is this CSP good enough to support Lync...Straight up where is
the Lync documentation on the CA setup requirements??
This google link doesn't tell you how you should setup a CA for Lync, what settings need to set etc..
Maybe you are looking for
-
Please help. I have transferred my iTunes library from one external hard drive to another plus added additional music now I have duplicates of the same music in many albums. How do I delete the duplicates without going through them one by one which w
-
How to: accept then process all mail for the MTA.
using messaging server 5.1 what channel definations are required to tell the MTA to accept all incomming mail and then process it. Instead of dropping it at the door, meaning that it just rejects the message if the user is not housed on the system.
-
Creating a forms program listing
Is there a way to generate a listing of the code just for triggers and program units? I've tried File=>Administration=>Object List Report but it creates much more than I am looking for. I am also looking for a way to create a cross reference of the f
-
Safari goes back to home screen when opened using Safari icon
I dropped my iphone Saturday, fortunately I had it in my Otterbox case which was in its holster. Thank God there was no physical damage to the phone. However, now I notice that every time I want to use Safari using the Safari icon on the home screen,
-
HI, I bought my iphone 5 from you guys (online Apple Store). all good apart from one thing, FACETIME is totally missing from my phone and its not there in my settings too. kindly advise with the reason or if there any upgrades to be done. Many Thanks