How to generate param-prefix in web-services.xml

Hello I am using source2wsdd to generate my WSDL and my web-services.xml. For sake
of interoperability I would like to have the type param-prefix in the web-services.xml
file. From my Bean class what kind of javadoc comments would help me generate
the type param-prefix ?
I also would like the location="header" in the param list.
Thanks,
Aswin.
<param xmlns:param-prefix="http://tempuri.org/"
type="param-prefix:SOAPCredentials"
location="header"
class-name="com.xyz.webservices.SOAPCredentials"
name="SOAPCredentials"
style="in">
</param>
<return-param xmlns:param-prefix="http://tempuri.org/"
type="param-prefix:GetFileProfileInformationResponse"
class-name="com.xyz.webservices.GetFileProfileInformationResponse"
name="parameters">
</return-param>
</params>

Please try this:
* @wlws:part p_SOAPAuthToken location="header"
* type="typeNS:p_SOAPAuthToken"
* class-name="com.xyz.webservices.SOAPAuthToken"
* style="inout"
* xmlns:typeNS=http://namespace/of/the/type
* @wlws:part p_SOAPCredentials location="header"
* type="typeNS:p_SOAPCredentials"
* class-name="com.xyz.webservices.SOAPCredentials"
* style="in"
* xmlns:typeNS=http://namespace/of/the/type
* @ejbgen:remote-method
public void login(SOAPAuthToken p_SOAPAuthToken,
SOAPCredentials p_SOAPCredentials)
I did not try this one out. So i can only hope that it works.
Regards,
-manoj
http://manojc.com
"Aswin Dinakar" <[email protected]> wrote in message
news:40aeeb5d$1@mktnews1...
>
I tried this
* @wlws:part p_SOAPAuthToken location="header"
* @wlws:part p_SOAPAuthToken type="param-prefix:p_SOAPAuthToken"
* @wlws:part p_SOAPAuthTokenclass-name="com.xyz.webservices.SOAPAuthToken"
* @wlws:part p_SOAPAuthToken style="inout"
* @wlws:part p_SOAPCredentials location="header"
* @wlws:part p_SOAPCredentials type="param-prefix:p_SOAPCredentials"
* @wlws:part p_SOAPCredentialsclass-name="com.xyz.webservices.SOAPCredentials"
* @wlws:part p_SOAPCredentials style="in"
* @ejbgen:remote-method
public void login(SOAPAuthToken p_SOAPAuthToken,
SOAPCredentials p_SOAPCredentials)
and I got the following error -
[source2wsdd] source2wsdd: In doclet classweblogic.webservice.tools.ddgen.Servi
ceGen, method start has thrown an exceptionjava.lang.reflect.InvocationTargetE
xception
[source2wsdd] weblogic.xml.stream.XMLStreamException: Attribute QNamevalue "par
am-prefix:p_SOAPAuthToken" does not map to a prefix that is in scope
[source2wsdd] atweblogic.webservice.dd.NSAttribute.getValueAsXMLName(NSAttrib
ute.java:45)
[source2wsdd] atweblogic.webservice.dd.DDLoader.processParamElement(DDLoader.
java:1252)
"manoj cheenath" <[email protected]> wrote:
Check out this example:
http://manojc.com/?sample3
You can find more details regarding the tags here:
http://manojc.com/tutorial/sample3/source2wsdd.html
Regards,
-manoj
http://manojc.com
"Aswin D" <[email protected]> wrote in message
news:[email protected]...
Hello I am using source2wsdd to generate my WSDL and my
web-services.xml.
For sake
of interoperability I would like to have the type param-prefix inthe
web-services.xml
file. From my Bean class what kind of javadoc comments would help megenerate
the type param-prefix ?
I also would like the location="header" in the param list.
Thanks,
Aswin.
<param xmlns:param-prefix="http://tempuri.org/"
type="param-prefix:SOAPCredentials"
location="header"
class-name="com.xyz.webservices.SOAPCredentials"
name="SOAPCredentials"
style="in">
</param>
<return-param xmlns:param-prefix="http://tempuri.org/"
type="param-prefix:GetFileProfileInformationResponse"
class-name="com.xyz.webservices.GetFileProfileInformationResponse"
name="parameters">
</return-param>
</params>

