EJBs and web services  in Application server  ??

Hi all,
I just wanted to ask for a help in a scenario that i am facing:
I have a Application that relies on EJBs for Business Logic
I basically use the Jboss A/s[4.2.2 GA] server for the same and now there is a need to Expose these bean methods through a web service
so that our web team can make use of the same Business logic.
Currently i have implemented a End point interface that my Bean class implements so that i can expose
my bean methods to the web team
Req:
I want to create a separate Enterprise Bean which resides in the same JVM as my Application bean , and acts as a wrapper for my application bean
Also,
Further elaboration of the problem is as follows:
THE existing Application beans Remote interface has all the business methods that i want to expose.
The new bean should act as a delegate which intercepts the web clients call extracts the request from the call
and passes it to the application bean methods.
So this basically requires that new bean should be able to communicate with my application bean +(Which is BTW a stateless session bean)+
and pass on clients requests to the same.
Kindly provide suggestion for the same or any ideas as soon as possible
thanks again
veneet
Edited by: RainaV on 14 May, 2009 6:49 PM
Edited by: RainaV on 14 May, 2009 6:57 PM

Let me make it more clear for everyone
Let [A] be my application bean which has all the business Logic.
is a new wrapper bean that needs to communicate to bean [A] for accessing the Business Logic
The requirement for creating Bean[B] is two folds
1) it will provide a wrapper class for breaking down the web client requests,
which are in  XML format;
into simpler data structure which can be passed as parameters to bean [A}.
2)This bean [B] will send the response back to the web client who is in need of the service
Now as pointed out by one of the guys why not create a Local interface that is not possible at this point as Most of the session bean methods have been declared to throw
Remote Exceptions and i am faced with the issue that this Design mistake is irreversible due to the Size of the Code and other factors
Now i have been looking and some Alternatives for the same .
The problem is i have not been able to find any way to do the same and need suggestions and ideas if anyone has some on this issue
i hope this clears the matter
thanks again
veneet

