WebServiceProvider

Dear all,
thanks for the preview - great work!
For giving it a start i was playing around with jax-ws annotations.
Using @WebService seems to be simple. Just add the annotation
and one can run the pojo in JDeveloper.
But what about @WebServiceProvider. How can i run something
like this:
@WebServiceProvider
@BindingType( value=HTTPBinding.HTTP_BINDING )
public class HelloProvider implements Provider<Source> {
public Source invoke( Source xml ) {
return new StreamSource( new StringReader(
"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
"<greeting>hi folks</greeting>\n" +
Greetings and thanks,
Fritjof.

Hi,
I have added support for that; but unfortunately it missed the technology preview by a few days.
A workaround is to also have a @WebService in the same project and run that instead. You should find that the class with @WebServiceProvider is deployed at the same time. You just need to look at your web.xml to figure out what URL the endpoint in on.
Hope this helps,
Gerard
JDeveloper Web Services Team

Similar Messages

  • Isssue in publishingWSDL for @WebServiceProvider

    I wrote an simple JAX-WS webservice for @WebServiceProvider. After deploying it as war while accessing the WSDL i am facing below error.
    :/GPSProxy spec-version:2.5]] Servlet failed with Exception
    java.lang.NullPointerException
    at weblogic.wsee.jaxws.WLSServletAdapter.publishWSDL(WLSServletAdapter.java:239)
    at weblogic.wsee.jaxws.WLSServletAdapter.handle(WLSServletAdapter.java:166)
    at weblogic.wsee.jaxws.HttpServletAdapter.get(HttpServletAdapter.java:193)
    at weblogic.wsee.jaxws.JAXWSServlet.doRequest(JAXWSServlet.java:93)
    at weblogic.servlet.http.AbstractAsyncServlet.service(AbstractAsyncServlet.java:99
    Why is it gives NullPointerException - - Can any one help us ..
    WebService code looks like
    package gpsproxy;
    import java.io.ByteArrayOutputStream;
    import javax.xml.ws.BindingType;
    import javax.xml.ws.ServiceMode;
    import javax.xml.ws.WebServiceProvider;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.ws.Provider;
    @WebServiceProvider(
    portName="GPSProxyPort",
    serviceName="GPSProxyService",
    targetNamespace="http://services.mymclportal.com/SOA/GPSProxyService",
    wsdlLocation="/WEB-INF/wsdl/GPSProxyService.wsdl"
    @BindingType(value="http://schemas.xmlsoap.org/wsdl/soap/http")
    @ServiceMode(value=javax.xml.ws.Service.Mode.MESSAGE)
    public class GPSProxy implements Provider<SOAPMessage> {
    public GPSProxy() { super(); }
    public SOAPMessage invoke(SOAPMessage req){
    System.out.println("Method invoked ");
    System.out.println("invoke: Request: " + getSOAPMessageAsString(req));
    return null;
    private String getSOAPMessageAsString(SOAPMessage msg)
    ByteArrayOutputStream baos = null;
    String s = null;
    try {
    baos = new ByteArrayOutputStream();
    msg.writeTo(baos);
    s = baos.toString();
    } catch(Exception e) {
    e.printStackTrace();
    return s;
    And the web.xml is
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
         <filter>
              <filter-name>JpsFilter</filter-name>
              <filter-class>oracle.security.jps.ee.http.JpsFilter</filter-class>
              <init-param>
                   <param-name>enable.anonymous</param-name>
                   <param-value>true</param-value>
              </init-param>
         </filter>
         <filter-mapping>
              <filter-name>JpsFilter</filter-name>
              <url-pattern>/*</url-pattern>
              <dispatcher>FORWARD</dispatcher>
              <dispatcher>REQUEST</dispatcher>
              <dispatcher>INCLUDE</dispatcher>
         </filter-mapping>
         <servlet>
              <servlet-name>GPSProxyPort</servlet-name>
              <servlet-class>gpsproxy.GPSProxy</servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>     
         <servlet-mapping>
              <servlet-name>GPSProxyPort</servlet-name>
              <url-pattern>/GPSProxyPort</url-pattern>
         </servlet-mapping>
    </web-app>

    Hi Kalyan,
    I changed the version to 2.4 also did few changes...
    Now , I am facing some weird issue. Able to see service address http://localhost:7001/GPSProxy-001/GPSProxyService .... But if i open WSDL in browser i get 404 error .... I am not getting any info... no exception in the logs also .....
    WSDL ( http://localhost:7001/GPSProxy-001/GPSProxyService?wsdl)
    I am deploying this in WebLogic 11g . Would there be any reason with @WebServiceProvider to WebLogic 11g. Because this is too simple Webservice . but not working properly.
    Pls . helpe me for this...
    Updated web.xml looks like below.
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
    <servlet>
    <description>GPSProxy Service</description>
    <display-name>GPSProxy Service</display-name>
    <servlet-name>GPSProxyService</servlet-name>
    <servlet-class>gpsproxy.GPSProxy</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>GPSProxyService</servlet-name>
    <url-pattern>/</url-pattern>
    </servlet-mapping>
    </web-app>

  • WebServiceProvider in Composite Application

    I am trying to establish a SOAP routing component using JBI components in JCAPS 6 U1
    My goal is to use the WebServiceProvider interface to read in any SOAP message and then map it to a NMR message type that I have defined. I have built an EJB Module with the following description to accomplish this.
    @ServiceMode(value=Service.Mode.MESSAGE)
    @WebServiceProvider(serviceName = "GenericWebService", portName = "GenericWebServicePort", targetNamespace = "http://com.corp/")
    @BindingType(value=HTTPBinding.HTTP_BINDING)
    public class GenericWebServiceAdaptor implements Provider<SOAPMessage> {
    public SOAPMessage invoke(SOAPMessage request) {
    When I add this component to the CASA editor, it does not provide an "Provide" endpoint, just a "Consume" endpoint. How do I specify what address the GenericWebServicePort should use?

    Hi Nitin,
    The AFW runs on the J2EE Engine, so this table is in the Java Schema of the database and thus not visible in the ABAP stack. I guess you can use any tool your database provider offers for looking at table contents (e.g. SQLPlus).
    Regarding how to access the table please contact you basis administrator they will have access to the tables as they have j2ee_admin login ids and pwds.
    Regards
    joel

  • WebServiceProvider question

    It seems, that WebServiceProvider supports
    only SOAP/RPC styled webservices.
    I am receiving:"WSDL: Invalid or not supported"
    for SOAP/DOC styled webservices...
    Did anyone used the portal framework client
    to receive/integrate with document styled webservices?
    Thanks,
    Alex :-)

    And the last posting regarding my topic:
    WebServiceProvider supports only complex types,
    which are build with basic types.
    For example the following type declaration:
    - <s:element name="GetWeatherInfoResponse">
    - <s:complexType>
    - <s:sequence>
    ------------<s:element minOccurs="1" maxOccurs="1" name="GetWeatherInfoResult" type="s0:WeatherInfo" />
    </s:sequence>
    </s:complexType>
    </s:element>
    - <s:complexType name="WeatherInfo">
    - <s:sequence>
    ----- <s:element minOccurs="0" maxOccurs="1" name="Location" type="s:string" />
    ----- <s:element minOccurs="0" maxOccurs="1" name="Temprature" type="s:string" />
    </s:sequence>
    </s:complexType>
    will fail with:
    WSDLException: ComplexType element name: GetWeatherInfoResult contains an unsupp
    orted type: s0:WeatherInfo
    faultCode: INVALID_WSDL:
    at com.sun.portal.providers.simplewebservice.wsdl.impl.WSDLReader.getTyp
    eDescriptors(WSDLReader.java:317)
    at com.sun.portal.providers.simplewebservice.wsdl.impl.WSDLReader.getDef
    initionDescriptor(WSDLReader.java:147)
    at com.sun.portal.providers.simplewebservice.wsdl.impl.WSDLReader.getWSD
    LDefinitionDescriptor(WSDLReader.java:102)
    at com.sun.portal.providers.simplewebservice.wsdl.impl.WSDLReader.main(W
    SDLReader.java:919)

  • Can't POST to RESTful WebServiceProvider using HTTP API?

    Apologies - this should have been posted in the Web Services forum. I have moved this thread over there.
    Edited by: alecbritton on Oct 10, 2007 4:40 PM

    Hello
    Can you please share the document you referred for successfully deploying the RestFul web service as i am not getting how to start with.
    It will be very helpful.
    Hope you will reply.
    Thanks,
    Abhijeet Mane.

  • Problems deploying a JAX-WS webservice on Weblogic 10.3

    Hello Experts,
    I have deveoped a SOAP1.2 over HTTP web service using JAX-WS @WebServiceProvider annotation and am trying to deploy it on Weblogic 10.3
    The jwsc task is successful. However, I get the following exception when deploying it on weblogic 10.3:
    ===========================================================================================
    ####<Feb 16, 2010 12:35:18 PM PST> <Info> <Deployer> <....> <WLS_ManagedServer_1> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1266352518172> <BEA-149060> <Module OIMTrustedRecon of application OIMTrustedReconEar successfully transitioned from STATE_PREPARED to STATE_NEW on server WLS_ManagedServer_1.>
    ####<Feb 16, 2010 12:35:18 PM PST> <Error> <Deployer> <psharma-lap> <WLS_ManagedServer_1> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1266352518656> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1266352473562' for task '10'. Error is: 'weblogic.application.ModuleException: [HTTP:101216]Servlet: "weblogic.wsee.async.AsyncResponseBean" failed to preload on startup in Web application: "OIMTrustedRecon".
    com.sun.xml.ws.model.RuntimeModelerException: The web service defined by the class weblogic.wsee.async.AsyncResponseBean does not contain any valid WebMethods.
         at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:262)
         at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:322)
         at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:188)
         at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
         at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:510)
         at weblogic.wsee.jaxws.JAXWSDeployedServlet.getEndpoint(JAXWSDeployedServlet.java:182)
         at weblogic.wsee.jaxws.JAXWSServlet.registerEndpoint(JAXWSServlet.java:164)
         at weblogic.wsee.jaxws.JAXWSServlet.init(JAXWSServlet.java:51)
         at weblogic.wsee.jaxws.JAXWSDeployedServlet.init(JAXWSDeployedServlet.java:53)
         at javax.servlet.GenericServlet.init(GenericServlet.java:241)
         at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
         at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
         at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
         at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:521)
         at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1893)
         at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1870)
         at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1790)
         at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2999)
         at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1371)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:468)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
         at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
         at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
         at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
         at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:16)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:820)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1227)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:436)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    ===========================================================================================
    Could you please let know if I have done something wrong or am missing something.
    Please let me know if you need more information to help me.
    Many Thanks,
    Pulkit Sharma

    Hi Pulkit,
    If your WebService is not very complex ...then can you please paste it here ...Or can u describe something about your WebService. Like Which kind of methods are there? And Are u using any Asynchronous feature in it?
    If you are not using any Asynchronous feature in your webservice then u can try disabling it by adding "-Dweblogic.wsee.skip.async.response=true"
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com/webservices/ (WebLogic Wonders Are Here)

  • Unsupported Content-Type: text/html;charset=utf-8 Supported ones are: [text

    Hi I am in trouble with JAX-WS 2.1.2M1
    I try to call my Webservice like this:
    Service service = Service.create(serviceName);
            service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, "http://spblue.liberty:8084/SPBlue/GlobalLogoutService");
    Dispatch<SOAPMessage> disp = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);
            SOAPMessage message = XmlUtil.getSOAPMessageFromString(request);
            SOAPMessage response = disp.invoke(message);when my disp invokes I get following Exception which seems to as a little Problem, anyway I don�t know how to get rid of this Exception.
    com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: text/html;charset=utf-8 Supported ones are: [text/xml]
    at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:116)
    at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:280)
    at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:158)
    at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:74)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:559)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:518)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:503)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:400)
    at com.sun.xml.ws.client.Stub.process(Stub.java:234)
    at com.sun.xml.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:166)
    at com.sun.xml.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:192)
    at test.service.Logout.requestLogout(Logout.java:115)
    at test.service.Logout.main(Logout.java:149)
    ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
    JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]
    my ServiceClass is:
    @ServiceMode(value=Service.Mode.MESSAGE)
    @WebServiceProvider( targetNamespace="http://spblue.liberty:8084/wsdl/globalLogout")
    public class GlobalLogoutServiceImpl implements Provider<SOAPMessage> {
         * Web service operation
        public SOAPMessage invoke( SOAPMessage logoutRequest ){
            return logoutRequest;
    }So how can I set the Charachter set before invokikng the service.
    Or how can I change the Service to accept UTF-8.
    Well, I don�t know.
    Any help is welcome.

    Hi,
    I don't know if this can help you, but I had a similar problem while invoking a web service. Eventually, I found out that the server was returning an html error page, and not the expected xml answer.
    That's why the client code raises such an error... It means that the MIME type of the anser is text/html (for the html page) and not the text/xml type of the 'nominal' web service answer.
    You can verify this by using a proxy to intercept the http request and answer involved in this web service invocation (use Fiddler for instance). Then, you will see that the server responds by sending an html page saying that something is wrong.
    Hope this helps...
    Sam

  • Calling EJB with Annotation not successfull within Netbeans

    I am trying to call EJB but my simple program can't find a ejb
    within netbeans. I also download a stub file from the admin page and add to the ejb client path. but still without the luck
    @EJB
    private static ConverterBean converterBean;
    public static void main(String[] args) {
    // TODO code application logic here
    BigDecimal param = new BigDecimal ("100.00");
    BigDecimal amount = converterBean.dollarToYen(param);
    System.out.println( amount );
    }

    Thanks for your pointer. Could you please help me out with a small code snippet example?
    I want to make use of this existing bean (AMSProfileServiceBean ):
    @WebService(targetNamespace = "http://www.ttt.de/ota")
    @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
    // standard EJB3 annotations
    @Local(AMSAgencyWSPortType.class)
    @Stateless
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    // jboss propriatary annotations
    @WebContext(transportGuarantee = "NONE", secureWSDLAccess = false)
    public class AMSProfileServiceBean extends AbstractProfileBuilder implements AMSAgencyWSPortType
      private static Log log = LogFactory.getLog(AMSMappingServiceBean.class);
      @EJB(mappedName = "PotsdamProfileService/local")
      private PotsdamProfileService profileService;
      private Security              security;
      @EJB
      private OTAProfileBuilder     otaProfileBuilder;
      @EJB
      private OTAProfileUpdater     otaProfileUpdater;
    @Override
      public OTATTProfileReadRS otaTTReadRQ(Holder<Security> wsseHeader, OTATTReadRQ request)
    ...in my soap-connector :
    @WebServiceProvider(wsdlLocation = "WEB-INF/wsdl/PotsdamAMSAgencyWS.wsdl", targetNamespace = "http://www.ttt.de/ota", serviceName = "PotsdamAMSAgencyWS", portName = "PotsdamAMSAgencyWSPortType")
    @ServiceMode(value = Service.Mode.MESSAGE)
    public class PotsdamAgencyWSProvider extends WSProvider implements Provider<SOAPMessage>
      @Resource
      WebServiceContext     wsCtx;
    ...A small example would be really appreciated.
    Thanks.

  • OneNote and Corporate Intellectual Property Security - How?

    I am trying to understand how OneNote can be used in a Corporate environment, and maintain some control over intellectual property.  As I understand it, OneNote syncs to SkyDrive, which is a PERSONAL Live account.  That means even if the IT Department
    creates a SkyDrive account for that user, the user could then easily move corporate intellectual property to the account (which OneNote is designed to do and very adept at doing), and then change the password.  The IT Department would have no way of knowing
    what was uploaded, and the data could reside in someone's personal OneNote account for years.
    If there was a way of setting up a corporate SkyDrive account in which the users were managed (password changes locked, and content could be reviewed), I think I would feel more comfortable with OneNote.  Right now I don't see a way to do that, and
    one Microsoft document says that is not possible.
    If someone has a solution, please let me know.
    Michael

    The company does have policies for IP, but the threat with cloud servers is increasing the risk of moving large amounts of data offsite.  If you put a program in front of an employee which invites cloud server use, you are inviting misuse of data. 
    The company would like to try out OneNote, but this product is obviously not designed for the Enterprise.  I say that, because there is no easy way to disable web access in it.  I want it off the menus.  As someone else mentioned, "Out
    of sight, out of mind."  There are supposedly a couple of keys you can change which will turn off web integration, but I'll be darned if I can find them.
    Here are the ones suggested.
    HKEY_CURRENT_USER\Software\Microsoft\Office\Common\WebIntegration\WebIntegrationEnabled=0
    HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\Common\WebIntegration\WebIntegrationEnabled
    HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\14.0\OneNote\WebServiceProvider\DisableSkydriveSetupOnFirstBoot=1
    People have also mentioned using the Group Policy Management Console, but the company has many remote offices, so there is no central domain controller.
    Right now all I can do is block it at the firewall, which is not a great solution.
    Michael

  • Calling EJB method

    Hi All,
    I have never worked with EJBs so I am kind of stuck with one problem.
    I have to make use of one existing EJB project through my external standard java class. The existing EJB project makes use of some other packages which are also EJB projects and I am not allowed to change any functionality of the EJB project but to use them as it is.
    I am just initilizing the class object of the EJB project and calling its method. Within the EJB project there is a method which is calling another method of another EJB class.
    The problem is that I dont see this other EJB class object getting initilized first and then calling its method as it happens in a normal scenario, hence when that method gets called i get a null pointer execption.
    Let me give you some idea by posting some code snippet.
    @WebService(targetNamespace = "http://www.ttt.de/ota")
    @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
    // standard EJB3 annotations
    @Local(AMSAgencyWSPortType.class)
    @Stateless
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    // jboss propriatary annotations
    @WebContext(transportGuarantee = "NONE", secureWSDLAccess = false)
    public class AMSProfileServiceBean extends AbstractProfileBuilder implements AMSAgencyWSPortType
      private static Log log = LogFactory.getLog(AMSMappingServiceBean.class);
      @EJB(mappedName = "PotsdamProfileService/local")
      private PotsdamProfileService profileService;
      private Security              security;
      @EJB
      private OTAProfileBuilder     otaProfileBuilder;
    @Override
      public OTATTProfileReadRS otaTTReadRQ(Holder<Security> wsseHeader, OTATTReadRQ request)
         security = wsseHeader.value;
         BigDecimal requestVersion = request.getVersion();
         OTATTProfileReadRS otaProfileReadRS = new OTATTProfileReadRS();
         otaProfileReadRS.setVersion(requestVersion);
         PotsdamInstanceKey profileIntanceKey;
        try
          profileIntanceKey = getKeyHandler(requestVersion).buildUserKey(wsseHeader);
          PotsdamInstance userInstance = loadProfileFromPotsdam(profileIntanceKey);
    private PotsdamInstance loadProfileFromPotsdam(PotsdamInstanceKey userCredentials) throws PotsdamException
           PotsdamInstance potsdamInstance = null;
           try{
        Holder<com.ttt.potsdam.common.messages.Security> wsseHeader = buildWsseHeader(security);
        ProfileResponse potsdamInstanceRS = profileService.loadProfile(wsseHeader, userCredentials);
    ...I get an error message before the sequence reaches loadProfile(..), which in my sense is due to the fact that 'profileService' never was initilized in the EJB project.
    profileService is object of another EJB project, which looks somethign like this:
    @Stateless
    @LocalBinding(jndiBinding = "PotsdamProfileService/local")
    // jboss 4.2
    @org.jboss.annotation.ejb.LocalBinding(jndiBinding = "PotsdamProfileService/local")
    public class PotsdamProfileServiceBean implements PotsdamProfileService {
         private static Log log = LogFactory.getLog(PotsdamProfileServiceBean.class);
         @EJB
         private CacheProfileService cacheProfileService;
         @EJB(mappedName = "/PersistenceUnitsManagerBean/local")
         private PersistenceUnitsManager persistenceUnitsManager;
         @EJB
         private PotsdamService potsdamService;
         public ProfileResponse loadProfile(Holder<Security> wsseHeader,
                   PotsdamInstanceKey cacheInstanceKey) {
               log.debug("inside  loadProfile");
    ...Now I am calling the main EJB like this:
    PotsdamotaTTReadRQ();
    public OTATTProfileReadRS PotsdamotaTTReadRQ()
           AMSProfileServiceBean a = new AMSProfileServiceBean();
           Holder<Security> wsseHeader = new Holder<Security>();
           OTATTProfileReadRS response = a.otaTTReadRQ(wsseHeader, request);
           return response;
      }So my confusion is how can I make use of profileService.loadProfile(wsseHeader, userCredentials); ??
    I tried to initilize: PotsdamProfileServiceBean profileService = new PotsdamProfileServiceBean();but I get jndi binding and lots of other exception.
    Please help.
    Edited by: 925515 on 04.07.2012 06:40

    Thanks for your pointer. Could you please help me out with a small code snippet example?
    I want to make use of this existing bean (AMSProfileServiceBean ):
    @WebService(targetNamespace = "http://www.ttt.de/ota")
    @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
    // standard EJB3 annotations
    @Local(AMSAgencyWSPortType.class)
    @Stateless
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    // jboss propriatary annotations
    @WebContext(transportGuarantee = "NONE", secureWSDLAccess = false)
    public class AMSProfileServiceBean extends AbstractProfileBuilder implements AMSAgencyWSPortType
      private static Log log = LogFactory.getLog(AMSMappingServiceBean.class);
      @EJB(mappedName = "PotsdamProfileService/local")
      private PotsdamProfileService profileService;
      private Security              security;
      @EJB
      private OTAProfileBuilder     otaProfileBuilder;
      @EJB
      private OTAProfileUpdater     otaProfileUpdater;
    @Override
      public OTATTProfileReadRS otaTTReadRQ(Holder<Security> wsseHeader, OTATTReadRQ request)
    ...in my soap-connector :
    @WebServiceProvider(wsdlLocation = "WEB-INF/wsdl/PotsdamAMSAgencyWS.wsdl", targetNamespace = "http://www.ttt.de/ota", serviceName = "PotsdamAMSAgencyWS", portName = "PotsdamAMSAgencyWSPortType")
    @ServiceMode(value = Service.Mode.MESSAGE)
    public class PotsdamAgencyWSProvider extends WSProvider implements Provider<SOAPMessage>
      @Resource
      WebServiceContext     wsCtx;
    ...A small example would be really appreciated.
    Thanks.

  • JAX RI:javax.activation.DataHandler cannot be cast to com.sun.xml.ws.....

    I'm newbie in web services, and I would like to create web service for upload files.
    Axis2 is installed, and I tried to implement some solutions I found on the web, but i got an error:
    javax.activation.DataHandler cannot be cast to com.sun.xml.ws.developer.StreaminDataHandler
    on server side code looks like:
    @WebMethod(operationName = "getHeight")
    public int getHeight(String name, @XmlMimeType("application/octet-stream") DataHandler data) {
    StreamingDataHandler dh = (StreamingDataHandler) data; //this is where error occurs..
    on client side:
    tt=new javax.activation.FileDataSource("c:\\myImage.jpg");
    dhh=new javax.activation.DataHandler(tt);
    int r=port.getHeight("name", dhh);
    tnx :)

    Hi dKohlert,
    I have now changed my code completely and got it working this way !
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.ws.Provider;
    import javax.xml.ws.Service;
    import javax.xml.ws.ServiceMode;
    import javax.xml.ws.WebServiceProvider;
    * @author Footman
    @ServiceMode(value=Service.Mode.MESSAGE)
    @WebServiceProvider( targetNamespace="http://spblue.liberty:8084/wsdl/globalLogout")
    //@WebService(name="GlobalLogoutService", targetNamespace="http://spblue.liberty:8084/wsdl/globalLogout")
    public class GlobalLogoutServiceImpl implements Provider<SOAPMessage> {
    @WebMethod(operationName ="globalLogout", action="urn:liberty:soap-action")
        public SOAPMessage invoke(@WebParam(name = "logoutRequest") SOAPMessage logoutRequest ){
            return logoutRequest;
        }Thanks anyway for your reply. If I find some time I will try to use the apt-tool.

  • Wrapper class is not found. Have you run APT to generate them?

    Hello,
    I am trying to build a client to a web service.
    Using the wsdl2java from CXF binaries, I have created the client stubs for the web service and now I am trying to invoke a method on the service. Here is what I am trying with but I am getting the RunTimeModeler exception.
              GenService service = new GenService();
              HTTPGETPort client = service.getHTTPGETPort();
              GetQuotes samplequote = new GetQuotes();
              samplequote.setTickers("MSFT");
    After looking online at CXF 2.0 user guide, I found out the question "Q: How can I switch my generated web service method calls from wrapper style to non wrapper-style (or vice-versa)?" at http://cwiki.apache.org/CXF20DOC/wsdl-to-java.html.
    It seems that I needed to disable the wrapper style when calling the methods on the generated stubs.
    Can someone help me out please?
    Thanks,
    Rahul

    Hi dKohlert,
    I have now changed my code completely and got it working this way !
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.ws.Provider;
    import javax.xml.ws.Service;
    import javax.xml.ws.ServiceMode;
    import javax.xml.ws.WebServiceProvider;
    * @author Footman
    @ServiceMode(value=Service.Mode.MESSAGE)
    @WebServiceProvider( targetNamespace="http://spblue.liberty:8084/wsdl/globalLogout")
    //@WebService(name="GlobalLogoutService", targetNamespace="http://spblue.liberty:8084/wsdl/globalLogout")
    public class GlobalLogoutServiceImpl implements Provider<SOAPMessage> {
    @WebMethod(operationName ="globalLogout", action="urn:liberty:soap-action")
        public SOAPMessage invoke(@WebParam(name = "logoutRequest") SOAPMessage logoutRequest ){
            return logoutRequest;
        }Thanks anyway for your reply. If I find some time I will try to use the apt-tool.

  • Exception when invoking a JAX-WS Webservice

    Hi,
    I have 2 tomcat 5.5.17 instances running. Each of them have a Webservice.
    @ServiceMode(value=Service.Mode.MESSAGE)
    @WebServiceProvider( targetNamespace="urn:liberty:md:IDFF:wsdl")
    public class SOAPEndpointImpl implements Provider<SOAPMessage> {
    private StatusResponseType statusResponse = new StatusResponseType();
    public SOAPEndpointImpl() {
    public SOAPMessage invoke(SOAPMessage request){
    return request;
    I get an exception, when I Invoke the Service, althaugh, the Webservice does what it is supposed to. In other words - I get my desired response.
    Anyway, I haven�t any clue why this Exception is thrown:
    INFO: Server startup in 1973 ms
    08.08.2007 19:02:43 com.sun.xml.ws.transport.http.servlet.WSServletDelegate doGet
    SCHWERWIEGEND: caught throwable
    java.io.IOException
    at com.sun.xml.ws.server.SDDocumentImpl.writeTo(SDDocumentImpl.java:242)
    at com.sun.xml.ws.transport.http.HttpAdapter.publishWSDL(HttpAdapter.java:496)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:215)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:121)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:115)
    at com.sun.xml.ws.transport.http.servlet.WSServlet.doGet(WSServlet.java:68)
    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.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
    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)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: javax.xml.stream.XMLStreamException
    at com.sun.xml.stream.writers.XMLStreamWriterImpl.close(XMLStreamWriterImpl.java:383)
    at com.sun.xml.ws.server.SDDocumentImpl.writeTo(SDDocumentImpl.java:240)
    ... 25 more
    Anyone, any Idea ?
    When my tomcat startsup, it is telling me, some warning in conjunction with the wsdl describing my webservice.
    08.08.2007 19:02:15 com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser parseWSDL
    WARNING: Import of jndi:/idp.liberty/IdP/WEB-INF/wsdl/schema/oasis-sstc-saml-schema-assertion-1.1.xsd is violation of BP 1.1 R2001. Proceeding with a warning.
    R2001 A DESCRIPTION MUST only use the WSDL "import" statement to import another WSDL description.
    What is that meaning ?
    Please help !

    problem is solved allready.

  • SOAP in Servlet

    Hello.
    I have a problem in Servlet for responding for a request.
    I think I succeeded getting the soap request in my servlet.
    And I'm stuck in sending my soap response back.
    Is there anybody tell me exactly how to send my javax.xml.soap.SOAPMessage instance through HttpServletResopnse?
    Please help me.

    If you use the Provider interface that is part of JAX-WS, all of the plumbing is done for you. Check out JAX-WS that is part of Project Metro at http://metro.dev.java.net.
    You can do something like
    @WebServiceProvider()
    public class AddNumbersImpl implements Provider<SOAPMessage> {
    public SOAPMessage invoke(SOAPMessage soapMessage) {
    SOAPMessage response = ...;
    return response;
    }

Maybe you are looking for

  • My Skype Number always shown busy when call

    Since I bought my skype number it is always shown busy. Can you help? 

  • Can the specific changes/updates made to a customer be captured with the detail of changes?

    One of our 11i Customer placed the below requirement: We are creating a report that will extract customers that have changed or updated in Oracle. The user requested to include also the specific change made to the customer. Is there a way that we can

  • Looking for a plugin

    I have tried in vain to locate a plugin that will allow JAI to support the Raw and Jpeg2000 formats. Currently the version I have only supports BMP, JPEG, WBMP, GIF, JPG, and PNG. Does anyone know where I can find a plugin that supports the raw and j

  • Capitalization Script

    Is there a capitalization script that can:capitalize only the first letter of each word and not make the rest of the letters lowercase, which is what this seems to do: event.value = event.value.toLowerCase().replace(/\b\w/g, function(match){return ma

  • I trouble with mouse.

    I am using microsoft word 2003. When drag mouse in page word and left-click mouse, pointer no responses. I reinstall microsoft word and driver of mouse but do not. Please help me fix this problem.