Similar Messages

  • Fault elt in web-services.xml NOT WORKING

    We are trying to capture an invalid message coming into our service before our
    service actually processes it. Per WLS7 documentation, it provides the ability
    to add a <fault> elt under the <params> elt in web-services.xml to perform that.
    Here's how the operations portion of our web-services.xml looks like:
    <operations>
    <operation method="echo(java.lang.String)" component="jcComp0" name="echo"
    handler-chain="diagnosticChain">
    <params>
    <param location="body" class-name="java.lang.String" style="in" name="echoString"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="xsd:string">
    </param>
    <return-param location="body" class-name="java.lang.String" name="Result"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="xsd:string">
    </return-param>
         <fault name="InvalidMessageException" class-name="com.gmacfs.routeone.diagnostic.InvalidMessageException"/>
    </params>
    </operation>
    </operations>
    However, when we tried doing that, we got a BIG set of exception while trying
    to build our client. It looks as follows:
    client:
    [clientgen] Generating client jar for diagnostic.ear ...
    [clientgen] Could not read Web Service deployment descriptor
    [clientgen] at weblogic.ant.taskdefs.webservices.clientgen.EARClientGen.run(EARClientGen.java:112)
    [clientgen] at weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.execute(ClientGenTask.java:270)
    [clientgen] at org.apache.tools.ant.Task.perform(Task.java:217)
    [clientgen] at org.apache.tools.ant.Target.execute(Target.java:164)
    [clientgen] at org.apache.tools.ant.Target.performTasks(Target.java:182)
    [clientgen] at org.apache.tools.ant.Project.executeTarget(Project.java:601)
    [clientgen] at org.apache.tools.ant.Project.executeTargets(Project.java:560)
    [clientgen] at org.apache.tools.ant.Main.runBuild(Main.java:454)
    [clientgen] at org.apache.tools.ant.Main.start(Main.java:153)
    [clientgen] at org.apache.tools.ant.Main.main(Main.java:176)
    [clientgen] --- Nested Exception ---
    [clientgen] Could not read Web Service deployment descriptor
    [clientgen] at weblogic.ant.taskdefs.webservices.clientgen.EARClientGen.getWebServiceDD(EARClientGen.java:332)
    [clientgen] at weblogic.ant.taskdefs.webservices.clientgen.EARClientGen.run(EARClientGen.java:110)
    [clientgen] at weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.execute(ClientGenTask.java:270)
    [clientgen] at org.apache.tools.ant.Task.perform(Task.java:217)
    [clientgen] at org.apache.tools.ant.Target.execute(Target.java:164)
    [clientgen] at org.apache.tools.ant.Target.performTasks(Target.java:182)
    [clientgen] at org.apache.tools.ant.Project.executeTarget(Project.java:601)
    [clientgen] at org.apache.tools.ant.Project.executeTargets(Project.java:560)
    [clientgen] at org.apache.tools.ant.Main.runBuild(Main.java:454)
    [clientgen] at org.apache.tools.ant.Main.start(Main.java:153)
    [clientgen] at org.apache.tools.ant.Main.main(Main.java:176)
    [clientgen] --- Nested Exception ---
    [clientgen] weblogic.webservice.dd.DDProcessingException: Could not find required
    attribute "type" for element <fault> (Line 28, Column 8)
    [clientgen] at weblogic.webservice.dd.ParsingHelper.getRequiredAttribute(ParsingHelper.java:287)
    [clientgen] at weblogic.webservice.dd.DDLoader.processFaultElement(DDLoader.java:1195)
    [clientgen] at weblogic.webservice.dd.DDLoader.processFaultElements(DDLoader.java:1166)
    [clientgen] at weblogic.webservice.dd.DDLoader.processParamsElement(DDLoader.java:1004)
    [clientgen] at weblogic.webservice.dd.DDLoader.processOperationElement(DDLoader.java:977)
    [clientgen] at weblogic.webservice.dd.DDLoader.processOperationElements(DDLoader.java:853)
    [clientgen] at weblogic.webservice.dd.DDLoader.processOperationsElement(DDLoader.java:841)
    [clientgen] at weblogic.webservice.dd.DDLoader.processWebServiceElement(DDLoader.java:378)
    [clientgen] at weblogic.webservice.dd.DDLoader.processWebServiceElements(DDLoader.java:283)
    [clientgen] at weblogic.webservice.dd.DDLoader.processWebServicesElement(DDLoader.java:271)
    [clientgen] at weblogic.webservice.dd.DDLoader.load(DDLoader.java:249)
    [clientgen] at weblogic.webservice.util.WebServiceWarFile.getWSDD(WebServiceWarFile.java:79)
    [clientgen] at weblogic.ant.taskdefs.webservices.clientgen.EARClientGen.getWebServiceDD(EARClientGen.java:330)
    [clientgen] at weblogic.ant.taskdefs.webservices.clientgen.EARClientGen.run(EARClientGen.java:110)
    [clientgen] at weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.execute(ClientGenTask.java:270)
    [clientgen] at org.apache.tools.ant.Task.perform(Task.java:217)
    [clientgen] at org.apache.tools.ant.Target.execute(Target.java:164)
    [clientgen] at org.apache.tools.ant.Target.performTasks(Target.java:182)
    [clientgen] at org.apache.tools.ant.Project.executeTarget(Project.java:601)
    [clientgen] at org.apache.tools.ant.Project.executeTargets(Project.java:560)
    [clientgen] at org.apache.tools.ant.Main.runBuild(Main.java:454)
    [clientgen] at org.apache.tools.ant.Main.start(Main.java:153)
    [clientgen] at org.apache.tools.ant.Main.main(Main.java:176)
    [clientgen] --------------- nested within: ------------------
    [clientgen] weblogic.webservice.util.WebServiceJarException: Could not load deployment
    descriptor - with nested exception:
    [clientgen] [weblogic.webservice.dd.DDProcessingException: Could not find required
    attribute "type" for element <fault> (Line 28, Column 8)]
    [clientgen] at weblogic.webservice.util.WebServiceWarFile.getWSDD(WebServiceWarFile.java:81)
    [clientgen] at weblogic.ant.taskdefs.webservices.clientgen.EARClientGen.getWebServiceDD(EARClientGen.java:330)
    [clientgen] at weblogic.ant.taskdefs.webservices.clientgen.EARClientGen.run(EARClientGen.java:110)
    [clientgen] at weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.execute(ClientGenTask.java:270)
    [clientgen] at org.apache.tools.ant.Task.perform(Task.java:217)
    [clientgen] at org.apache.tools.ant.Target.execute(Target.java:164)
    [clientgen] at org.apache.tools.ant.Target.performTasks(Target.java:182)
    [clientgen] at org.apache.tools.ant.Project.executeTarget(Project.java:601)
    [clientgen] at org.apache.tools.ant.Project.executeTargets(Project.java:560)
    [clientgen] at org.apache.tools.ant.Main.runBuild(Main.java:454)
    [clientgen] at org.apache.tools.ant.Main.start(Main.java:153)
    [clientgen] at org.apache.tools.ant.Main.main(Main.java:176)
    BUILD FAILED
    Anybody has any ideas?
    Thanks much,
    sami

    Manoj,
    Thanks a lot, THAT DID IT... two very helpful hints from you in a row.
    By the way, one thing worth mentioning is that the Weblogic documentation that
    we explored did not have enough information about that issue.
    Thanks again.
    sami
    "manoj cheenath" <[email protected]> wrote:
    Buried deep in the stack trace, is this little
    detail:
    Could not find required
    attribute "type" for element <fault> (Line 28, Column 8)
    So the correct DD should look something like:
    <fault type="typeNS:string"
    xmlns:typeNS="http://www.w3.org/2001/XMLSchema"
    class-name="tutorial.sample9.HelloWorldException"
    name="HelloWorldException">
    </fault>
    Also, check out this example:
    http://manojc.com/?sample9
    There is a know problem: WLS can not handle
    exceptions that contain complex data types.
    This will be fixed in SP1.
    Regards,
    -manoj
    http://manojc.com
    "sami titi" <[email protected]> wrote in message
    news:[email protected]...
    We are trying to capture an invalid message coming into our servicebefore
    our
    service actually processes it. Per WLS7 documentation, it providesthe
    ability
    to add a <fault> elt under the <params> elt in web-services.xml toperform
    that.
    Here's how the operations portion of our web-services.xml looks like:
    <operations>
    <operation method="echo(java.lang.String)" component="jcComp0"name="echo"
    handler-chain="diagnosticChain">
    <params>
    <param location="body" class-name="java.lang.String" style="in"name="echoString"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="xsd:string">
    </param>
    <return-param location="body" class-name="java.lang.String"name="Result"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="xsd:string">
    </return-param>
    <fault name="InvalidMessageException"class-name="com.gmacfs.routeone.diagnostic.InvalidMessageException"/>
    </params>
    </operation>
    </operations>
    However, when we tried doing that, we got a BIG set of exception whiletrying
    to build our client. It looks as follows:
    client:
    [clientgen] Generating client jar for diagnostic.ear ...
    [clientgen] Could not read Web Service deployment descriptor
    [clientgen] atweblogic.ant.taskdefs.webservices.clientgen.EARClientGen.run(EARClientGen.ja
    va:112)
    [clientgen] atweblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.execute(ClientGenT
    ask.java:270)
    [clientgen] at org.apache.tools.ant.Task.perform(Task.java:217)
    [clientgen] at org.apache.tools.ant.Target.execute(Target.java:164)
    [clientgen] atorg.apache.tools.ant.Target.performTasks(Target.java:182)
    [clientgen] atorg.apache.tools.ant.Project.executeTarget(Project.java:601)
    [clientgen] atorg.apache.tools.ant.Project.executeTargets(Project.java:560)
    [clientgen] at org.apache.tools.ant.Main.runBuild(Main.java:454)
    [clientgen] at org.apache.tools.ant.Main.start(Main.java:153)
    [clientgen] at org.apache.tools.ant.Main.main(Main.java:176)
    [clientgen] --- Nested Exception ---
    [clientgen] Could not read Web Service deployment descriptor
    [clientgen] atweblogic.ant.taskdefs.webservices.clientgen.EARClientGen.getWebServiceDD(EAR
    ClientGen.java:332)
    [clientgen] atweblogic.ant.taskdefs.webservices.clientgen.EARClientGen.run(EARClientGen.ja
    va:110)
    [clientgen] atweblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.execute(ClientGenT
    ask.java:270)
    [clientgen] at org.apache.tools.ant.Task.perform(Task.java:217)
    [clientgen] at org.apache.tools.ant.Target.execute(Target.java:164)
    [clientgen] atorg.apache.tools.ant.Target.performTasks(Target.java:182)
    [clientgen] atorg.apache.tools.ant.Project.executeTarget(Project.java:601)
    [clientgen] atorg.apache.tools.ant.Project.executeTargets(Project.java:560)
    [clientgen] at org.apache.tools.ant.Main.runBuild(Main.java:454)
    [clientgen] at org.apache.tools.ant.Main.start(Main.java:153)
    [clientgen] at org.apache.tools.ant.Main.main(Main.java:176)
    [clientgen] --- Nested Exception ---
    [clientgen] weblogic.webservice.dd.DDProcessingException: Could notfind
    required
    attribute "type" for element <fault> (Line 28, Column 8)
    [clientgen] atweblogic.webservice.dd.ParsingHelper.getRequiredAttribute(ParsingHelper.java
    :287)
    [clientgen] atweblogic.webservice.dd.DDLoader.processFaultElement(DDLoader.java:1195)
    [clientgen] atweblogic.webservice.dd.DDLoader.processFaultElements(DDLoader.java:1166)
    [clientgen] atweblogic.webservice.dd.DDLoader.processParamsElement(DDLoader.java:1004)
    [clientgen] atweblogic.webservice.dd.DDLoader.processOperationElement(DDLoader.java:977)
    [clientgen] atweblogic.webservice.dd.DDLoader.processOperationElements(DDLoader.java:853)
    [clientgen] atweblogic.webservice.dd.DDLoader.processOperationsElement(DDLoader.java:841)
    [clientgen] atweblogic.webservice.dd.DDLoader.processWebServiceElement(DDLoader.java:378)
    [clientgen] atweblogic.webservice.dd.DDLoader.processWebServiceElements(DDLoader.java:283)
    [clientgen] atweblogic.webservice.dd.DDLoader.processWebServicesElement(DDLoader.java:271)
    [clientgen] at weblogic.webservice.dd.DDLoader.load(DDLoader.java:249)
    [clientgen] atweblogic.webservice.util.WebServiceWarFile.getWSDD(WebServiceWarFile.java:79
    [clientgen] atweblogic.ant.taskdefs.webservices.clientgen.EARClientGen.getWebServiceDD(EAR
    ClientGen.java:330)
    [clientgen] atweblogic.ant.taskdefs.webservices.clientgen.EARClientGen.run(EARClientGen.ja
    va:110)
    [clientgen] atweblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.execute(ClientGenT
    ask.java:270)
    [clientgen] at org.apache.tools.ant.Task.perform(Task.java:217)
    [clientgen] at org.apache.tools.ant.Target.execute(Target.java:164)
    [clientgen] atorg.apache.tools.ant.Target.performTasks(Target.java:182)
    [clientgen] atorg.apache.tools.ant.Project.executeTarget(Project.java:601)
    [clientgen] atorg.apache.tools.ant.Project.executeTargets(Project.java:560)
    [clientgen] at org.apache.tools.ant.Main.runBuild(Main.java:454)
    [clientgen] at org.apache.tools.ant.Main.start(Main.java:153)
    [clientgen] at org.apache.tools.ant.Main.main(Main.java:176)
    [clientgen] --------------- nested within: ------------------
    [clientgen] weblogic.webservice.util.WebServiceJarException: Couldnot
    load deployment
    descriptor - with nested exception:
    [clientgen] [weblogic.webservice.dd.DDProcessingException: Could not
    find>required>> attribute "type" for element <fault> (Line 28, Column 8)
    [clientgen] atweblogic.webservice.util.WebServiceWarFile.getWSDD(WebServiceWarFile.java:81
    [clientgen] atweblogic.ant.taskdefs.webservices.clientgen.EARClientGen.getWebServiceDD(EAR
    ClientGen.java:330)
    [clientgen] atweblogic.ant.taskdefs.webservices.clientgen.EARClientGen.run(EARClientGen.ja
    va:110)
    [clientgen] atweblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.execute(ClientGenT
    ask.java:270)
    [clientgen] at org.apache.tools.ant.Task.perform(Task.java:217)
    [clientgen] at org.apache.tools.ant.Target.execute(Target.java:164)
    [clientgen] atorg.apache.tools.ant.Target.performTasks(Target.java:182)
    [clientgen] atorg.apache.tools.ant.Project.executeTarget(Project.java:601)
    [clientgen] atorg.apache.tools.ant.Project.executeTargets(Project.java:560)
    [clientgen] at org.apache.tools.ant.Main.runBuild(Main.java:454)
    [clientgen] at org.apache.tools.ant.Main.start(Main.java:153)
    [clientgen] at org.apache.tools.ant.Main.main(Main.java:176)
    BUILD FAILED
    Anybody has any ideas?
    Thanks much,
    sami

  • Updating the web-services.xml for WS-Security

    If I wanted to change my webservice from encryption of both the request and response to just encryption of the request how do I manually change the web-services.xml file ??? Do I have to un-archive the ear and re-archive the ear everytime I want to make security changes to the web-services.xml file ?

    It works. Thanks,
    Ioana
    "Neal Yin" <[email protected]> wrote:
    The error means your EJB is not deployed.
    Adding a EJB module to your application.xml file of the ear should fixe
    it.
    <application>
    <display-name />
    <module>
    <web>
    <web-uri>dox_sdi.war</web-uri>
    </web>
    </module>
    <module>
    <ejb>DocumentService.jar</ejb>
    </module>
    </application>
    "Ioana Meissner" <[email protected]> wrote in message
    news:3cf640cc$[email protected]..
    I have used the following example for my own web service with EJBcomponent and SOAP
    Message Handler Chain:
    http://e-docs.bea.com/wls/docs70/webServices/dd.html#1058208
    I have a deployment error:
    javax.naming.NameNotFoundException: Unable to resolve'app/ejb/DocumentService.j
    ar#DocumentService/home' Resolved: 'app/ejb'Unresolved:'DocumentService.jar#Doc
    umentService' ; remaining name 'DocumentService.jar#DocumentService/home'
    In attachement is the ear file.
    Is there a problem in web-services.xml?
    Thanks

  • How to disable href/id in the generated response of a web-service

    Hello All,
    Do I have any possibility to disbale href/id on the generated response of a web-service that use RPC-encoded format? My generated soap body looks like this:
    <env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <m:Response xmlns:m="http://www.myTest.com">
    <result xmlns:n1="java:com.myTest" xsi:type="n1:Response">
    <ResultObject xsi:type="n1:ResultObject">
    <firstString href="#ID_6" />
    <integerObject href="#ID_13" />
    <secondString href="#ID_6" />
    </ResultObject>
    <ResultObject xsi:type="n1:ResultObject">
    <firstString href="#ID_6" />
    <integerObject href="#ID_13" />
    <secondString href="#ID_6" />
    </ResultObject>
    <ResultObject xsi:type="n1:ResultObject">
    <firstString href="#ID_6" />
    <integerObject href="#ID_13" />
    <secondString href="#ID_6" />
    </ResultObject>
    </result>
    </m:Response>
    <xsd:int xsi:type="xsd:int" id="ID_13">10</xsd:int>
    <xsd:string xsi:type="xsd:string" id="ID_6">EUR</xsd:string>
    </env:Body>
    Do I have any possibility to instruct the serialization process so that the result to conform with an XML schema and to keep the RPC-Encoded format? In other words to get rid of href/id:s? Href/id:s are used only for objects having the same reference.
    This issue is now even more problematic since JDK 5 when for integers boxing is not necessarily and thus, the compiler translates an Integer assignment using the method:
    public static Integer valueOf(int i)
    which returns cached Integer objects for any integer between -128 and 127.
    Please give some hints (others than using boxing for integers or changing the soap format to document-literal).
    Thanks

    Hello All,
    Do I have any possibility to disbale href/id on the generated response of a web-service that use RPC-encoded format? My generated soap body looks like this:
    <env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <m:Response xmlns:m="http://www.myTest.com">
    <result xmlns:n1="java:com.myTest" xsi:type="n1:Response">
    <ResultObject xsi:type="n1:ResultObject">
    <firstString href="#ID_6" />
    <integerObject href="#ID_13" />
    <secondString href="#ID_6" />
    </ResultObject>
    <ResultObject xsi:type="n1:ResultObject">
    <firstString href="#ID_6" />
    <integerObject href="#ID_13" />
    <secondString href="#ID_6" />
    </ResultObject>
    <ResultObject xsi:type="n1:ResultObject">
    <firstString href="#ID_6" />
    <integerObject href="#ID_13" />
    <secondString href="#ID_6" />
    </ResultObject>
    </result>
    </m:Response>
    <xsd:int xsi:type="xsd:int" id="ID_13">10</xsd:int>
    <xsd:string xsi:type="xsd:string" id="ID_6">EUR</xsd:string>
    </env:Body>
    Do I have any possibility to instruct the serialization process so that the result to conform with an XML schema and to keep the RPC-Encoded format? In other words to get rid of href/id:s? Href/id:s are used only for objects having the same reference.
    This issue is now even more problematic since JDK 5 when for integers boxing is not necessarily and thus, the compiler translates an Integer assignment using the method:
    public static Integer valueOf(int i)
    which returns cached Integer objects for any integer between -128 and 127.
    Please give some hints (others than using boxing for integers or changing the soap format to document-literal).
    Thanks

  • (SJAS9) Reading a context param in a web service

    Platform - SJAS9, NB5.5
    I am trying to add a web service to a small web project and I need database access for it.
    My web.xml defines 2 different resource-refs for my databases, jdbc/development and jdbc/production. There is also a global context-param named database with values of development or production that defines which database the web app should be using.
    I have two database pools set up under SJAS9 for these resource names, and the servlets can access these just fine using :
        protected Connection getConnection() {
            Connection conn = null;
            try {
                String datasourceName = "jdbc/" + getServletContext().getInitParameter("database");
                Context initCtx = new InitialContext();
                Context envCtx = (Context)initCtx.lookup("java:comp/env");
                DataSource ds = (DataSource)envCtx.lookup(datasourceName);
                log.debug("retrieving database connection for " + datasourceName);
                conn = ds.getConnection();
                log.debug("done");
                conn.setAutoCommit(false);
                return conn;
            catch (SQLException ex) {
                log.error("error getting a connection", ex);
                return null;
            catch (NamingException ex) {
                log.error("error finding the datasource", ex);
                return null;
        }I have just added a web service to the project, and I can't find a way to get the context param. When I created the web service, Netbeans added some annotation around it, and it is not extended any class or implementing any interface (that I can see).
    For the web service, there is no appropriate method equivalent for the call
                String datasourceName = "jdbc/" + getServletContext().getInitParameter("database");so how do I retrieve the context param database so I can know which resource pool to obtain the connection from inside the web service?
    Thanks
    Chris

    Here's how to invoke getServletContext() from a web service:
    First you'll need to add "ServiceLifecycle" to the list of implmentations of your class:
    public class MyService implements WebServices.MyServiceSoap, Remote, ServiceLifecycle {}Next you'll need to add the following:
    private ServletContext servletContext;
    public void destroy(){}  
    public void init(Object context) throws javax.xml.rpc.ServiceException {
       ServletEndpointContext soapContext = (ServletEndpointContext) context;
       servletContext = soapContext.getServletContext();
    Hope this helps!
    Peter

  • Generate web-service.xml

    I need to configure the deployment descriptor web-services.xml, but I don't know where or how to generate it. I use version 8.1 of weblogic. Someone can help me? thanks!

    I have an XML input in my transaction. I was able to generate the WSDL without problems. But need to know how to test it by sendig in some XML data. Probably, we could both be helping each other in the process.
    Regards,
    Chanti.

  • How to connect to database in web service??

    Hi all,
    How to connect to database in web service ? Can anyone give some advice what kind of database should i use? thanks

    No difference. Just connect as usual!
    Let me give you an example:
    Code to connect to postgresql db ...
    public Connection connectPostgresql(String servername, String dbname, String username, String password)
              Connection conn = null;
              try
                        // Load the JDBC driver
                        String driverName = "org.postgresql.Driver";
                        Class.forName(driverName);
                        // Create a connection to the database
                        String url = "jdbc:postgresql://" + servername +  "/" + dbname;
                        conn = DriverManager.getConnection(url, username, password);
                        return conn;               
              catch (ClassNotFoundException e)
                        // Could not find the database driver
                        return conn;
              catch (SQLException e)
                        // Could not connect to the database
                        return conn;
    }Code for an axis web service ...
    public Element[] updateProfile(Element[] params)
              String message = "";
              // get str 1
              Node node1 = params[0].getFirstChild();
              String str1= node1.getNodeValue();
              // get str 2
              Node node2 = params[1].getFirstChild();
              String str2= node2.getNodeValue();
              Connection conn = connectPostgresql ("localhost","myDatabase","myUsername","myPassword");
              // there is a method to insert these params to db
              boolean isInserted = insertParams(conn, str1, str2);
              if(isInserted )
                        message = "OK";
              else
                        message = "Not OK";
              // constructs an array of DOM Elements for message to send back to client
              SOAPBodyElement[] response = new SOAPBodyElement[1];
              response[0] = new SOAPBodyElement(XMLUtils.StringToElement("urn:foo", "e1", message));
              return response;
    }Gokce.

  • How can I call a SAPME web service from MII such as PlaceFutureHold?

    Dears,
    How can I call a SAPME web service from MII such as PlaceFutureHold?
    By using MII, I would like to develop some logic to check some values which query from SAPME database, if the value is out of spec, it needs to send a emal to inform user ans also hold the SFC.
    Thanks!

    With Web service action block you can view all ME available services
    in I.E
    https://sapme:5000/manufacturing-services/ProductionServiceService?wsdl  you could see your FutureHold service
    To do that in MII, you need Web Service action block. Have you work with MII transaction before?
    (saw your post in MII)

  • How to install and consume GroupWise Web Service (SOAP)

    Hello! I'm Razvan, programmer from Romnia, and I am new to GroupWise development.
    I am asking if anyone could help me with a C# Visual Studio 2010 example of how to install and consume GroupWise Web Service (SOAP).
    The documentation from novell site didn't help me, i didn't understant much of it.
    All I need is either a link to a documented GroupWise C# developer step-by-step tutorial, or some code examples.
    Can you please show me some code examples in C# with:
    1)loging in using a username and a password,
    2)retrieving contact list,
    3)retrieving appointment list,
    4)sending a mail,
    5)setting an appointment
    I don't know how to use "groupwise.wsdl" and customise it so that it points to our GroupWise server.
    Please, I really need this because I am working at a project right now which involves GroupWise integration.
    I hope I haven't disturbed anyone with my simple question.
    I know this might be a very simple question given the complexity of the other posts here, but that's why I really hope I will get an answer soon.
    Thank you very much!
    Signature:
    How old is the Orthodox faith?
    How old is the orthodox faith?

    Just a comment.
    The value for the version element should be "1.02"
    not "1.2".
    Preston
    >>> On Tuesday, March 01, 2011 at 8:06 AM,
    TheRomanian<[email protected]> wrote:
    > I have great news! After strong documentation yesterday and today, I've
    > just made a successfull example that actually connects to our GroupWise
    > server.
    >
    > I made it in PHP.
    >
    > I need an ASP.NET + C# application, but now is very simple to convert
    > it. I post the PHP code here for other people who in future might be
    > interested in finding out.
    >
    > So a simple PHP GroupWise Login code using "groupwise.wsdl" web
    > service:
    >
    >
    > require_once('./GWService/GroupwiseService.php');
    > require_once('FB.class.php');
    >
    > $classmap = array(
    > 'Authenication' => 'Authenication',
    > 'PlainText' => 'PlainText',
    > 'loginRequest' => 'loginRequest',
    > 'loginResponse' => 'loginResponse',
    > 'logoutRequest' => 'logoutRequest',
    > 'logoutResponse' => 'logoutResponse',
    > 'UserInfo' => 'UserInfo',
    > );
    >
    > $gwservice = new GroupwiseService(
    > "./WSDL/groupwise.wsdl",
    > array(
    > "location" => "http://11.150.40.78:8756/soap",
    > *Your GroupWise server IP:
    > and PORT*
    > "classmap" => $classmap,
    > "trace" => true)
    > );
    >
    > // do login
    > $pt = new PlainText();
    > $pt‑>username = *"YOUR GROUPWISE USERNAME"*;
    > $pt‑>password = *"YOUR GROUPWISE PASSWORD"*;
    >
    > $lr = new loginRequest();
    > $lr‑>auth = $pt;
    > $lr‑>language = "en";
    > $lr‑>version = "1.2";
    > $lr‑>application = "phpClient";
    >
    > $lres = $gwservice‑>loginRequest($lr);
    > //print_r($lres);
    >
    >
    > I Hope this will help others.
    >
    > ‑‑
    > Signature:
    >
    > How old is the Orthodox Faith?
    > 'How old is the orthodox faith?'
    > (http://www.orthodoxphotos.com/history.shtml)

  • Help me!    How to use it as a web service from third party application?

    After using JDeveloper to develop BSSV object e.g. JP550010, how to use it as a web service from third party application?
    TKS!

    Obviously the OP is working on a project for the Bead Society of Southeastern Virginia http://www.bssv.org. Oh, wait, maybe he's researching the Blueberry Shoestring Plant Virus http://abbreviations.yourdictionary.com/bssv
    :D
    John

  • How to consume sap xi pi web services or sap RFC with oracle 11g forms.

    Dear All
    how to consume sap xi pi web services or sap RFC with oracle 11g forms.
    or
    how to config 11g forms with sap xi....
    or how to call sap xi web services in 11g forms....
    or can send sample code....
    Regards
    smfatmi
    Edited by: smfatmi on Oct 17, 2011 2:16 AM
    Edited by: smfatmi on Oct 17, 2011 2:17 AM

    Dear All
    how to consume sap xi pi web services or sap RFC with oracle 11g forms.
    or
    how to config 11g forms with sap xi....
    or how to call sap xi web services in 11g forms....
    or can send sample code....
    Regards
    smfatmi
    Edited by: smfatmi on Oct 17, 2011 2:16 AM
    Edited by: smfatmi on Oct 17, 2011 2:17 AM

  • How to deploy and debug java web service in eclipes or using any other soft

    Hai,
    can any one tell me how to deploy and debug java web service in eclipes or using any other software.
    i have used tomcat web server and jdk1.4.0 to develop web service.
    we have used web service to interact with MS outlook .
    bye
    sudhakar.m

    Hi Sudhakar,
    If you are used to working with ant then you can very well use eclipse to deploy your web service.
    You would usually have the ant script in the source root working directory. From eclipse if you select the build file from the navigator view and right click you will see a run ant option in the pop up menu.
    Select that option and you would be able to see each targets with a checkbox select option. So define each target maybe one for wsdl2java conversion, one for compilation and one for deploying your web services. You can either make all of them run by having depends option on or you can run them individually as it takes your fancy.
    I am not sure about debugging a web service yet.
    Hope this helps
    Aviroop
    The truth is out there? Does anyone know the URL?

  • How to develop and call Asynchronous web service

    Hi All,
    I need to have a java web service that will be called asynchronously.
    That should execute, once triggered and caller shouldnt need to wait till its completion.
    How to develop and call asynchronoue web service ?
    Thanks
    Saikrishna

    Let your web service start its own background thread (*) somehow and move your business logic from web service to this thread. Then you can return from your web service. The client won't be blocked and your application will run on your server after service callout will be finished.
    I hope that's what you need. Anyway, there is only "asynchronous communication" and nothing like "asynchronous web service". At least from HTTP point of view, every call is synchronous - you have request and response.
    (*) You shouldn't start your own thread since you are in JEE world. Look at documentation for your container. E.g. for weblogic there are workers you can use this way. Or you can choose the other way. I hope that for any container you can just enqueue your web service request to any JMS queue and move your business logic to an appropriate MDB. Then, your web service will be just a simple JMS producer and your web service client won't be forced to wait for business logic to finish.
    Last but not least, next time choose a better forum. :-)

  • How to create Query as a web service in  Business Objcets

    Hi Friends,
    Can any one please guide me ' How to create Query as a web service in Business Objects'.
    Thanks in advance.
    Thanks & Regards,
    Ramnaresh.P.

    Hi,
    which version of BOBJ are you using?
    Regards
    Stratos

  • Could not generate stub objects for web service invocation in ColdFusion

    I was able to call the services on the development box - windows server without any problem at all, everything was working fine but the moment i uploaded to a linux box production server I get this error. "Could not generate stub objects for web service invocation in ColdFusion"
    What could be the cause of this problem, i have googled a lot but no solution yet any ideas.

    Let me make it simple:
    1. Server A is our development server.- hosted inhouse with coldfusion installed.
    2. Server B is our production server - a linux server with coldfusion installed hosted on the internet
    3. Server C is a third party server containing the webservice - this is a windows server with .net
    coldfusion is installed on Server A, the code works here and can connect to server C without any problem. It gets the required respone
    but when the code was uploaded to server c it gives the error when we run it.
    now i tried just a simple code which works fine on server A below:
    <cfinvoke webservice="http://www.webservicex.net/CurrencyConvertor.asmx?WSDL" method="ConversionRate" returnvariable="ConversionRateResult">
        <cfinvokeargument name="FromCurrency" value="EUR" />
        <cfinvokeargument name="ToCurrency" value="USD" />
    </cfinvoke>
    <cfdump var="#ConversionRateResult#" />
    But when i uploaded it to server C: it returns the error
    Cannot generate stub objects for web service invocation.
    Name: http://www.webservicex.net/CurrencyConvertor.asmx?WSDL. WSDL: http://www.webservicex.net/CurrencyConvertor.asmx?WSDL. java.io.FileNotFoundException: /opt/coldfusion8/stubs/WS728929035/NET/webserviceX/www/Currency.java (No such file or directory) It is recommended that you use a web browser to retrieve and examine the requested WSDL document to ensure it is correct. If the requested WSDL document cannot be retrieved or is dynamically generated, it is likely that the target web service has programming errors.
    The error occurred in /home/works/public_html/currency.cfm: line 7
    5 :     <cfinvokeargument name="FromCurrency" value="EUR" />
    6 :
    7 :     <cfinvokeargument name="ToCurrency" value="USD" />
    8 :
    9 : </cfinvoke>
    Now if you try the preceeding code on a windows environment  it works fine but the moment you put in the in the linux environment it generates this error
    I feel that the error may actually be :
    java.io.FileNotFoundException: /opt/coldfusion8/stubs/WS728929035/NET/webserviceX/www/Currency.java (No such file or directory)
    but i am clueless as to what to do next
    Ok so I tried the wget command on the linux
    this is what i got
    -bash-3.2# wget http://www.webservicesx.net/CurrencyConvertor.asmx?WDSL
    --2011-07-02 23:23:42--  http://www.webservicesx.net/CurrencyConvertor.asmx?WDSL
    Resolving www.webservicesx.net... 216.8.179.25
    Connecting to www.webservicesx.net|216.8.179.25|:80... connected.
    HTTP request sent, awaiting response... 403 Forbidden
    2011-07-02 23:23:43 ERROR 403: Forbidden.

Maybe you are looking for