Similar Messages

  • Error during EAR deployment with EJB and web service

    I created a simple stateless EJB with one method called echo that returns a string.  I created a web service using the wizard, did a build and deployed.  The deployment did not report an error, but the logs in the visual administrator showed the follwoing message, and the web service did NOT deploy.
    Am I missing something related to EJB and web service security?
    PLEASE HELP ME.
    >>> Warning: delete security configuration [apps/com.areva/ear/ejb/security/com.areva~ejb.jar]
    [EXCEPTION]
    java.lang.Exception
         at com.sap.engine.services.security.server.PolicyConfigurations.unregisterPolicyConfiguration(PolicyConfigurations.java:153)
         at com.sap.engine.services.ejb.EJBAdmin.remove(EJBAdmin.java:2538)
         at com.sap.engine.services.deploy.server.application.RemoveTransaction.removeApplication(RemoveTransaction.java:294)
         at com.sap.engine.services.deploy.server.application.RemoveTransaction.prepare(RemoveTransaction.java:178)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:299)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:321)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:3028)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.remove(DeployServiceImpl.java:820)
         at com.sap.engine.services.deploy.server.DeployRuntimeControlImpl.remove(DeployRuntimeControlImpl.java:271)
         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:324)
         at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
         at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
         at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
         at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
         at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:400)
         at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
         at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
         at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
         at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:157)
         at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:220)
         at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:803)
         at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
         at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
         at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:291)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)

    I have the same message. I am running sp11.
    Does anyone have an answer for this?????
    >>> Warning: delete security configuration [apps/avalero.com/rtfa-ear/contextRoot]
    [EXCEPTION]
    java.lang.Exception
         at com.sap.engine.services.security.server.PolicyConfigurations.unregisterPolicyConfiguration(PolicyConfigurations.java:153)
         at com.sap.engine.services.servlets_jsp.server.container.WebContainerHelper.removeSecurityResources(WebContainerHelper.java:905)
         at com.sap.engine.services.servlets_jsp.server.container.WebContainerHelper.remove(WebContainerHelper.java:447)
         at com.sap.engine.services.servlets_jsp.server.container.RemoveAction.remove(RemoveAction.java:50)
         at com.sap.engine.services.servlets_jsp.server.container.WebContainer.remove(WebContainer.java:150)
         at com.sap.engine.services.deploy.server.application.RemoveTransaction.removeApplication(RemoveTransaction.java:294)
         at com.sap.engine.services.deploy.server.application.RemoveTransaction.prepare(RemoveTransaction.java:178)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:299)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:323)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:3033)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.remove(DeployServiceImpl.java:821)
         at com.sap.engine.services.deploy.server.DeployRuntimeControlImpl.remove(DeployRuntimeControlImpl.java:271)
         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:324)
         at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
         at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
         at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
         at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
         at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:400)
         at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
         at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:255)
         at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
         at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
         at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
         at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:157)
         at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:220)
         at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:803)
         at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
         at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
         at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:294)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)

  • Deployment Aborted (EJB and Web Services)

    Hello All.
    In SAP Netweaber Developer Studio I created a Project with an Entity EJB and another Sesion EJB.
    The Sesion Bean uses the Entity Bean (persistence). After this, it generate a Web Services.
    After building the project ejb and project EAP. Within the Project EAP I took file Persistent_EAP.ear and to make respective deploy on the Server, in the Deploy out View I get the message 'Deploy Aborted'.
    The log of the message say,
    ++Sep 30, 2011 5:43:05 PM  Info: - Starting deployment -++
    ++Sep 30, 2011 5:43:05 PM  Info: Error handling strategy: OnErrorStop++
    ++Sep 30, 2011 5:43:05 PM  Info: Prerequisite error handling strategy: OnPrerequisiteErrorStop++
    Sep 30, 2011 5:43:05 PM  Info: Update strategy: UpdateAllVersions
    Sep 30, 2011 5:43:05 PM  Info: Starting deployment prerequisites:
    Sep 30, 2011 5:43:10 PM  Info: Loading selected archives...
    Sep 30, 2011 5:43:10 PM  Info: Loading archive 'C:\usr\sap\J2E\JC01\SDM\program\temp\temp38292Persistencia_Mod_EAP.ear'
    Sep 30, 2011 5:43:16 PM  Info: Selected archives successfully loaded.
    Sep 30, 2011 5:43:16 PM  Info: Actions per selected component:
    Sep 30, 2011 5:43:16 PM  Info: Update: Selected development component 'Persistencia_Mod_EAP'/'sap.com'/'localhost'/'2011.09.30.16.03.19'/'1' updates currently deployed development component 'Persistencia_Mod_EAP'/'sap.com'/'localhost'/'2011.09.30.16.03.19'/'0'.
    Sep 30, 2011 5:43:16 PM  Info: Ending deployment prerequisites. All items are correct.
    Sep 30, 2011 5:43:16 PM  Info: Saved current Engine state.
    Sep 30, 2011 5:43:16 PM  Info: Starting: Update: Selected development component 'Persistencia_Mod_EAP'/'sap.com'/'localhost'/'2011.09.30.16.03.19'/'1' updates currently deployed development component 'Persistencia_Mod_EAP'/'sap.com'/'localhost'/'2011.09.30.16.03.19'/'0'.
    Sep 30, 2011 5:43:16 PM  Info: SDA to be deployed: C:\usr\sap\J2E\JC01\SDM\root\origin\sap.com\Persistencia_Mod_EAP\localhost\1\2011.09.30.16.03.19\temp38292Persistencia_Mod_EAP.ear
    Sep 30, 2011 5:43:16 PM  Info: Software type of SDA: J2EE
    Sep 30, 2011 5:43:16 PM  Info: ***** Begin of SAP J2EE Engine Deployment (J2EE Application) *****
    Sep 30, 2011 5:46:13 PM  Info: Begin of log messages of the target system:
    11/09/30 17:43:16 -  ***********************************************************
    11/09/30 17:43:21 -  Start updating EAR file...
    11/09/30 17:43:21 -  start-up mode is lazy
    11/09/30 17:43:22 -  EAR file updated successfully for 922ms.
    11/09/30 17:43:22 -  Start updating...
    11/09/30 17:43:25 -  EAR file uploaded to server for 1594ms.
    11/09/30 17:46:13 -  ERROR: Not updated. Deploy Service returned ERROR:
                         java.rmi.RemoteException: Cannot deploy application sap.com/Persistencia_Mod_EAP..
                         Reason: Webservices common deployment exception! The reason is: Error occurred, trying to update web services for application sap.com/Persistencia_Mod_EAP. . Additional info: none; nested exception is:
                         +     java.lang.Exception: com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices common deployment exception! The reason is: Error occurred, trying to update web services for application sap.com/Persistencia_Mod_EAP. . Additional info: none+
    I don't know what is wrong, when say: Error occurred, trying to update web services for application...
    Could someone please help me?
    Thanks in advanced,
    Esther

    Dear Esther,
    This exception usually happens when the application is not packaged properly.
    It seems that the J2EE engine web services deployment processor is looking for a descriptor which is absent in the jar file.
    This could happen for instance if you forget to save all the modified files before rebuilding.
    Unfortunately I cannot tell you which web service descriptor is missing, without looking at the packaged application.
    Try the following:
    1) Regenerate your virtual interfaces
    2) Save all modified files
    3) Rebuild the application
    4) Deploy the application again.
    Best Regards,
    Abhishek

  • EJB and Web Services

    Hi,
    I have created a EJB project with Stateless Session Bean having just one method, Java persitence (connnection to MS SQL). I have added this project to the Enterprise project as well.From the context menu when I select to create Web Service. The method is not selectable.
    What is going wrong?
    Can somebody please help?
    Best regards,
    Dharmi

    Hi Dharmi,
    How did you do that? Create an EJB which connects to MS SQL?
    Are there specific jars or something that have to be added to the EJB?
    Did you also have to install a SQL server driver and such?
    Can you provide a step-by-step for the creation of an EJB which gathers data from MS SQL?
    Kind regards
    Allan

  • Change/Configure Host and Port for the Web Service Proxy with Server

    Hi,
    Is there a way to configure Host and Port in generated proxy for Web service depending upon server. (ADF 11g)
    Scenario:
    We are consuming Credit Card web service from a service provider and have different Host and Port details for development, QA and Prod.
    So we created proxy classes using wsdl for development and things work fine, but when deploying code to QA or Prod we need to change the Host
    and Port details.
    Is their a way we could user variable's for Host and Port which looks to some configuration file to evaluate their values
    based on server.
    I am a bit new to this web service .. will appreciate if someone could provide an example.
    Thanks.

    Are you using Web Service Proxy or Web Service Data Control?
    If you are using Web Service Proxy. Right click on your Proxy --> Properties --> Port Endpoints. Here you can change the IP & Port details for each port.
    Venkat

  • Custom Portal Services and Web services

    Can you please tell me what exactly are "custom portal services" and "web services" with a business like/ real life example?
    How do you go about developing deploying and utilizing these services in Portal?
    Thanks.

    Hi navin,
    Thanks for the par file.
    Duly awarded points.
    I need your help again.
    I wish to use the method
    public String getWelcomeString(String name)
    in my own portal application to test usage of portal services.
    So I uploaded your par file on my server.
    Then I added the api and core jar files which came along with your par in my project as external jar files.
    I imported com.wickes.WickesService.*;
    Next, to use the service I coded:
    IPortalRuntimeResources rs =
    PortalRuntime.getRuntimeResources();
         IWickesService ws = (IWickesService) rs.getService(IWickesService.KEY);
    But now I am stuck and I dont know how to proceed.
    Please help.

  • Injecting both SessionContext & WebServiceContext in an EJB 3 Web Service

    Hi,
    Is it valid/legal to inject both of WebServiceContext and SessionContext in an EJB 3 Web Service, e.g.:
    @WebService
    @Stateless
    public class MyService
    @Resource private SessionContext sessionContext;
    @Resource private WebServiceContext webServiceContext;
    }Thanks in advance.

    Hello Bhupesh,
    A Classpath has to be defined for a server process to avoid the exception "NoClassDefFoundError"
    Refer to the below url for more clarity
    http://help.sap.com/saphelp_erp2005/helpdata/en/06/24d17099f2f245822fce0ba1ab4065/frameset.htm
    Thanks,
    Preethika

  • Can I deploy web service on APEX server

    I have APEX 3.1.2 on 11g database.
    I need to pull data from other oracle 9i databases into APEX application. I have created web service on my pl/sql package to pull data from 9i databases and deployed service on my local oc4j instance (within jdeveloper). My APEX app pull data from multiple oracle 9i database. Now I need to move my web service to my dev/test environment.
    Can I deploy web service on APEX server? or do I need to deploy on another web server?
    I know I can easily pull the data from other oracle 9i databases using DB link. I want to explore Web services option to just to see is it possible to pull data from multiple sources into APEX app using web service running from APEX server?.
    Any help on this will be appreciated.
    RK Shah
    Edited by: RK Shah on Apr 7, 2009 7:27 PM

    I am in the same situation. Consuming a web service is easy with APEX. But publishing one needs a web server that is more complex than the one that comes with APEX for free.
    I am exploring the possibility of building the web service in Jdeveloper as you have. Then I will make a WAR file that I will publish to an apache tomcat J2EE server that another department runs. I believe it will work since all the components required should be in the WAR file.
    I am new at this. I will let you know how it works out.
    The other possibility is to upgrade the appserver to the full Oracle Fusion server (maybe). This may be expensive and be too much for just a simple web service. But then the publish to application server from jdeveloper is super easy.

  • JCAPS UDDI - Problem Using the Web Service Management Application

    Hi everyone, this is my problem:
    1.) I installed the JCAPS UDDI Server in a Solaris. <-- Ok
    2.) In the eManager I installed the Web Services Access Manager. <-- Ok
    3.) I started the UDDI server. <-- Ok
    4.) I check that the process is running (in Solaris). <-- Ok
    5.) I'm trying to load the Web Service Management Application Login Page, but it doesn't show the page so I can't login and in consequence I can't publish, remove, view, and search WSDLs by using the Web Service Management Application.
    I appreciate some help about this.
    Regards

    Yes, I am connecting to the same system where we have data..
    Anirban

  • Xlet and web services

    Hello, I'm new to Xlets. I would like to ask, whether it is possible to use web services in Xlets. If yes, can you please provide me with some link to any tutorial or source code? Thanks.

    Hello.
    I was able to hard-code web service calling using HttpURLConnection class and sending soap messages via http connection. This worked correctly, nevertheless I don't find it as somehow sophisticated solution.
    Therefore I tried to use Axis to run web services on the server directly, without the need to hard-code soap messages.
    In this case, however, I got following error:
    java.lang.NoClassDefFoundError: javax/xml/rpc/Service
    I got this error while I tried to run my Xlet in Xletview as well as in Mimundo application. Compilation of this Xlet succeeded without errors. When I tried to call the web services in the same manner in console application, no error occurred during its run.
    Libraries for axis were added as external and were copied into Xletview directory.
    Do you have any idea why I got this error and/or ideas how to use some web service framework when programming Xlet?
    Thanks.

  • How To Access HTTPS Web Service  in Application Module

    I need to know how to access HTTPS web service in application module.
    If you can provide the tutorial or guidance to achieve this really appreciate.
    Thanks
    Sameera

    Use the Web Service Proxy wizard in JDeveloper to create a class that calls your Web service, and then call this class from code in your AM.
    http://docs.oracle.com/cd/E16340_01/web.1111/b31974/web_services.htm#CJAHGIEF

  • XML and Web Service Data Source Missing in Crystal Reports for VS

    I would like to use a Web Service as the data source for a Crystal Report that will be running outside of my Visual Studio application.  So setting the data source to the web service in code is not possible.  My understanding is Crystal Reports has a connection (in the Database Expert under New Connection) named XML and Web Service.  Here you can select web service and enter the WSDL URL for the web service.  However it does not appear in the list for Crystal Reports for Visual Studio.  Does this connection type come with the Visual Studio version of Crystal Reports and if not is their a way to obtain it? 
    Thank you for your assistance.

    None of the bundled versions of CR have the driver. Reason is that the driver responsible for these connections requires the Java framework and I suspect MS would not be too pleased if we installed the Java framework. The stand alone versions, since they are not part of any bundle can and do install the Java framework and the driver. Note that even the latest release of CR - CRVS2010 does not have the driver as it essentially becomes a bundle or a VS2010 plug-in.
    So, the short of it is; you have to obtain a stand-alone version of CR. I'd recommend CR 2008 (12.x) as CRXI R2 will run out of support in June of this year.
    - Ludek

  • Can't run wiki and web services at the same time?

    I'm a newbie with Lion Server, but I've been running several web sites successfully for about 6 months.  I'm up to Server 10.7.4.
    I've been trying ever since the first installation of Server to get the wiki service running.  I had absolutely no luck until I turned OFF the web service (always got the "URL does not exist" error when I tried to create a group wiki from inside the Server app).  With the web service off, it all starts up fine and I created my first wiki (woohoo).  Turning web service back on kills access to the wiki.  I don't find reference to this in any of the dicussions, and especially not in Apple's documentation.
    Are the Wiki and Web services mutually exclusive?  Or is there a way around this?
    I'm using Dyndns to provide me with sub-domains to use, and I've dedicated one of them to the wiki service.  Traffic comes in on port 8080, where my web sites are on port 80.
    Thanks for any pointers...
    edbok

    LR supports tethering using a Canon DLL and EOS Utility probably also supports tethering or at least uses something from a similar Canon DLL.  You probably cannot have two different versions of that DLL loaded at the same time, so it makes sense there are problems.

  • Help to deploy EJB  component on Sun's application server

    hi all,
    i am using jDev10g as IDE. but i cant deploy my EJB component on sun microsystem application server being in my IDE.
    guid me to overcome this task
    thanks
    regerds
    nuwan

    The only non-Oracle application servers supported in JDeveloper seem to be WebLogic, Tomcat, and JBoss. You might want to check the JDeveloper forum over at Oracle, someone might have an answer for you.

  • Getting error System.Web.Services.Protocols.SoapException: Server did not r

    I am trying to acces my web service using this code
    Call call = new Call ();
    SOAPMappingRegistry soap = new SOAPMappingRegistry();
    call.setTargetObjectURI ("http://tempuri.org/");
    call.setMethodName ("EarnNValue");
    Vector params = new Vector ();
    params.addElement (new Parameter("customer_id", String.class, "gauravbehl",Constants.NS_URI_SOAP_ENC));
    params.addElement (new Parameter("channel_id", String.class, "C0002",Constants.NS_URI_SOAP_ENC));
    call.setParams (params);
    Response resp = call.invoke(new URL("http://203.199.76.2/api/earnnvalue.asmx"), "http://tempuri.org//EarnNValue") ;
    if (resp.generatedFault ())
    Fault fault = resp.getFault ();
    System.out.println (" Fault Code = " + fault.getFaultCode ());
    System.out.println (" Fault String = " + fault.getFaultString ());
    else
    Parameter result = resp.getReturnValue ();
    System.out.println (result.getValue ());
    out.println (result.getValue ());
    and i am getting the the following error
    Fault Code = soap:Client
    Fault String = System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: http://tempuri.org//EarnNValue.
    at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
    at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
    at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
    Please help.
    Thanx
    GB

    <%@ page language="java" import="java.util.*, java.io.*, javax.mail.*, java.net.*, org.apache.soap.util.xml.*, org.apache.soap.encoding.soapenc.BeanSerializer, org.apache.soap.encoding.*,org.apache.soap.*, org.apache.soap.rpc.*"%>
    <%
    try
    out.println ("Starting");
    System.out.println("heree");
    Call call = new Call ();
    System.out.println("here");
    SOAPMappingRegistry soap = new SOAPMappingRegistry();
    call.setTargetObjectURI ("http://tempuri.org/");
    call.setMethodName ("EarnNValue");
    call.setEncodingStyleURI("http://schemas.xmlsoap.org/soap/encoding/");
    Vector params = new Vector ();
    params.addElement (new Parameter("customer_id", String.class, "gauravbehl",Constants.NS_URI_SOAP_ENC));
    params.addElement (new Parameter("channel_id", String.class, "C0002",Constants.NS_URI_SOAP_ENC));
    params.addElement (new Parameter("category_id", String.class, "club",Constants.NS_URI_SOAP_ENC));
    params.addElement (new Parameter("transaction_date", String.class, "16/07/04 14:41:20",Constants.NS_URI_SOAP_ENC));
    params.addElement (new Parameter("parameter_id", String.class, "login",Constants.NS_URI_SOAP_ENC));
    params.addElement (new Parameter("parameter_value", String.class, "1",Constants.NS_URI_SOAP_ENC));
    call.setParams (params);
    Response resp = call.invoke(new URL("http://203.199.76.2/api/earnnvalue.asmx"), "http://tempuri.org//EarnNValue") ;
    if (resp.generatedFault ())
    Fault fault = resp.getFault ();
    System.out.println ("Something is wrong");
    System.out.println (" Fault Code = " + fault.getFaultCode ());
    System.out.println (" Fault String = " + fault.getFaultString ());
    else
    Parameter result = resp.getReturnValue ();
    System.out.println (result.getValue ());
    out.println (result.getValue ());
    catch (Exception e)
    System.out.println ("********Exception*******");
    System.out.println (e);
    out.println ("Ending");
    %>

Maybe you are looking for