Call authenticate service in EJB
Hi Experts
I'd developed a ejb project, and in this project i imported a service from esworkplace. I need to authenticate when i call this service, but i don't know how can i do this. I think is necessary http authentication.
I created a service group, but didn't work.
I use NW 7.1 EHP1.
Someone can help me to resolve this?
Marcos
Edited by: Marcos Brandao on Jun 23, 2009 6:21 PM
Hi Alka
Thanks for your reply
I've done this, but the error is happen.
This is my code:
((BindingProvider) port).getRequestContext().put(BindingProvider.USERNAME_PROPERTY,"S000XXXXXXX");
((BindingProvider) port).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,"XXXXXXXXXXXXX");
and the message error returned:
javax.ejb.EJBException: (Failed in component: xxxx.com.br/crvp~ear~services)
Exception raised from invocation of public br.com.xxxxxxxxx.xi.apo.global.ResourceSimpleByPlantResponseSync br.com.xxxxxxxxx.xi.apo.global.QueryCriticalResourceInImplBean.findCriticalResourceByPlant(br.com.xxxxxxxxx.xi.apo.global.ResourceSimpleByPlantQuerySync)
throws br.com.xxxxxxxxx.xi.apo.global.StandardMessageFault_Exception method on bean instance [email protected]da952
for bean xxxx.com.br/crvp~ear~services*annotation|xxxx.com.br~crvp~ejb~services.jar*annotation|QueryCriticalResourceInImplBean
in application xxxx.com.br/crvp~ear~services.; nested exception is: javax.xml.ws.WebServiceException:
Invalid Response code (401). Server <http://erp.esworkplace.sap.com/sap/bc/srt/xip/sap/ecc_workcentre001qr/version2?sap-client=800> returned message <Unauthorized>.
javax.xml.ws.WebServiceException: Invalid Response code (401).
Server <http://erp.esworkplace.sap.com/sap/bc/srt/xip/sap/ecc_workcentre001qr/version2?sap-client=800> returned message <Unauthorized>.
Maybe i forget some steps, i just don't put the ENDPOINT_ADDRESS_PROPERTY property in BindingProvider, but others examples don't have, and if i put, the errors continues.
Any ideia?
Regards
Marcos
Similar Messages
-
Calling Web Service from EJB using HTTP Client
Hi,
Scenario:
I need to Call a Web Service from an EJB Application.I used HttpClient for calling the Web Service in the EJB Application. When i call the execute method of the HttpCLient it throws an exception
The element type "META" must be terminated by the matching end-tag "</META>"
The input XML does not have a node called META.
When i call the Web Service using Http Client form an Java Application it is working fine.
Kindly Suggest me the changes/steps that needs to be done
Regards,
S.V.Satish KumarHi Manish,
SOAP adapter does pass the message to XI (this message contains SOAP envelope although XI expects to get message without it), and during the mapping step i get "Runtime Exception in Message-Mapping transformatio~".
I suppose it's because i created proxy manually. I did so because when i imported WSDL, and tried to generate proxy in CRM, i got an error message that said that proxy couldn't be generated because external definitions are only allowed in XI 3. But my XI version is 3.0! And when I generate the same proxy in my R/3 system that is installed on WAS 640, it works.
What can I do?
Cheers,
Anya. -
Calling Tuxedo Service using BEA Jolt.
I'm trying to call Tuxedo service from java stored procedure using BEA JOLT.My normal java client works fine but when i use the same client as java stored procedure i get following error message :
can not connect to any //lucy:9021(host:port)
Reason:Nwhdlr:can not open socket
I've successfully loaded all required JOLT jar files using loadjava and created the procedure successfully .Java code is given below :
import bea.jolt.*;
import java.sql.*;
public class JoltToTux
public static void callTuxService() throws Exception
JoltSession session;
JoltSessionAttributes sattr;
JoltRemoteService toupper;
JoltTransaction trans;
String userName=null;
String userPassword=null;
String appPassword=null;
String userRole=null;
String outstr;
try {
sattr = new JoltSessionAttributes();
sattr.setString(sattr.APPADDRESS, "//lucy:9021");
sattr.setInt(sattr.IDLETIMEOUT, 300);
session = new JoltSession(sattr, userName, userRole,userPassword, appPassword);
toupper = new JoltRemoteService ("CB_EXESUB", session);
toupper.setString("CLFY_SUB", "PingSrvr");
toupper.call(null);
System.out.println( "Call to Tuxedo complete" );
outstr = toupper.getStringDef("WF_MESSAGE","" );
System.out.println("return string : " + outstr);
session.endSession();
System.exit(0);
} //end of try
catch (Exception e) {
// System.err.println(e.getMessage());}
e.printStackTrace();
} // end main
public static void main( String args[] ) {
try {
JoltToTux jt = new JoltToTux();
jt.callTuxService();
catch ( Exception e0 ) {
e0.printStackTrace();
} // end ToUpper
thanks
anuragAms,
You can't do that with JOLT. You will need to use the WTC product,
currently in beta - see WTC Questions and Answers
Regards,
Peter.
Got a Question? Ask BEA at http://askbea.bea.com
The views expressed in this posting are solely those of the author, and
BEA
Systems, Inc. does not endorse any of these views.
BEA Systems, Inc. is not responsible for the accuracy or completeness of
the
information provided
and assumes no duty to correct, expand upon, delete or update any of the
information contained in this posting.
Ams wrote:
Hi Manoj,
I want to call a tuxedo service and also want to update
database (using entity beabs) in same transaction so I
can't use AUTOTRAN , Am I right ?
I am using bea.jolt.pool.SessionPool's startTransaction
method to start a transaction and passing this
to SessionPool's call method.
Ams.
"Manoj SASIDHARAN" <[email protected]> wrote:
Hello Ams,
Could u plz give more information abt the usage scenario. Another way
to test
would be to put AUTOTRAN=Y for the service in question.
HTH
regards
MS
"Ams" <[email protected]> wrote:
Hi,
I am calling Tuxedo service from ejb using jolt.
I want the service call in transaction started in ejb.
I am getting following error.
LIBTUX_CAT:481: ERROR: Service xa_start returned -7
Does jolt support transaction ?
Ams
[att1.html] -
HOW TO CALL A WEB SERVICE OR EJB FROM BPEL
HI
i want to call java web service or ejb from my bpel process. how can i do this.
i am using oracle soa10.1.3.1.0 and jdeveloper 10.1.3.1.0 and oracle database xe 10g.
thanks in advance K ROYYou could deploy your EJB or Java under a web service into your OC4J, after that, you invoke a partnerlink from BPEL to the destination of wsdl will do. Also don't forget to add in your XSD schema as well.
Thanks,
Jyno -
Calling a service through the EJB results in java.rmi.UnmarshalException
I have created a service on WLAI that does a simple query against a table (inventory
count by product ID). I have also created a command line class to call this service,
provide the correct XML schema input, and wait for a returning XML response.
The class compiles fine, but at runtime I am hitting a java.rmi.UnmarshalException,
with a nested exception of a java.lang.ClassNotFoundException on the class com.bea.wlai.client.bean.ApplicationViewBeanEOImpl_WLStub.
However, I am positive this class is in the classpath on the remote computer
running WLAI in the %INTEGRATION_HOME%\applinteg\lib\WLAIlib.jar file.
I have been told that RMI calls run off a separate classpath, and that may be
why this class cannot be found. However, I am not familiar with such situations.
Any ideas or thoughts would be greatly appreciated. Please respond to this thread
with any thoughts or if you need any more information. Thanks.
Dan KimMaybe u must cast appMod to the generated class 'TestbcModuleEJBClient', in the automatically generated client project, instead of 'TestbcModule', that's only an interface. In this way appMod should find the implementation of your methods, and not only the declaration. That is:
appMod = (TestbcModuleEJBClient) home.create ();
Christian T.
null -
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 -
Calling Web service from Java Concurrent Program
Hi,
I created a Java concurrent program and created executable. Here is my code.
public void runProgram(CpContext ctx) {
String value = "Java Concurrent Program Testing";
Hello hell = new Hello();
String returnValue = hell.testURL(value);
if(returnValue.equalsIgnoreCase("TRUE")){
ctx.getLogFile().writeln("-- Java Concurrent Program Testing --", 0);
ctx.getOutFile().writeln("-- Java Concurrent Program Testing --");
ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL, "");
else{
ctx.getLogFile().writeln("-- Hello World! --", 0);
ctx.getOutFile().writeln("-- Hello World! --");
ctx.getReqCompletion().setCompletion(ReqCompletion.NORMAL, "");
}testURL() call the web service and get the response. but when I am selecting View Output option I am always geting out put as
-- Hello World! --I tested the logic of calling web service. It giving me out put "true". Here is my Web service calling code
public String testURL(String Value){
HttpURLConnection httpConn = null;
ByteArrayOutputStream bout = null;
String setWebServiceURLResponse = "";
String responseString="";
String outputString = "";
try{
httpConn = getHttpConnection();
bout = new ByteArrayOutputStream();
String xmlInput = soapBodyStart +
"<ns1:getTestURL>\n" +
" <ns1:URL>"+Value+"</ns1:URL>\n" +
" </ns1:getTestURL>"+
soapBodyEnd;
byte[] buffer = new byte[xmlInput.length()];
buffer = xmlInput.getBytes();
bout.write(buffer);
byte[] b = bout.toByteArray();
httpConn = setHttpConnectionRequest(b,httpConn);
//Read the response.
InputStreamReader isr = new InputStreamReader(httpConn.getInputStream());
BufferedReader in = new BufferedReader(isr);
//Write the SOAP message response to a String.
while ((responseString = in.readLine()) != null) {
outputString = outputString + responseString;
//Parse the String output to a org.w3c.dom.Document and be able to reach every node with the org.w3c.dom API.
Document document = parseXmlFile(outputString);
String formattedSOAPResponse = formatXML(outputString);
System.out.println("Formatted response = \n" +formattedSOAPResponse);
//NodeList nodes = document.getElementsByTagName("setWebServiceURLResponse");
//NodeList nodes = document.getElementsByTagName("getTestURLResponse");
NodeList nodes = document.getElementsByTagName("ns0:getTestURLResponse");
int len = nodes.getLength();
System.out.println("Inside testURL Node Lenght = "+ len);
for(int s=0; s<nodes.getLength() ; s++){
Node authenticateResultNode = nodes.item(s);
if(authenticateResultNode.getNodeType() == Node.ELEMENT_NODE){
Element authenticateResultElement = (Element)authenticateResultNode;
//NodeList authenticateResultValueNode = authenticateResultElement.getElementsByTagName("ns0:return");
//NodeList authenticateResultValueNode = authenticateResultElement.getElementsByTagName("return");
NodeList authenticateResultValueNode = authenticateResultElement.getElementsByTagName("ns0:return");
Element authenticateResultValue = (Element)authenticateResultValueNode.item(0);
NodeList textFNList = authenticateResultValue.getChildNodes();
//System.out.println("Authenticate Result : " + ((Node)textFNList.item(0)).getNodeValue().trim());
setWebServiceURLResponse = ((Node)textFNList.item(0)).getNodeValue();
//System.out.println("Authenticate Response in getAuthenticate method : " + authenticateresponse);
}//end of if clause
}//end of for loop with s var
System.out.println("Inside setWebServcieURLToFile response = " + setWebServiceURLResponse);
catch(Exception e){
e.printStackTrace();
return setWebServiceURLResponse;
}Where I am going wrong ?
Regards,
Ajay Sharmasample code:
static string url = "http://my.webservice.url"; ---------------> The actual web service URL
Call = new Call(url); --------------------------------------------------> The call object used by JAX-RPC
Object[] params = new Object[]{param1, param2};---------> build the call parameters
Boolean/Integer/Whatever result = call.invoke("method name", params);------>call the invoke method to get the result -
Calling web service from MBean weblogic cannot find type mapping file
When calling web service from custom MBean i get java.io.IOException.
java.io.IOException: unable to find the type mapping resource file for:
net.msl.sfx.ebooking.client.BookingPartiesServiceService
at weblogic.webservice.core.encoding.DefaultRegistry.<init>(DefaultRegis
try.java:67)
at weblogic.webservice.core.rpc.ServiceImpl.<init>(ServiceImpl.java:83)
at net.msl.sfx.ebooking.client.BookingPartiesServiceService_Impl.<init>(
BookingPartiesServiceService_Impl.java:22)
at net.msl.sfx.ebooking.service.EBookingService.getBookingParties(EBooki
ngService.java:59)
The types.xml file is placed in same jar file as the classes such as net.msl.sfx.ebooking.client.BookingPartiesServiceService_Impl.
When calling the same class/method from a EJB, everything works fine and the web service is called.i am having the same problem.
Do you have a solution now?
Thanks -
How do i call web services from SAP ABAP
Hello,
Ian working with .net team. they are using sap .net Connector to connect SAP. But my job is In SAP side when Purchase Requisition is created, I have to call web services from ABAP and i have to pass the Purchase Requisition number to web service(.net Program). Please help me how to call web services from ABAP and how to pass value. Any one help me with example.
Thanks
RaviKumarHi Ravi,
If you can call EJB from ABAP and from EJB call Web service which you want to call. I am giving code to write in EJB business method processFunction.
public void processFunction(Function function) {
IRepository repository;
repository = new Repository("TestRepository");
JCO.MetaData fmeta = new JCO.MetaData("ZTEST_EJB");
fmeta.addInfo("REQUTEXT", JCO.TYPE_CHAR, 255, 0, 0,
JCO.IMPORT_PARAMETER, null);
fmeta.addInfo("ECHOTEXT", JCO.TYPE_CHAR, 255, 0, 0,
JCO.EXPORT_PARAMETER, null);
fmeta.addInfo("RESPTEXT", JCO.TYPE_CHAR, 255, 0, 0,
JCO.EXPORT_PARAMETER, null);
repository.addFunctionInterfaceToCache(fmeta);
JCO.ParameterList input =
function.getImportParameterList();
JCO.ParameterList output =
function.getExportParameterList();
JCO.ParameterList tables =
function.getTableParameterList();
if (function.getName().equals("ZTEST_EJB")) {
output.setValue(input.getCharArray("REQUTEXT"),"ECHOTEXT");
output.setValue("This is a response " + table.getString("E_NAME") +" " + output.getName(1), "RESPTEXT");
else if (function.getName().equals("STFC_STRUCTURE")) {
JCO.Structure sin = input.getStructure("IMPORTSTRUCT");
JCO.Structure sout = (JCO.Structure)sin.clone();
try {
System.out.println(sin);
catch (Exception ex) {
System.out.println(ex);
output.setValue(sout,"ECHOSTRUCT");
output.setValue("This is a response from Example5.java","RESPTEXT");
}//if
Here REQUTEXT, ECHOTEXT are import parameter and RESPTEXT is the Export parameter of Function module ZTEST_EJB in SAP.
Here from this bisuness method you can call web service which you want and give back the result of webservice to ABAP F.M.
Regards,
Bhavik -
Calling web service slow in wls81sp6
Hi, I call a .Net secure (https) web service in my ejb. It returns in couple seconds in wls81sp4. But since I upgraded to wls81sp6, every time it takes more than 1 minute to return. That's quite surprise. What's changed? How can I get the performance back?
Things get worse when I need to call web service several times in one ejb call. Sometime if my data set is big I break into chunk and call web service in a loop. I always get timeout exception now. Is there anything special about wls81sp6 web service? ThanksQuestion is what technology of J2EE u are using!
If it is EJB, then the fastest way would be to generate one more webservice and connect this one to WD.
This way you also can check if the webservice delivers any data with the testing environment.
Regards,
Benny -
Hit TransitionException when call web service in bpm
hello, my mesage of exception like follows:
<br>
com.sap.glx.core.kernel.api.TransitionException: An exception occurred while executing the script "_FileIn:AUTOMATED_ACTIVITY_FI_Notice_PSP(
com.sap.glx.adapter.BPMNAdapter:Token_0_CSS_FileIn_58b390c7e1a007da73193237933adb39 token,
com.sap.glx.adapter.BPMNAdapter:Instance_0_CSS_FileIn_58b390c7e1a007da73193237933adb39 parent,
com.sap.glx.adapter.internal.ContainerAdapter:Context_0_IRO_58b390c7e1a007da73193237933adb39 context_0){
exit=new com.sap.glx.adapter.BPMNAdapter:Exit();
exit:addParameter(token);
exit:addParameter(parent);
exit:addParameter(context_0);
exit:onActivation("4B1F796E2DC84120E4AC11DEB8BF00016C0D596F", parent, token);
delete exit;
controller=new com.sap.glx.adapter.internal.ExceptionAdapter:ExceptionController();
controller:setContext(token);
delete controller;
callscope=new com.sap.glx.adapter.internal.TypeRegistry:Scope_20_FileIn_58b390c7e1a007da73193237933adb39(parent);
call=new com.sap.glx.adapter.UnifiedConnectivityAdapter:Call_3_FI_Notice_PSP_58b390c7e1a007da73193237933adb39(callscope);
request=callscope:instantiate("http://tsmc.com/csspoc/notice/ejb/sb/", "#entrustSendingNotice");
mapper=new com.sap.glx.adapter.internal.Transformer:DataMapper();
yves_in=new com.sap.glx.adapter.internal.Transformer:Data();
yves_out=new com.sap.glx.adapter.internal.Transformer:Data();
data=context_0:getData();
yves_in:setData("tsmc.com/filein/pc/iresolution/Pool/FileIn", "$tsmc.com/filein/pc/iresolution/Pool/FileIn:IRO", data, "F2E8AB22162217BCFE0495CA03E629FD");
yves_out:setData("http://tsmc.com/csspoc/notice/ejb/sb/", "$http://tsmc.com/csspoc/notice/ejb/sb/:entrustSendingNotice", request, "0B03C177B47A4396F51FAC817E2C3870");
mapper:map("4B1F796E2DCB4E62E4AC11DEB49600016C0D596F_58b390c7e1a007da73193237933adb39", yves_in, yves_out);
request=yves_out:getData("http://tsmc.com/csspoc/notice/ejb/sb/", "$http://tsmc.com/csspoc/notice/ejb/sb/:entrustSendingNotice", "0B03C177B47A4396F51FAC817E2C3870");
delete yves_in;
delete yves_out;
delete mapper;
call:setInputData("http://tsmc.com/csspoc/notice/ejb/sb/", "$http://tsmc.com/csspoc/notice/ejb/sb/:entrustSendingNotice", request);
response=callscope:instantiate("http://tsmc.com/csspoc/notice/ejb/sb/", "#entrustSendingNoticeResponse");
call:setOutputData("http://tsmc.com/csspoc/notice/ejb/sb/", "$http://tsmc.com/csspoc/notice/ejb/sb/:entrustSendingNoticeResponse", response);
call:invoke();
response=call:getOutputData("http://tsmc.com/csspoc/notice/ejb/sb/", "$http://tsmc.com/csspoc/notice/ejb/sb/:entrustSendingNoticeResponse");
mapper=new com.sap.glx.adapter.internal.Transformer:DataMapper();
yves_in=new com.sap.glx.adapter.internal.Transformer:Data();
yves_out=new com.sap.glx.adapter.internal.Transformer:Data();
yves_in:setData("http://tsmc.com/csspoc/notice/ejb/sb/", "$http://tsmc.com/csspoc/notice/ejb/sb/:entrustSendingNoticeResponse", response, "0B03C177B47A4396F51FAC817E2C3870");
mapper:map("4B1F796E2DD00950E4AC11DEC9F000016C0D596F_58b390c7e1a007da73193237933adb39", yves_in, yves_out);
delete yves_in;
delete yves_out;
delete mapper;
delete call;
delete callscope;
token:state=14;
com.sap.glx.core.kernel.execution.transition.ScriptTransition.execute(ScriptTransition.java:69)
com.sap.glx.core.kernel.execution.transition.Transition.commence(Transition.java:241)
com.sap.glx.core.kernel.execution.LeaderWorkerPool$Follower.run(LeaderWorkerPool.java:118)
com.sap.glx.core.resource.impl.common.WorkWrapper.run(WorkWrapper.java:58)
com.sap.glx.core.resource.impl.j2ee.ServiceUserManager$ServiceUserImpersonator$1.run(ServiceUserManager.java:116)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAs(Subject.java:337)
com.sap.glx.core.resource.impl.j2ee.ServiceUserManager$ServiceUserImpersonator.run(ServiceUserManager.java:114)
com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
java.security.AccessController.doPrivileged(Native Method)
com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:169)
com.sap.glx.core.kernel.api.TransitionException: An exception occurred while executing the script command "call:invoke()"
com.sap.glx.core.kernel.trigger.config.Script.execute(Script.java:675)
... (11 more)
com.sap.glx.core.kernel.api.TransitionException: com.sap.glx.adapter.api.AdapterException: Unexpected exception occured.
com.sap.glx.core.dock.impl.DockObjectImpl.invokeMethod(DockObjectImpl.java:465)
com.sap.glx.core.kernel.trigger.config.Script$MethodInvocation.execute(Script.java:247)
... (12 more)
com.sap.glx.adapter.api.AdapterException: Unexpected exception occured.
com.sap.glx.adapter.app.ucon.UnifiedWebServiceCallObject.invokeWebServiceOperation(UnifiedWebServiceCallObject.java:333)
com.sap.glx.adapter.app.ucon.UnifiedWebServiceCallClass.invoke(UnifiedWebServiceCallClass.java:197)
... (14 more)
com.sap.glx.adapter.api.AdapterException: Exception occured during wsdas initialization.
com.sap.glx.adapter.app.ucon.UnifiedConnectivityAdapter.createNewWSDAS(UnifiedConnectivityAdapter.java:654)
com.sap.glx.adapter.app.ucon.UnifiedWebServiceCallClass.getWSDAS(UnifiedWebServiceCallClass.java:53)
... (16 more)
com.sap.engine.services.webservices.espbase.discovery.TargetNotMappedException: Logical Target CSD.SystemHome.f7sap03 not mapped to a physical system.
com.sap.esi.esp.service.server.query.discovery.DestinationsHelperImplSoa.getLogicalDestination(DestinationsHelperImplSoa.java:831)
com.sap.esi.esp.service.server.query.discovery.DestinationsHelperImplSoa.getWSDLUrl(DestinationsHelperImplSoa.java:985)
com.sap.engine.services.webservices.espbase.client.dynamic.GenericServiceFactory.getWSDLUrl(GenericServiceFactory.java:582)
com.sap.engine.services.webservices.espbase.client.dynamic.GenericServiceFactory.createService_NewInstance(GenericServiceFactory.java:338)
com.sap.engine.services.webservices.espbase.client.dynamic.GenericServiceFactory.createService(GenericServiceFactory.java:321)
com.sap.engine.services.webservices.espbase.wsdas.impl.WSDASImpl.<init>(WSDASImpl.java:33)
com.sap.engine.services.webservices.espbase.wsdas.impl.WSDASFactoryImpl.createWSDAS(WSDASFactoryImpl.java:39)
... (18 more)
<br>
i have no idea why and how it happen, it been work well.Vic,
the vital piece of information in the error stack is this line:
com.sap.engine.services.webservices.espbase.discovery.TargetNotMappedException: Logical Target CSD.SystemHome.f7sap03 not mapped to a physical system.
It seems that there is something wrong with the configuration of the target system for the called Web Service in your AS Java.
Best regards,
Oliver
Edited by: Oliver Goetz on Dec 11, 2009 5:24 PM
Edited by: Oliver Goetz on Dec 11, 2009 5:24 PM -
Calling Portal Service using result as Java Bean Model impossible?
Hello folks,
we try to achieve to call a portal service (working) which gives as a result a list of object of type com.foo.Report. We want to make use of this class as a model class, so we have the class as a model node in the context. The class itself is part of the service DC.
Unfortunately at run time it gives us a NoClassDefFound Exception of com.foo.Report.
As the com.foo.Report is part of the same DC as the service, it is no option to add the PAR public part to the used DCs of the WD DC because then there is this type conflict when we call the service (service look up). Or am I wrong and this is the way to do it? I mean I struggled quite a while to get the service look up right and needed to remove all the PAR/lib used DCs from the used DCs of the WD Project, when I got it working this Model error came up. I also tried to put the Model class in a separate DC but that caused the same error.
how is it possible to call a Portal service from WD and using it's return vale as a Model class
our system iis 7.0.17
best
StefanHi,
Refers the following docs..
EJBs in Web Dynpro Application Using Wrapper Class
Here Java Bean Model used in web dynpro.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00be903b-8551-2b10-c28a-8520400c6451
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c
Accessing database table using EJB and web dynpro
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70929198-0d36-2b10-04b8-84d90fa3df9c
Oracle Connectivity with EJB using WebDynpro Application
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/oracle%2bconnectivity%2bwith%2bejb%2busing%2bwebdynpro%2bapplication
Hope it will help u.
thanks
Abhilasha -
How to call web-service using only java code
Hello, how to call web-service using only java code. I can call it from BPM process or Web Dynpro Java Application, but if I need to call it from ejb component?
I'm found answer:
Java and SAP Portal blog: How to call web service from java code example -
How to call Corba services in Oracle8i
With Oracle8i, we can implement Corba services within Oracle database. Client can call such service by
establishing a session with Oracle server. Now we have Corba services running on Unix (outside oracle
database). We want to use Java stored procedure to call such services within Oracle database. Can we
do it? How do we do it?
Thanks
LaneRefer to the Server docs in particular the "EJB and CORBA Developers Guide". There are also a good number of samples that will be under the:
/oracle_home/javavm/demo/examples/corba
direcory. -
Call another WebLogic's EJBs from resource adapter?
Is it possible to call another WebLogic's EJBs from a resource adapter?
A call to the javax.naming.InitialContext(Hashtable environment) results in a
VersioningError:
weblogic.common.internal.VersioningError: Incompatible service packs in CLASSPATH:
(BEA Systems, WebLogic Server 6.1 SP4 11/08/2002 21:50:43 #221641 , 6.1.4.0)
not compatible with
(BEA Systems, WebLogic Server 6.1 SP3 06/19/2002 22:25:39 #190835 , 6.1.3.0)
at weblogic.common.internal.VersionInfo.verifyPackages(VersionInfo.java:128)
at weblogic.common.internal.VersionInfo.<init>(VersionInfo.java:60)
at weblogic.common.internal.VersionInfo.initialize(VersionInfo.java:79)
at weblogic.kernel.Kernel.initialize(Kernel.java:122)
at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:101)
at weblogic.jndi.WLInitialContextFactoryDelegate.<init>(WLInitialContextFactoryDelegate.java:166)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:232)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:147)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:241)
at javax.naming.InitialContext.init(InitialContext.java:217)
at javax.naming.InitialContext.<init>(InitialContext.java:193)
at java.lang.reflect.Constructor.newInstance(Native Method)
I'm not sure it will always be possible to match the version, although here upgrading
the SP3 to SP4 will probably be done soon.
Does anyone have experience with this?
Or better: is there any documentation on this issue?
Hi Hans,
Here is the link for Weblogic SP3 / SP4 vulnerability and comparison for
http://216.239.53.104/search?q=cache:RqqaQ3HZdwoJ:www.nipc.gov/cybernotes/2003/cyberissue2003-06.pdf+Versioning+Error+in+BEA+weblogic+6.1+SP3+and+SP4&hl=en&ie=UTF-8
Hope this will help you.
Let me know if u have any further problems.
rgds
KSK
"Hans Bausewein" <[email protected]> wrote:
>
>
>Is it possible to call another WebLogic's EJBs from a resource adapter?
>
>A call to the javax.naming.InitialContext(Hashtable environment) results
>in a
>VersioningError:
>
>weblogic.common.internal.VersioningError: Incompatible service packs
>in CLASSPATH:
>(BEA Systems, WebLogic Server 6.1 SP4 11/08/2002 21:50:43 #221641 ,
>6.1.4.0)
>not compatible with
>(BEA Systems, WebLogic Server 6.1 SP3 06/19/2002 22:25:39 #190835 , 6.1.3.0)
> at weblogic.common.internal.VersionInfo.verifyPackages(VersionInfo.java:128)
> at weblogic.common.internal.VersionInfo.<init>(VersionInfo.java:60)
> at weblogic.common.internal.VersionInfo.initialize(VersionInfo.java:79)
> at weblogic.kernel.Kernel.initialize(Kernel.java:122)
> at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:101)
> at weblogic.jndi.WLInitialContextFactoryDelegate.<init>(WLInitialContextFactoryDelegate.java:166)
> at java.lang.Class.newInstance0(Native Method)
> at java.lang.Class.newInstance(Class.java:232)
> at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:147)
> at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:241)
> at javax.naming.InitialContext.init(InitialContext.java:217)
> at javax.naming.InitialContext.<init>(InitialContext.java:193)
> at java.lang.reflect.Constructor.newInstance(Native Method)
>
>
>
>I'm not sure it will always be possible to match the version, although
>here upgrading
>the SP3 to SP4 will probably be done soon.
>
>Does anyone have experience with this?
>
>Or better: is there any documentation on this issue?
>
Maybe you are looking for
-
Beginners Q: Motion tracking - Cannot move trackpoint
Hi all, this seems to be simple: start motion tracking, move your trackpoint to the correct place that needs to be tracked. Problem: I see the trackpoint, but cannot move it to its place. The only way to do that, is to close AE, reopen AE & reope
-
Reg Web AS Java Add in installation
Hi , I am trying to install Web AS java add-in in a DEV system. During the installation process the it prompts for a production client and its DDIC password.. Why do i need a prodction client for a DEV system. Is this mandatory to have a production c
-
Trouble encoding AVI file into proper FLV. *Please Help*
I have a small AVI file with uncompressed video. CS3 converts it perfectly to an FLV accept for the fact that I can't output to 16:9 CS4 can and does convert it and keeps the 16:9 aspect ratio. The problem is CS4 adds all kinds of metadata crap which
-
Horizontal scroll bar with Line charts
Hi, I want a scrollable bar attached to x-axis as in this example(fourth one in the following URL---http://www.connectedpixel.com/blog/scrollingcharts).I able to find these feature only with ColumnCharts .Can any one tell whether can we apply
-
Photoshop CS6 - 'Two computers at same time' question
Hi guys. I've tried searching for this question before but I couldn't find a definitive answer to it in the threads (maybe that's for a reason!). Now, clearly the TOS stipulate about using PS on one computer at a time. I understand that, as otherwi