Webservice for EJB DC
I'm trying to create a webservice for an EJB with the Webservice Creation Wizard of NDS. While this is no problem for an "old fashioned" EJB, it does not seem to work for an EJB DC. The context menu "New -> Virtual Interface / Webservice" appears, just as described in the <a href="http://help.sap.com/saphelp_nw04s/helpdata/de/f7/af60f2e04d0848888675a800623a81/frameset.htm">Java Development Manual</a>, but nothing happenes when I select one of this options. No error message, no dialog, nothing...
I have created an Enterprise Application DC with an EJB Module DC as Child DC. The EJB Project contains a Stateless Session Bean with a Business Method. Is there anything else I have to do, so that the Wizard works?
Thanks for your help,
Frank
Hi,
Which version of Studio are you using? Mine is SP18 and it works fine. I'm able to create a virtual interface for an ejb in ejb dc with no problems.
You might consider re-installing your studio.
Hope that helps,
Thanks,
Rajit S
Similar Messages
-
Webservices for EJB How to go about it
HI
Here is my situation please advice me how to go about it...
I have to expose EJB as a webservices...That EJB is already packed in jar file it has nearly 20 methods or so and the application server that i need to use is weblogic....The problem is many of the methods return java.util.Map and java.util.Collection...and the contents of the all the Maps are not of the same type all the time i mean if Method1 returns Map whose key is String and Values is user defined data type (for instance dataType1)...Method2 also returns a Map whose key is a String and values is another User Defined data type(for instance dataType2)..
I tried with weblogic servicegen and WSEE 109 manually building it but that did not work out....Right now my idea is to write wrapper class which has all the 20 methods but return user defined data type(which i have to write).Internally each method will be calling the corresponding method in EJB..If this is the case for each method i have to create different User defined data type....Is this feasible or is there better way of doing it....
Thanks for sparing some time to go through my problemThis question is also posted in the BEA forums, I've replied to it here: http://forums.bea.com/bea/thread.jspa?threadID=600004366&tstart=0
-Tim West -
Procedure for Accessing WebService in ejb By using NetWeaver,
hai,
This is Guru.
please tell me the procedure for accessing a webservice in ejb .
my mean is.
i have one Session Beab,And there is one webservice.
How can i call and using that webservice in netweaverdeveloperstudio tool.please send me code,if u have.
thanqq
GuruHi Guru,
the procedure to use a WS is as follow
1. Use the SAP xmltoolkit and generate client binding for your WS, which is the stub class, parameter and return type classes of the WS methods, if any.
2.Import the created WS client jar from step 1 to your EJB module project
3. In your session bean: instantiate the stub and call a WS method on this stub
That's all there is to it.
Best Regards
Gregor
Ps. The NWDS Help has also tutorial regarding WS usage. -
Command bean or webservice for accessing EJB
Hi Experts,
I Want to access an Enterprise archieve DC created for EJB Module DC, through WebDynpro DC.
Now I know that there are two ways to access EAR DC through webDynpro:
1) Command bean
2) Web Services
Can anybody suggest the pros and cons of this two methods?
Also please suggest which one to choose.
Regards,
Ashish ShahHi,
to access EJBs from WD, you can use the EJB3.0 model importer (a new feature introduced with NW CE). There's a good tutorial explaining that <a href="http://help.sap.com/saphelp_nwce10/helpdata/en/45/f7f744aea471fae10000000a1553f6/frameset.htm">here</a>.
The Web services way should also work, but it means that you "wrap" the EJB, which is not needed in this case, I believe.
Hope it helps! -
Error while calling PI webservice from EJB
Hi Experts,
We are getting exception while calling PI webservice from EJB which is deployed in CE 7.2. Earlier we used to call the same webservice but from different PI system at that it worked fine. Now we have changed the consumer proxies required in CE and tried to call from CE and it is throwing error. We have checked usernames and passwords that we are using to call the service and that is working fine. PI team tested from their side and li is also fine. We have also restarted the CE system but invain. Can somebody help on this. The below is the trace that we got.
Location: com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding
Text: Connection IO Exception. Check nested exception for details. (Connection reset).
[EXCEPTION]
com.sap.engine.services.webservices.espbase.client.bindings.exceptions.TransportBindingException: Connection IO Exception. Check nested exception for details. (Connection reset).
at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.outputSOAPMessage(SOAPTransportBinding.java:419)
at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.call_SOAP(SOAPTransportBinding.java:1364)
at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.callWOLogging(SOAPTransportBinding.java:990)
at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.call(SOAPTransportBinding.java:944)
at com.sap.engine.services.webservices.espbase.client.jaxws.core.WSInvocationHandler.processTransportBindingCall(WSInvocationHandler.java:168)
at com.sap.engine.services.webservices.espbase.client.jaxws.core.WSInvocationHandler.invokeSEISyncMethod(WSInvocationHandler.java:121)
at com.sap.engine.services.webservices.espbase.client.jaxws.core.WSInvocationHandler.invokeSEIMethod(WSInvocationHandler.java:84)
at com.sap.engine.services.webservices.espbase.client.jaxws.core.WSInvocationHandler.invoke(WSInvocationHandler.java:65)
at $Proxy780.mioaRDMDataDistribution(Unknown Source)
at com.MDMEventListener.callToPIWS(MDMEventListener.java:100)
at com.MDMEventListener.ListenerMethod(MDMEventListener.java:173)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:47)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_WS.invoke(Interceptors_WS.java:31)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:39)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:23)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:25)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:17)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177)
at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:138)
at com.sap.engine.services.ejb3.webservice.impl.DefaultImplementationContainer.invokeMethod(DefaultImplementationContainer.java:203)
at com.sap.engine.services.webservices.espbase.server.runtime.RuntimeProcessingEnvironment.process0(RuntimeProcessingEnvironment.java:730)
at com.sap.engine.services.webservices.espbase.server.runtime.RuntimeProcessingEnvironment.preProcess(RuntimeProcessingEnvironment.java:682)
at com.sap.engine.services.webservices.espbase.server.runtime.RuntimeProcessingEnvironment.process(RuntimeProcessingEnvironment.java:324)
at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPostWOLogging(ServletDispatcherImpl.java:199)
at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:65)
at com.sap.engine.services.webservices.servlet.SoapServlet.doPost(SoapServlet.java:61)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:152)
at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:38)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:404)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:204)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:440)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:429)
at com.sap.engine.services.servlets_jsp.filters.DSRWebContainerFilter.process(DSRWebContainerFilter.java:38)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.servlets_jsp.filters.ServletSelector.process(ServletSelector.java:82)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.servlets_jsp.filters.ApplicationSelector.process(ApplicationSelector.java:268)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.WebContainerInvoker.process(WebContainerInvoker.java:81)
at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.ResponseLogWriter.process(ResponseLogWriter.java:60)
at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.DefineHostFilter.process(DefineHostFilter.java:27)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.MonitoringFilter.process(MonitoringFilter.java:29)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.MemoryStatisticFilter.process(MemoryStatisticFilter.java:54)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.filters.DSRHttpFilter.process(DSRHttpFilter.java:42)
at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)
at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)
at com.sap.engine.services.httpserver.server.Processor.chainedRequest(Processor.java:447)
at com.sap.engine.services.httpserver.server.Processor$FCAProcessorThread.process(Processor.java:264)
at com.sap.engine.services.httpserver.server.rcm.RequestProcessorThread.run(RequestProcessorThread.java:56)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)
at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
at com.sap.engine.services.webservices.jaxm.soap.HTTPSocket.readLine(HTTPSocket.java:950)
at com.sap.engine.services.webservices.jaxm.soap.HTTPSocket.getInputStream(HTTPSocket.java:414)
at com.sap.engine.services.webservices.jaxm.soap.HTTPSocket.getResponseCode(HTTPSocket.java:319)
at com.sap.engine.services.webservices.espbase.client.bindings.ClientHTTPTransport.getResponseCode(ClientHTTPTransport.java:209)
at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.outputSOAPMessage(SOAPTransportBinding.java:385)
... 78 more
Regards,
PradeepHi Pradeep,
this looks like if the server is not reachable. Have you checked if both server are able to communicate? Maybe firewall rules block the request.
Regards,
Tobias -
Consuming XI WebService in EJB
Hi,
I want to consume a XI webService , for that I have created the client proxy from the WSDL file. I have created the EJB project to consume the XI webService but when I right click on the EJB project the "Add client web Service API Library"
option in the context menu is not enabled which i have to use. I am not getting why it is happening?
It will be great if anyone can guide me regarding this.
Thanks,
SamirHi,
You have to create your WS proxy of type "Deployable Proxy" to use this functionality.
Regrads,
daniel -
Hi all,
When i try to run more than one servelt of the Quick Start samples that using Livecycle Java APIs and i get an error of "Remote EJBObject lookup failed for ejb/Invocation provider" from any servelt i run.
I try some Quick samples which is not servelts (java class) and it works fine, which makes me sure that my connection properties is true.
Environment:
The LiveCycle is based on "Websphere v6.1", and i use "Eclipse Platform
Version: 3.4.1".
i install "tomcat 5.5.17" to test the servelts in developing time through Eclipse.(only for test in developing time not for deploy on )
The Jars i added in the classpath:
adobe-forms-client.jar
adobe-livecycle-client.jar
adobe-usermanager-client.jar
adobe-utilities.jar
ejb.jar
j2ee.jar
ecutlis.jar
com.ibm.ws.admin.client_6.1.0.jar
com.ibm.ws.webservices.thinclient_6.1.0.jar
server.jar
utlis.jar
wsexception.jar
My code is :
Properties ConnectionProps = new Properties();
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "iiop://localhost:2809");
ConnectionProps.setProperty ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_ EJB_PROTOCOL);
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE,ServiceClientFa ctoryProperties.DSC_WEBSPHERE_SERVER_TYPE);
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "Administrator");
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
ConnectionProps.setProperty("java.naming.factory.initial", "com.ibm.ws.naming.util.WsnInitCtxFactory");
//Create a ServiceClientFactory object
ServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps);
//Create a FormsServiceClient object
FormsServiceClient formsClient = new FormsServiceClient(myFactory);
//Get Form data to pass to the processFormSubmission method
Document formData = new Document(req.getInputStream());
//Set run-time options
RenderOptionsSpec processSpec = new RenderOptionsSpec();
processSpec.setLocale("en_US");
//Invoke the processFormSubmission method
FormsResult formOut = formsClient.processFormSubmission(formData,"CONTENT_TYPE=application/pdf&CONTENT_TYPE=app lication/vnd.adobe.xdp+xml&CONTENT_TYPE=text/xml", "",processSpec);
List fileAttachments = formOut.getAttachments();
Iterator iter = fileAttachments.iterator();
int i = 0 ;
while (iter.hasNext()) {
Document file = (Document)iter.next();
file.copyToFile(new File("C:\\Adobe\\tempFile"+i+".jp i++;
short processState = formOut.getAction();
...... (To the end of the sample)
My Error was:
com.adobe.livecycle.formsservice.exception.ProcessFormSubmissionException: ALC-DSC-031-000: com.adobe.idp.dsc.net.DSCNamingException: Remote EJBObject lookup failed for ejb/Invocation provider
at com.adobe.livecycle.formsservice.client.FormsServiceClient.processFormSubmission(FormsSer viceClient.java:416)
at HandleData.doPost(HandleData.java:62)
at HandleData.doGet(HandleData.java:31)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
aI assume here that your application is deployed on a different physical machine of where LCES is deployed and running.
Do the following test:
- Say that LCES is deployed on machine1 and your application is deployed on machine2. Ping machine1 from machine2 and note the ip address.
- Ping machine1 from machine1 and note the ip address.
The two pings should match.
- Ping machine2 from machine1 and note the ip address.
- Ping machine2 from machine2 and note the ip address.
The two pings should match.
Usually this kind of error would happen if your servers have internal and external ip addresses. -
I am using webservice in ejb but it is giving Naming exception in NetWeaver
hai
this Guru.
i am working as javadeveloper .
in my project i am using webservices in ejbs.
i am using netweaverdeveloper .
my problem is whlie accessing webservices in ejbs it is giving Namingexception .
please tell me the procedure for accesing WEBSERVICES IN EJB BY USING NETWEAVER DEVELOPER STUDIO.
THANQQQQQ
GURU FROM MOBILEONE PTV LIMITED
HYDERABAD
INDIAHi Guru,
Refer these links
Accessing the Web Services Context from a WS-EJB ->
http://help.sap.com/saphelp_webas630/helpdata/en/a6/835f3e1e7d7937e10000000a114084/content.htm
Accessing the web service from webdynpro ->
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9fc0e990-0201-0010-199c-e38fc6dafb5d
Regards,
Uma -
Webservice for soap with attachments
HI
I am try to develop webservice for soap with attachments for the sending images like jpg,tiff,gif.
it works fine when I statically attach the file
but when i pass dynamically the file name it will give me error for the call.invoke() method
Following is the code and the error details
I am using eclipse wtp2.0 and using weblogic appserver 8.1 and axis-1.4
that is my configuration details.
// This is my service code
import java.io.File;
import java.io.IOException;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.mail.MessagingException;
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPPart;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.axis.message.SOAPEnvelope;
//import org.apache.axis.soap.MessageFactoryImpl;
import com.sun.corba.se.spi.activation.Repository;
public class AttachmentServer1
SOAPMessage msg = null;
Message response= null;
FileDataSource fileSource;
DataHandler dataHandler = null;
MessageContext context = null;
public void sendImage(String fileName) throws MessagingException, IOException{
try {
//java.lang.System.setProperty("javax.xml.soap.MessageFactory","com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl");
java.lang.System.setProperty("javax.xml.soap.MessageFactory","org.apache.axis.soap.MessageFactoryImpl");
MessageFactory fac = MessageFactory.newInstance();
msg = fac.createMessage();
context = MessageContext.getCurrentContext();
response = context.getRequestMessage();
if(msg != null){
System.out.println("From inside if statement");
//File f = new File("D:/1.png");
File f = new File(fileName);
fileSource = new FileDataSource(f);
dataHandler =new DataHandler(fileSource);
System.out.println("From inside if statement 1");
AttachmentPart part = msg.createAttachmentPart(dataHandler);
System.out.println("From inside if statement part");
//part.setContentType("image/jpeg");
//part.setMimeHeader("Content-Type", "image/jpg");
//part.setContent(dataHandler, "image/jpg");
SOAPPart soapPart = msg.getSOAPPart();
javax.xml.soap.SOAPEnvelope envelope = soapPart.getEnvelope();
SOAPBody body = envelope.getBody();
SOAPBodyElement bodyElement = body.addBodyElement(envelope.createName("attach"));
SOAPElement element = bodyElement.addChildElement(envelope.createName("parent"));
System.out.println("From inside if statement 2");
part.setContentId("axis");
msg.addAttachmentPart(part);
element.addAttribute(envelope.createName("href"), part.getContentId());
System.out.println("From inside if statement 3");
msg.saveChanges();
System.out.println("From inside if statement 4");
System.out.println(part.getContentId());
}else
try {
throw new Exception("Responce message is null");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SOAPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
// This is the client code
import java.io.File;
import java.io.FileOutputStream;
import java.util.Iterator;
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPException;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.message.SOAPEnvelope;
public class AttachmentClient {
public static void getImage(){
try{
String endPoint = "http://localhost:7001/Test/services/AttchmentServer";
Service service = new Service();
Call call = (Call)service.createCall();
call.setOperationName(new QName("sendImage"));
call.setTargetEndpointAddress(endPoint);
call.setUseSOAPAction(true);
call.invoke(new Object[] {});
MessageContext context = call.getMessageContext();
Message msg = context.getCurrentMessage();
Iterator obj = msg.getAttachments();
while(obj.hasNext()){
try{
AttachmentPart part = (AttachmentPart) obj.next();
File graphFile = new File("test.jpg");
FileOutputStream outputStream = new FileOutputStream(graphFile);
DataHandler dataHandler = part.getDataHandler();
if(dataHandler != null){
dataHandler.writeTo(outputStream);
outputStream.flush();
System.out.println("File Saved at:"+graphFile.getAbsolutePath());
}else{
System.out.println("null");
}catch(Exception e){
e.printStackTrace();
}catch(Exception e){
e.printStackTrace();
public static void main(String args[]) throws SOAPException
getImage();
// The error is something like that
- Exception:
java.lang.RuntimeException: javax.mail.MessagingException: Error in input stream;
nested exception is:
java.io.IOException: End of stream encountered before final boundary marker.AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: javax.mail.MessagingException: Error in input stream;
nested exception is:
java.io.IOException: End of stream encountered before final boundary marker.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:javax.mail.MessagingException: Error in input stream;
nested exception is:
java.io.IOException: End of stream encountered before final boundary marker.
at javax.mail.internet.InternetHeaders.load(InternetHeaders.java:122)
at javax.mail.internet.InternetHeaders.<init>(InternetHeaders.java:93)
at org.apache.axis.attachments.MultiPartRelatedInputStream.readTillFound(MultiPartRelatedInputStream.java:499)
at org.apache.axis.attachments.MultiPartRelatedInputStream.readAll(MultiPartRelatedInputStream.java:433)
at org.apache.axis.attachments.MultiPartRelatedInputStream.getAttachments(MultiPartRelatedInputStream.java:439)
at org.apache.axis.attachments.AttachmentsImpl.mergeinAttachments(AttachmentsImpl.java:171)
at org.apache.axis.attachments.AttachmentsImpl.getAttachmentByReference(AttachmentsImpl.java:341)
at org.apache.axis.encoding.DeserializationContext.getObjectByRef(DeserializationContext.java:617)
at org.apache.axis.encoding.ser.JAFDataHandlerDeserializer.populateDataHandler(JAFDataHandlerDeserializer.java:74)
at org.apache.axis.encoding.ser.JAFDataHandlerDeserializer.startElement(JAFDataHandlerDeserializer.java:59)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at AttachmentClient2.getImage(AttachmentClient2.java:27)
at AttachmentClient2.main(AttachmentClient2.java:58)
{http://xml.apache.org/axis/}hostname:solusoft18
javax.mail.MessagingException: Error in input stream;
nested exception is:
java.io.IOException: End of stream encountered before final boundary marker.
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.attachments.MultiPartRelatedInputStream.readTillFound(MultiPartRelatedInputStream.java:609)
at org.apache.axis.attachments.MultiPartRelatedInputStream.readAll(MultiPartRelatedInputStream.java:433)
at org.apache.axis.attachments.MultiPartRelatedInputStream.getAttachments(MultiPartRelatedInputStream.java:439)
at org.apache.axis.attachments.AttachmentsImpl.mergeinAttachments(AttachmentsImpl.java:171)
at org.apache.axis.attachments.AttachmentsImpl.getAttachmentByReference(AttachmentsImpl.java:341)
at org.apache.axis.encoding.DeserializationContext.getObjectByRef(DeserializationContext.java:617)
at org.apache.axis.encoding.ser.JAFDataHandlerDeserializer.populateDataHandler(JAFDataHandlerDeserializer.java:74)
at org.apache.axis.encoding.ser.JAFDataHandlerDeserializer.startElement(JAFDataHandlerDeserializer.java:59)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at AttachmentClient2.getImage(AttachmentClient2.java:27)
at AttachmentClient2.main(AttachmentClient2.java:58)
Caused by: javax.mail.MessagingException: Error in input stream;Hi David,
The "covert byte[] to a base64 encoded string" solution, is probably your best
bet given the scenario you described.
Regards,
Mike Wooten
"David Ruana" <[email protected]> wrote:
>
Weblogic 6.1 (SP2) does not support SOAP with attachments. In the meanwhile,
what
is the best approach in order to send a SOAP message which has binary
data?
My EJB is currently receiving a byte[] and returning also a byte[]. The
only solution
I can think of right now is to convert the byte[] into a String in base64
format.
Would you recommend that?
Thanks in advance. -
A free ebook for EJB 3.0 with the latest version of Netbean
Hi,
I am a trainee although with a good background in java.
I'm urgently in need of a free ebook for EJB 3.0 with the latest version of Netbean. Pls, help me with one if you have. my email is [email protected]
Again, is container managed bean good for a big project?
Thanks.
Emekaemekaco wrote:
Hi,
I am a trainee although with a good background in java.
I'm urgently in need of a free ebook for EJB 3.0 with the latest version of Netbean. Pls, help me with one if you have. my email is [email protected]
http://www.theserverside.com/tt/books/wiley/masteringEJB3/index.tss
Here's a good free e-book but without Netbean. It covers everything you would need to know about EJBs.
>
Again, is container managed bean good for a big project?
The question is too vague to be answered. It's a design decision that needs more details. -
Writing a Standalone Client for EJB 3.0 Bean For Weblogic 10
Steps for Writing a Standalone Client
Client Code
package com.client;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
import com.StatelessService;
public class StatelessClient {
public static void main(String [] args){
Context ctx = null;
try {
ctx = getInitialContext("t3://localhost:7001/protossbservice","weblogic","weblogic");
Object ref = ctx.lookup("StatelessService#"+StatelessService.class.getName());
StatelessService service = (StatelessService)PortableRemoteObject.narrow(ref,StatelessService.class);
System.out.println("StatelessClient.getMessage() ++");
String message = service.getMessage();
System.out.println("StatelessClient.getMessage --");
System.out.println("Message from Bean "+message);
} catch (NamingException e) {
e.printStackTrace();
private static Context getInitialContext(String url, String user, String password) throws NamingException {
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, url);
h.put(Context.SECURITY_PRINCIPAL, user);
h.put(Context.SECURITY_CREDENTIALS, password);
return new InitialContext(h);
Business Interface
package com;
public interface StatelessService {
public String getMessage();
Stateless Session Bean
package com;
import javax.annotation.PostConstruct;
import javax.ejb.Remote;
import javax.ejb.Stateless;
* Test Stateless Session Bean
@Stateless(mappedName="StatelessService")
@Remote(StatelessService.class)
public class StatelessServiceBean implements StatelessService {
public String getMessage(){
return "I am invoked";emekaco wrote:
Hi,
I am a trainee although with a good background in java.
I'm urgently in need of a free ebook for EJB 3.0 with the latest version of Netbean. Pls, help me with one if you have. my email is [email protected]
http://www.theserverside.com/tt/books/wiley/masteringEJB3/index.tss
Here's a good free e-book but without Netbean. It covers everything you would need to know about EJBs.
>
Again, is container managed bean good for a big project?
The question is too vague to be answered. It's a design decision that needs more details. -
JNDI Lookup in JSP fails for EJB 3.0
I am new to Java technology. I read the EJB FAQ, NetBeans docs and may forum discussions and I am still confused with the error I am having.
Background:
I have developed a persistance bean and related sessions beans (similar to the customer-cmp-ear application in the Java App Server samples). Now I am trying to access this bean using a JSP. After deploying the war file in the App Server and try to access the page, I get the following error.
javax.naming.NameNotFoundException: No object bound to name java:comp/env/ConsumerSessionLocal
After reading many articles, I understood that I dont have to prepare any descriptors, or JAR files for EJB 3.0.
Environment Details:
Java App Server Ver 9.0
NetBeans 5.5
I normally build the war files using NetBeans.
I use App Server Admin console to deploy the web applications using the above war file.
EJB details:
Persistance EJB : person.java
Session Objects
Consumer.java (this implements ConsumerSessionLocal, ConsumerSessionRemote). This Stateless bean accesses the methods in person.java.
ConsumerSessionLocal.java - local interface
ConsumerSessionRemote.java - remote interface
SearchConsumer.jsp
This JSP page is calling the ConsumerSessionLocal using the JNDI lookup through InitialContext.
Here is the Code snippet:
try {
InitialContext ic = new InitialContext();
Object o = ic.lookup("java:comp/env/ConsumerSessionLocal");
ConsumerSessionLocal consSession = (ConsumerSessionLocal) o;
I am able to see the jsp page in the browser, however, after a submit action, I get the Java Naming Exception error.
javax.naming.NameNotFoundException: No object bound for java:comp/env/ConsumerSessionLocal
I would appreciate your help/any of your thoughts.
Thanks in advance.
-RamI did not really solve it. Instead I used some of the tutorials that used JNDI lookup and modified those as my way forward. I did not really find out exactly what I was doing wrong.
/Anders -
Can't create a JAXB binding for ejb-jar.xml using xjc
Hi all,
I have been trying to build a JAXB binding for EJB deployment descriptors, mainly because I have to update a hand-cranked ejb-jar.xml file on the fly with some additions that have come from a code generator.
I have tried to use
xjc ejb-jar_2_1.xsd j2ee_1_4.xsd ejb-jar_2_1.xsd
xjc on the schema definitions I found at http://java.sun.com/xml/ns/j2ee/ but I can't get it to work. It produces reams of errors, see below for a short extract.
Of course, someone could put me out of my misery and tell me where to find a binding that someone else has done. I can't be the first chimp on the planet that has wanted to do this!
Any help much appreciated.
errors:
[WARNING] warning: "blockDefault" attribute of <schema> is not supported
line 3 of xml.xsd
[WARNING] warning: "finalDefault" attribute of <schema> is not supported
line 3 of xml.xsd
[WARNING] warning: <key> identity constraint will be ignored by JAXB validation
line 117 of j2ee_web_services_client_1_1.xsd
[WARNING] warning: <key> identity constraint will be ignored by JAXB validation
line 115 of ejb-jar_2_1.xsd
[WARNING] warning: <keyref> identity constraint will be ignored by JAXB validation
line 129 of ejb-jar_2_1.xsd
[WARNING] warning: <key> identity constraint will be ignored by JAXB validation
line 145 of ejb-jar_2_1.xsd
[WARNING] warning: <keyref> identity constraint will be ignored by JAXB validation
line 159 of ejb-jar_2_1.xsdException initializing 'oracle.dbtools.raptor.MonitorJDBCAddin' in extension 'Oracle SQL Developer': oracle.classloader.
util.AnnotatedNoClassDefFoundError:
Missing class: oracle.jdbc.OracleDriverThe Oracle driver is not on the classpath. -
How to set up XMLA webservice for Essbase 7.1.5?
<p>Hi</p><p> </p><p>I would like to set up XMLA webservice for Essbase so that I canquery Essbase OLAP databases on the web using XMLA Discover andExecute methods from client application.</p><p> </p><p>Will anybody point to the right document / provide me with anyinfo?</p><p> </p><p>Thanks</p><p>Shailesh Valera</p>
It is not a supported feature for home screen wallpaper.
-
How to call webservice for each record in a table using ODI
Hi
I am new to ODI and Webservice. I want to invoke a scenario in ODI using web service. I hava a weblogic application server with axis 2 deployed.
But I want call webservice for each record in a table
For eg: "EMP" table have 50 records, for each record web service should invoke
Can any one help me on it.
Thanks,
phani
Edited by: user12774166 on Jun 6, 2010 11:16 PMIf your goal is "call" a web service, Jason's Straub's [flex-ws-api|https://flex-ws-api.samplecode.oracle.com/] is by far the best I've seen. You might want read more about it on [his blog|http://jastraub.blogspot.com/search?q=+flex_ws_api+].
Tyler Muth
http://tylermuth.wordpress.com
[Applied Oracle Security: Developing Secure Database and Middleware Environments|http://sn.im/aos.book]
Maybe you are looking for
-
How to export a file keeping the original timecode
Hello all, I'm struggling to find out the way to do the following: I have an entire footage file and from that I need to cut specific interviews to be translated however I must keep the original timecode where I extracted these interviews from so the
-
Writing to large file takes an increasing​ly long time.
We are acquiring a large amount of data and streaming it to disk. We have noticed that when the file gets to be a certain size it takes an increasingly longer time to complete the write operation. Of course, this means that during these times our D
-
hi gurus, Can u tell me please, I have activated purchase base accounting,maintained EKG & EIN. my concern is when i do procurement for any cost center & third party ,at the time of GR my consumption account is debited.here my purchasing g/L is not
-
Oracle 9.2.06 Error
Hi, I am using ADODB from VB6 to connect to Oracle server. Recently there was an org wide upgrade of Oracle client and server to 9i. The code was designed for 8i but worked without any issues in 9i (9.2.0.1). But there was a security patch applied so
-
I am trying to update from: S820_ROW_S222_141121 to S820_ROW_S223_150119 Scenario: It reboots, starts the installation, and stops short mid way with an error. Upon hitting the power button, it says- "Installing update... Verifying current system...