Manoj Cheenath - Sample 31

Manoj, if you're readying this, thanks for the sample code at your site.
The extremely short story: I need to implement a doc/literal web service, and I want access to my SOAP Header and Body as a DOM. I may have to this via a chain handler, but I was able to get very close using Sample 31.
So, in HelloWorldService, I added this method:
public Document helloDomV2(Document inDoc)
and it worked like a champ. I could dump both the input DOM, and the return DOM to System.out.println() without problem.
Now, if I change the WS to a doc style, by doing this:
* @wlws:webservice style="document"
public class HelloWorldService{
Things stop working. On the standard Weblogic test page, I get this message:
** Do not know how to create a sample instance for this part due to the following exception:java.lang.InstantiationException: org.w3c.dom.Document. Pls replace this with the correct XML before invoking the service.**
and if I invoke the web service, I get the following SOAP exception:
<env:Fault>
<faultcode>Client</faultcode>
<faultstring>Unable to find a matching Operation for this remote invocation <foo>
</foo>. Please check your operation name. </faultstring>
</env:Fault>
Is there a way to combine a Document based web service, with a org.w3c.Document data type?

Interesting! I am looking at this example too. Is there any compelling reason to change the service into document oriented since it meets the needs to send/receive xml test?
Thanks,

Similar Messages

  • ANT task wsgen error while deploying RPC style web service

    Hi
    I am trying to assemble/deploy an rpc style weblogic web service using the 'wsgen'
    Ant task and the build.xml scripts provided with the samples. I get this error:
    Please help
    Thanks,
    Praveen
    C:\test>ant
    Buildfile: build.xml
    webservice:
    clean:
    [delete] Deleting directory C:\test\build
    init:
    [mkdir] Created dir: C:\test\build
    [mkdir] Created dir: C:\test\build\META-INF
    [copy] Copying 5 files to C:\test\build\META-INF
    compile_ejb:
    [javac] Compiling 5 source files to C:\test\build
    jar_ejb:
    [jar] Building jar: C:\test\a_statelessSession.jar
    ejbc:
    all:
    wsgen:
    Error at line:8 col:12 ':' Already got a ':' in name
    at weblogic.xml.babel.baseparser.SAXElementFactory.createSAXParseExc
    on(SAXElementFactory.java:60)
    at weblogic.xml.babel.parsers.StreamParser.<init>(StreamParser.java:
    at weblogic.xml.babel.parsers.BabelXMLEventStream.startDocument(Babe
    EventStream.java:28)
    at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:6
    at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:5
    at weblogic.soap.WebServiceProxy.getServiceFrom(WebServiceProxy.java
    at weblogic.ant.taskdefs.ejb.WSGenHelper.writeClientJar(WSGenHelper.
    :1125)
    at weblogic.ant.taskdefs.ejb.WSGenHelper.writeWSDL(WSGenHelper.java:
    at weblogic.ant.taskdefs.ejb.WSGenHelper.saveDescriptors(WSGenHelper
    a:1415)
    at weblogic.ant.taskdefs.ejb.WSGenHelper.output(WSGenHelper.java:148
    at weblogic.ant.taskdefs.ejb.WSGenHelper.doit(WSGenHelper.java:1517)
    at weblogic.ant.taskdefs.ejb.WSGen.execute(WSGen.java:93)
    at org.apache.tools.ant.Target.execute(Target.java:153)
    at org.apache.tools.ant.Project.runTarget(Project.java:898)
    at org.apache.tools.ant.Project.executeTarget(Project.java:536)
    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:213)
    at org.apache.tools.ant.Target.execute(Target.java:153)
    at org.apache.tools.ant.Project.runTarget(Project.java:898)
    at org.apache.tools.ant.Project.executeTarget(Project.java:536)
    at org.apache.tools.ant.Project.executeTargets(Project.java:510)
    at org.apache.tools.ant.Main.runBuild(Main.java:421)
    at org.apache.tools.ant.Main.main(Main.java:149)
    BUILD SUCCESSFUL
    Total time: 34 seconds
    C:\test>

    WLS6.1, service pack 2? I didn't know there were any service packs for 6.1 and
    6.0 didn't support wsgen and web services??
    simon.
    manoj cheenath <[email protected]> wrote:
    >
    >
    This is a known bug which is fixed in WLS 6.1 SP2.
    The workaround is to change the complex data types
    to have more than one level package names.
    for eg: change ....
    package foo;
    class Data{}
    to :
    package foo.bar;
    class Data{}
    -manoj
    Praveen wrote:
    Hi
    I am trying to assemble/deploy an rpc style weblogic web service usingthe 'wsgen'
    Ant task and the build.xml scripts provided with the samples. I getthis error:
    Please help
    Thanks,
    Praveen
    C:\test>ant
    Buildfile: build.xml
    webservice:
    clean:
    [delete] Deleting directory C:\test\build
    init:
    [mkdir] Created dir: C:\test\build
    [mkdir] Created dir: C:\test\build\META-INF
    [copy] Copying 5 files to C:\test\build\META-INF
    compile_ejb:
    [javac] Compiling 5 source files to C:\test\build
    jar_ejb:
    [jar] Building jar: C:\test\a_statelessSession.jar
    ejbc:
    all:
    wsgen:
    Error at line:8 col:12 ':' Already got a ':' in name
    at weblogic.xml.babel.baseparser.SAXElementFactory.createSAXParseExc
    on(SAXElementFactory.java:60)
    at weblogic.xml.babel.parsers.StreamParser.<init>(StreamParser.java:
    at weblogic.xml.babel.parsers.BabelXMLEventStream.startDocument(Babe
    EventStream.java:28)
    at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:6
    at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:5
    at weblogic.soap.WebServiceProxy.getServiceFrom(WebServiceProxy.java
    at weblogic.ant.taskdefs.ejb.WSGenHelper.writeClientJar(WSGenHelper.
    :1125)
    at weblogic.ant.taskdefs.ejb.WSGenHelper.writeWSDL(WSGenHelper.java:
    at weblogic.ant.taskdefs.ejb.WSGenHelper.saveDescriptors(WSGenHelper
    a:1415)
    at weblogic.ant.taskdefs.ejb.WSGenHelper.output(WSGenHelper.java:148
    at weblogic.ant.taskdefs.ejb.WSGenHelper.doit(WSGenHelper.java:1517)
    at weblogic.ant.taskdefs.ejb.WSGen.execute(WSGen.java:93)
    at org.apache.tools.ant.Target.execute(Target.java:153)
    at org.apache.tools.ant.Project.runTarget(Project.java:898)
    at org.apache.tools.ant.Project.executeTarget(Project.java:536)
    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:213)
    at org.apache.tools.ant.Target.execute(Target.java:153)
    at org.apache.tools.ant.Project.runTarget(Project.java:898)
    at org.apache.tools.ant.Project.executeTarget(Project.java:536)
    at org.apache.tools.ant.Project.executeTargets(Project.java:510)
    at org.apache.tools.ant.Main.runBuild(Main.java:421)
    at org.apache.tools.ant.Main.main(Main.java:149)
    BUILD SUCCESSFUL
    Total time: 34 seconds
    C:\test>
    -----------------------------------------------------------------<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    This is a known bug which is fixed in WLS 6.1 SP2.
    <p>The workaround is to change the complex data types
    <br>to have more than one level package names.
    <p>for eg: change ....
    <p><font color="#3366FF">package foo;</font>
    <br>class Data{}
    <p>to :
    <p><font color="#3333FF">package foo.bar;</font>
    <br>class Data{}
    <p>-manoj
    <p>Praveen wrote:
    <blockquote TYPE=CITE>Hi
    <br>I am trying to assemble/deploy an rpc style weblogic web service
    using
    the 'wsgen'
    <br>Ant task and the build.xml scripts provided with the samples. I get
    this error:
    <br>Please help
    <br>Thanks,
    <br>Praveen
    <br>-----------------------------------------------------------------
    <br>C:\test>ant
    <br>Buildfile: build.xml
    <p>webservice:
    <p>clean:
    <br>   [delete] Deleting directory C:\test\build
    <p>init:
    <br>    [mkdir] Created dir: C:\test\build
    <br>    [mkdir] Created dir: C:\test\build\META-INF
    <br>     [copy] Copying 5 files to C:\test\build\META-INF
    <p>compile_ejb:
    <br>    [javac] Compiling 5 source files to C:\test\build
    <p>jar_ejb:
    <br>      [jar] Building jar: C:\test\a_statelessSession.jar
    <p>ejbc:
    <p>all:
    <p>wsgen:
    <br>Error at line:8 col:12  ':' Already got a ':' in name
    <br>        at weblogic.xml.babel.baseparser.SAXElementFactory.createSAXParseExc
    <br>on(SAXElementFactory.java:60)
    <br>        at weblogic.xml.babel.parsers.StreamParser.<init>(StreamParser.java:
    <br>        at weblogic.xml.babel.parsers.BabelXMLEventStream.startDocument(Babe
    <br>EventStream.java:28)
    <br>        at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:6
    <br>        at weblogic.soap.WebServiceProxy.getXMLStream(WebServiceProxy.java:5
    <br>        at weblogic.soap.WebServiceProxy.getServiceFrom(WebServiceProxy.java
    <br>)
    <br>        at weblogic.ant.taskdefs.ejb.WSGenHelper.writeClientJar(WSGenHelper.
    <br>:1125)
    <br>        at weblogic.ant.taskdefs.ejb.WSGenHelper.writeWSDL(WSGenHelper.java:
    <br>)
    <br>        at weblogic.ant.taskdefs.ejb.WSGenHelper.saveDescriptors(WSGenHelper
    <br>a:1415)
    <br>        at weblogic.ant.taskdefs.ejb.WSGenHelper.output(WSGenHelper.java:148
    <br>        at weblogic.ant.taskdefs.ejb.WSGenHelper.doit(WSGenHelper.java:1517)
    <br>        at weblogic.ant.taskdefs.ejb.WSGen.execute(WSGen.java:93)
    <br>        at org.apache.tools.ant.Target.execute(Target.java:153)
    <br>        at org.apache.tools.ant.Project.runTarget(Project.java:898)
    <br>        at org.apache.tools.ant.Project.executeTarget(Project.java:536)
    <br>        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:213)
    <br>        at org.apache.tools.ant.Target.execute(Target.java:153)
    <br>        at org.apache.tools.ant.Project.runTarget(Project.java:898)
    <br>        at org.apache.tools.ant.Project.executeTarget(Project.java:536)
    <br>        at org.apache.tools.ant.Project.executeTargets(Project.java:510)
    <br>        at org.apache.tools.ant.Main.runBuild(Main.java:421)
    <br>        at org.apache.tools.ant.Main.main(Main.java:149)
    <p>BUILD SUCCESSFUL
    <p>Total time: 34 seconds
    <p>C:\test>
    <br>-----------------------------------------------------------------</blockquote>
    </html>

  • Re: Why doesn't WL7.0 support get/post bindings for web services ...

    hi!!!
    Could you pls point to any code example.
    thanks
    Pushpa
    "Richard Berger" <[email protected]> wrote:
    >
    Manoj: Thanks for the answer - do you have or can you point me at any
    code samples
    that accomplish this? (Yes, .NET is limited to strings/ints in their
    get/post
    bindings).
    Thanks so much!
    RB
    PS - Also, can you explain any apparent discrepancy between your answer
    and what
    the WL documentation stated (again, it may be my misunderstanding).
    "manoj cheenath" <[email protected]> wrote:
    WL 7.0 does allow you to access the web service through
    the browser. It even allows you to invoke service methods
    with complex type arguments (.Net only supports primitive
    types) and also to view the request and response soap
    message for the invocation.
    regards,
    -manoj
    "Richard Berger" <[email protected]> wrote in message
    news:[email protected]...
    This might be a naive question, but according to the documentation,WL 7.0
    does
    not support http post/get bindings for web services. Thus, for meto
    access a
    web service, I need to write a "middle tier" of some sort (I used
    the
    automatically
    generated Java proxy code and JSP). All works fine, but it seems
    like
    it
    would
    sure be nice to have HTML forms access web services without havingto
    write a
    middle tier.
    NET does this and it is extremely useful - is there a reason that
    BEA
    chose not
    to provide this feature? (e.g. is it architecturally unsound in anyway?
    or is
    there an easy way to simulate it?). Given some of the Web Workshoppositioning
    re: ease of use and .NET comparison, this seems like an omission.
    Any insights are greatly appreciated.
    Enjoy,
    RB
    PS - Here's the info from the documentation
    Web Services Description Language (WSDL) 1.1 Specification
    WSDL is an XML-based language that describes Web services. WSDL definesWeb services
    as a set of endpoints operating on messages; these message containeither
    message-style
    or RPC-style information. The operations and messages are describedabstractly
    in WSDL, and then bound to a concrete network protocol and messageformat
    to define
    an endpoint. Related concrete endpoints are combined into abstractendpoints (services).
    WSDL is extensible to allow the description of endpoints and theirassociated
    messages regardless of what message formats or network protocols areused
    to communicate,
    however, the only bindings described in the specification describehow to
    use
    WSDL in conjunction with SOAP 1.1, HTTP GET/POST, and MIME.
    Note: WebLogic Server supports only SOAP 1.1 bindings.
    The WSDL 1.1 Specification is available at http://www.w3.org/TR/wsdl.

    This isn't a straight FORM Post as in the http binding support in WSDL. It posts
    a soap message.
    It's apparent that Workshop supports form-post and form-get.
    But I dont see how it is done with straight WebLogic webservices. Does WebLogic
    server read the web-services.xml or the WSDL file? I dont see a way to put in
    http-post binding in the former and in the latter it seems to be ignored.
    Can someone clarify.
    Thanks.
    Chu-chi
    "manoj cheenath" <[email protected]> wrote:
    Here is a live example:
    http://65.193.192.35:7001/base/SoapInteropBaseService
    Here is an example that you can download:
    http://manojc.com/?sample2
    This is how you run it:
    http://manojc.com/?tutorial/doc/howtorun.html
    More info can be found from the edocs:
    7.0:
    http://edocs.bea.com/wls/docs70/webserv/index.html
    8.1:
    http://edocs.bea.com/wls/docs81/webserv/index.html
    Regards,
    -manoj
    http://manojc.com
    "pushpa krishna" <[email protected]> wrote in message
    news:[email protected]...
    hi!!!
    Could you pls point to any code example.
    thanks
    Pushpa
    "Richard Berger" <[email protected]> wrote:
    Manoj: Thanks for the answer - do you have or can you point me at
    any
    code samples
    that accomplish this? (Yes, .NET is limited to strings/ints in their
    get/post
    bindings).
    Thanks so much!
    RB
    PS - Also, can you explain any apparent discrepancy between your answer
    and what
    the WL documentation stated (again, it may be my misunderstanding).
    "manoj cheenath" <[email protected]> wrote:
    WL 7.0 does allow you to access the web service through
    the browser. It even allows you to invoke service methods
    with complex type arguments (.Net only supports primitive
    types) and also to view the request and response soap
    message for the invocation.
    regards,
    -manoj
    "Richard Berger" <[email protected]> wrote in message
    news:[email protected]...
    This might be a naive question, but according to the documentation,WL 7.0
    does
    not support http post/get bindings for web services. Thus, for
    me
    to
    access a
    web service, I need to write a "middle tier" of some sort (I used
    the
    automatically
    generated Java proxy code and JSP). All works fine, but it seems
    like
    it
    would
    sure be nice to have HTML forms access web services without havingto
    write a
    middle tier.
    NET does this and it is extremely useful - is there a reason that
    BEA
    chose not
    to provide this feature? (e.g. is it architecturally unsound in
    any
    way?
    or is
    there an easy way to simulate it?). Given some of the Web Workshoppositioning
    re: ease of use and .NET comparison, this seems like an omission.
    Any insights are greatly appreciated.
    Enjoy,
    RB
    PS - Here's the info from the documentation
    Web Services Description Language (WSDL) 1.1 Specification
    WSDL is an XML-based language that describes Web services. WSDL
    defines
    Web services
    as a set of endpoints operating on messages; these message containeither
    message-style
    or RPC-style information. The operations and messages are describedabstractly
    in WSDL, and then bound to a concrete network protocol and messageformat
    to define
    an endpoint. Related concrete endpoints are combined into abstractendpoints (services).
    WSDL is extensible to allow the description of endpoints and theirassociated
    messages regardless of what message formats or network protocols
    are
    used
    to communicate,
    however, the only bindings described in the specification describehow to
    use
    WSDL in conjunction with SOAP 1.1, HTTP GET/POST, and MIME.
    Note: WebLogic Server supports only SOAP 1.1 bindings.
    The WSDL 1.1 Specification is available at http://www.w3.org/TR/wsdl.

  • Why doesn't WL7.0 support get/post bindings for web services ...

    This might be a naive question, but according to the documentation, WL 7.0 does
    not support http post/get bindings for web services. Thus, for me to access a
    web service, I need to write a "middle tier" of some sort (I used the automatically
    generated Java proxy code and JSP). All works fine, but it seems like it would
    sure be nice to have HTML forms access web services without having to write a
    middle tier.
    .NET does this and it is extremely useful - is there a reason that BEA chose not
    to provide this feature? (e.g. is it architecturally unsound in any way? or is
    there an easy way to simulate it?). Given some of the Web Workshop positioning
    re: ease of use and .NET comparison, this seems like an omission.
    Any insights are greatly appreciated.
    Enjoy,
    RB
    PS - Here's the info from the documentation
    Web Services Description Language (WSDL) 1.1 Specification
    WSDL is an XML-based language that describes Web services. WSDL defines Web services
    as a set of endpoints operating on messages; these message contain either message-style
    or RPC-style information. The operations and messages are described abstractly
    in WSDL, and then bound to a concrete network protocol and message format to define
    an endpoint. Related concrete endpoints are combined into abstract endpoints (services).
    WSDL is extensible to allow the description of endpoints and their associated
    messages regardless of what message formats or network protocols are used to communicate,
    however, the only bindings described in the specification describe how to use
    WSDL in conjunction with SOAP 1.1, HTTP GET/POST, and MIME.
    Note: WebLogic Server supports only SOAP 1.1 bindings.
    The WSDL 1.1 Specification is available at http://www.w3.org/TR/wsdl.

    Manoj: Thanks for the answer - do you have or can you point me at any code samples
    that accomplish this? (Yes, .NET is limited to strings/ints in their get/post
    bindings).
    Thanks so much!
    RB
    PS - Also, can you explain any apparent discrepancy between your answer and what
    the WL documentation stated (again, it may be my misunderstanding).
    "manoj cheenath" <[email protected]> wrote:
    WL 7.0 does allow you to access the web service through
    the browser. It even allows you to invoke service methods
    with complex type arguments (.Net only supports primitive
    types) and also to view the request and response soap
    message for the invocation.
    regards,
    -manoj
    "Richard Berger" <[email protected]> wrote in message
    news:[email protected]...
    This might be a naive question, but according to the documentation,WL 7.0
    does
    not support http post/get bindings for web services. Thus, for meto
    access a
    web service, I need to write a "middle tier" of some sort (I used theautomatically
    generated Java proxy code and JSP). All works fine, but it seems likeit
    would
    sure be nice to have HTML forms access web services without havingto
    write a
    middle tier.
    NET does this and it is extremely useful - is there a reason that BEAchose not
    to provide this feature? (e.g. is it architecturally unsound in anyway?
    or is
    there an easy way to simulate it?). Given some of the Web Workshoppositioning
    re: ease of use and .NET comparison, this seems like an omission.
    Any insights are greatly appreciated.
    Enjoy,
    RB
    PS - Here's the info from the documentation
    Web Services Description Language (WSDL) 1.1 Specification
    WSDL is an XML-based language that describes Web services. WSDL definesWeb services
    as a set of endpoints operating on messages; these message containeither
    message-style
    or RPC-style information. The operations and messages are describedabstractly
    in WSDL, and then bound to a concrete network protocol and messageformat
    to define
    an endpoint. Related concrete endpoints are combined into abstractendpoints (services).
    WSDL is extensible to allow the description of endpoints and theirassociated
    messages regardless of what message formats or network protocols areused
    to communicate,
    however, the only bindings described in the specification describehow to
    use
    WSDL in conjunction with SOAP 1.1, HTTP GET/POST, and MIME.
    Note: WebLogic Server supports only SOAP 1.1 bindings.
    The WSDL 1.1 Specification is available at http://www.w3.org/TR/wsdl.

  • Re: Describe input xml

    Anamitra,
    I didn't get a chance to work on this issue.
    From my understanding I have quickly created a test wsdl and test xsd.
    I don't know whether it will work. I have not tested it. It needs many
    corrections.
    Take a look at the attached wsdl and xsd and let me know your suggestion.
    Scenario:
    1. Exposed method:
    public String requestPurchaseOrder(String poXML)
    2. poXML should be of type po.xsd
    3. Validation - ?? No Idea. For now manual validation.
    I guess we both have similar requirement, if you get it working before me,
    please post your finding.
    Thanks,
    Karthik.
    "Anamitra" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hi karthik
    I still dont get how the poXML can be represented by a schema in a WSDL.Can you
    give me a sample wsdl for that?
    Thanks
    Anamitra
    "Karthik V" <[email protected]> wrote:
    Manoj:
    Sorry, I got confused when you said, "the runtime will strip the xml
    tags".
    After your explanation, I understand that the runtime is actually going
    to
    perform some conversion without any loss of data.
    To conclude, logically,
    public void test(String poXML) is valid, and poXML can be represented
    by
    a schema definition.
    When I get a chance, I'm going to create a quick example of this use
    case
    and post it.
    Thanks,
    /k
    "manoj cheenath" <[email protected]> wrote in message
    news:[email protected]...
    java.lang.String is mapped to xsd:string which means the xml
    should look like:
    <foo xsi:type=xsd:string >sometext without any xml tags</foo>
    So if there are xml tags inside the string you passed
    in, runtime need to replace the tags with > and
    <.
    On the other end the runtime will again replace
    etc back to < or >. So you will get back theright XML. But on the wire it will be plain text
    not XML.
    So, if you dont want to convert to string, then you should use
    javax.xml.soap.SOAPElement or org.w3c.Element as
    your parameter type instead of java.lang.String.
    http://manojc.com
    "Karthik V" <[email protected]> wrote in message
    news:[email protected]...
    Manoj:
    I do not understand how the runtime will strip the xml.
    I think Anamitra's requirement of:
    public void test(String poXML)
    is very valid and a simple requirement.
    Infact, my requirement too is similar..
    1. Expose a method which takes in a String object.
    2. Define how the String is going to look like (using xsd).
    3. Instead of defining the schema in WSDL, we would like to import
    the
    schema and use it.
    4. Later use the schema to validate the incoming request.
    In real time most of us would like to work with String because ofits
    simplicity.
    Is there any reason why the implementation for such a simple usecase is
    so
    confusing?
    /k
    "manoj cheenath" <[email protected]> wrote in message
    news:[email protected]...
    public void test( String poXML )
    is not the best solution for you, i think, because
    in this case the runtime will strip the xml tags
    inside poXML. so the envelope will look like:
    <m:my-method>
    <poXML>sdfjds >some thing < something else...</poXML>
    </m:my-method>
    instead of:
    <m:my-method>
    <poXML>some thing <foo> something else</foo></poXML>
    </m:my-method>
    Will that be ok for you? Else, you can use DOM or
    javax.xml.soap.SOAPElement:
    public void test( org.w3c.Dom poXML );
    It looks like there is bug in WLS 7.0.2. The CR for this
    is CR104719. Please contact support if you need a patch.
    If you do clientgen on the WSDL, it is going to generate
    the classes (value types) for you. It looks like you do not
    want to do data binding. Take a look at DII client with generic
    type-mapping. Will this help you?
    package examples.jaxrpc.call5;
    import java.net.URL;
    import javax.xml.soap.SOAPConstants;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.Call;
    import javax.xml.rpc.ParameterMode;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.encoding.TypeMapping;
    import javax.xml.rpc.encoding.TypeMappingRegistry;
    import javax.xml.soap.SOAPElement;
    import weblogic.webservice.encoding.GenericTypeMapping;
    import weblogic.webservice.core.soap.SOAPElementImpl;
    public class MSInterop{
    public static void main( String[] args ) throws Exception{
    //dont parse wsdl till we set the typemapping
    System.setProperty( "weblogic.webservice.servicenamechecking",
    "false" );
    //create service factory
    ServiceFactory factory = ServiceFactory.newInstance();
    //define qnames
    String targetNamespace = "http://soapinterop.org/";
    QName serviceName = new QName( targetNamespace, "SimpleTest"
    QName portName = new QName( targetNamespace, "SimpleTestSoap");
    QName operationName = new QName( "http://soapinterop.org/",
    "echoStruct" );
    URL wsdlLocation = new URL(
    "http://www.mssoapinterop.org/asmx/simple.asmx?WSDL" );
    //create service
    Service service = factory.createService( wsdlLocation,serviceName );
    TypeMappingRegistry registry =
    service.getTypeMappingRegistry();
    >>>>>
    registry.register( SOAPConstants.URI_NS_SOAP_ENCODING,
    new GenericTypeMapping() );
    //create call
    Call call = service.createCall( portName, operationName );
    //construct struct
    SOAPElement elem = new SOAPElementImpl( "inputStruct", null,null );
    elem.addChildElement( "varInt" ).addTextNode( "1" );
    elem.addChildElement( "varString" ).addTextNode( "samplestring" );
    elem.addChildElement( "varFloat" ).addTextNode( "2.2" );
    System.out.println( elem );
    try{
    SOAPElement res = (SOAPElement)call.invoke(new Object[]{elem } );
    System.out.println( res );
    }catch( javax.xml.rpc.JAXRPCException e ){
    e.printStackTrace();
    e.getLinkedCause().printStackTrace();
    Call echoFloat = service.createCall( portName,
    new QName( "http://soapinterop.org/", "echoFloat" ) );
    System.out.println( echoFloat.invoke( new Object[]{new
    Float(100.0)} ) );
    http://manojc.com
    "Anamitra" <[email protected]> wrote in message
    news:[email protected]...
    Hi Bruce
    I think the wsdl that you sent was very near to what I was
    looking
    for.
    But I
    would try to make the requirement more clear: The points below
    are
    listed
    in order
    of priority:
    1>First and foremost I am looking to create a Webservice such
    that
    it
    exposes
    a method which takes in a java.lang.String
    public void test(String poXML)
    But in the WSDL I want to show the user the schema definition
    for
    the
    po
    XML.
    And would desire that the Webservices framework do the schema
    validation
    of the
    incoming xml. But I dont thing this works as the wsdl generated
    always
    says the
    type is "xsd:string". So I started looking into the 2nd option:
    2>Create a doc/literal type service and expose that method as:
    public void test(POXMLBean poXML)
    This generated the reqd schema in the wsdl level but the client
    is
    being
    forced
    to use the POXMLBean to invoke the method. I would ideally want
    the
    client
    to
    just deal with the XML of the pobean as described in the
    generated
    schema
    definition.
    For example the client using JAXRPC should be say doing the code
    like
    this:
    String poXML = "<po> <order>000</order> </po>"
    call.invoke(poXML").
    Is this possible? I am not able to do this. My primary important
    thing
    is
    that
    the client has to deal with XML and not with anything else. The
    client
    shouldnot
    have to deal with POXMLBean. This is what I am trying to acheive
    and
    not
    able
    to.
    3> So that leaves me to the last option which is not that good:
    ie I keep my original approach:
    public void test(String poXML)
    and somehow via wsdl:documentation say that the schema for this
    poXML
    is
    this...
    But I cannot change the type in the parameter poXML from
    xs:string
    right?
    Bottom line is there any way for the client to pass string/byte[]
    xml
    data
    to
    the webservice - but still be able to look into the WSDL and
    see
    what
    the
    reqd
    XML structure should be? I thought doc/literal should do it -
    but
    using
    weblogic
    I am not able to do it. Can u help me with this pls.
    thanks
    Anamitra
    Bruce Stephens <[email protected]> wrote:
    Hello,
    See what you think of this example of using import. It seems
    to
    describe your exact use case:
    http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Retai
    l
    er.wsdl
    (Disclaimer, anyone could have found this via public UDDI.)
    The issue I believe that Anamitra sees is the gap between the
    runtime
    and the toolset.
    Bruce
    Anamitra wrote:
    Hi Karthik
    I am a bit confused as to what you mean when u say "import".
    The
    generated
    webservices.xml
    contains a <types> and a <type-mapping> element. I suppose
    u r
    asking
    me to put
    the xsd definition in the <types> section - right?
    If the method is like this:
    public String doit(String msg)
    How do I attach the <xs:string> type "msg" to the actual
    XML
    schema
    that I just
    imported?
    I dont know whether I am asking stupid questions or not -
    but I
    would
    have ideall
    liked to see my "msg" of type say "PurchaseOrder" which is
    the
    schema
    that I imported.
    And the external client should just be able to give the
    "PurchaseOrder"
    xml to
    the Webservice and invoke the "doit" method.
    Am I making any sense?
    thanks
    Anamitra
    "Karthik V" <[email protected]> wrote:
    I doubt if servicegen has any option for doing it
    automatically.
    You should manually edit web-services.xml and import thexsd.
    /k
    "Anamitra" <[email protected]> wrote in message
    news:[email protected]...
    Hi Karthik/Bruce
    Can you pls explain to me how using weblogic tools
    [servicegen]
    one
    can
    include
    the xsd pointers in the WSDL file.
    We have a similar kind of requirement where we have
    webservices
    which
    take
    in
    string [XML data] as a parameter and the WSDL only shows
    method
    parameter
    types
    as xsd:string - but we want to show something like a schema
    definition.
    So
    if
    there is anyway to put the schema definition in the WSDL
    - pls
    let
    me know
    that
    would be very very helpful.
    thanks
    Anamitra
    "Karthik V" <[email protected]> wrote:
    Bruce,
    Thanks for your response. That helped.
    I have another question for you.
    I know this would sound strange.
    But my requirement is to expose a session bean method
    that
    could
    take
    different xml inputs.
    For example:
    TestBean exposes testMethod(String xmlstr)
    xmlstr could be of schema xmlSchema1.xsd
    or xmlstr could be of schema xmlSchema2.xsd
    In future it could also represent xmlSchema3.xsd... and
    so
    on.
    What is the right approach in this scenario?
    I was thinking to create a different web service fordifferent
    xsd.
    Say, webservice1 imports xmlSchema1.xsd, webservice2
    imports
    xmlSchema2.xsd...
    Un fortunately due to some design restrictions, I cannotcreate
    different
    methods in my session bean like testMethod1,
    testMethod2....
    Is there any other better way to do this in one webservice?
    >>>>>>>>>>>
    Thanks in advance for any suggestions. And excuse myunusual
    requirement.
    /k
    "Bruce Stephens" <[email protected]> wrote in message
    news:[email protected]...
    Hello,
    Personally I like to see everything in one place, i.e.
    in
    the
    WSDL,
    however everyone else :-) uses the import. The
    SOAPBuilders
    round
    3
    have several tests showing imports. Also WSI Basic
    profile
    has
    some
    helpful guidelines on using import:
    http://www.ws-i.org/Profiles/Basic/2003-03/BasicProfile-1.0-BdAD.html
    >>>>>>>>>>>>
    HTHs,
    Bruce
    Karthik V wrote:
    Hi,
    I have created few doc style web services, with a
    very
    complex
    xml
    input
    and
    output. (1200 lines of xsd)
    Input and out put are xml as java.lang.String.
    What would be the best practice to represent this
    in the
    WSDL?
    Just
    a
    reference to the xsd file is good, or should it be
    completely
    presented
    within the WSDL? I'm not sure how my wsdl should look
    like...
    I will be using the same schema (xsd) in other web
    services
    too
    to
    perform
    different functions.
    Any suggestions would be greatly appreciated.
    Thanks
    /k
    [testWSDL.wsdl]
    [PO.xsd]

    Hello Karthik/Anamitra,
    i have the same requirements in my webservices:
    1) Expose the Handler method receiving String
    public String runRequest(String poXML)
    2) On the other hand - the message (the poXML string) should be in XML format according to some XSD file.
    Have you got this working already?
    If so, please explain what the WSDL looks like.
    Thanks in advance,
    Orly

  • Error deploying webService in 7.0, 'jarName is NULL'

    While trying to deploy a webservice in 7.0, I am getting the error:
    Application is not configured properly {jarName is NULL}
    I have used servicegen ant task to build my simple service consisting of two java
    classes (no EJB). Changed only 1 line from the sample build.xml in the document,
    viz. replace ejbjar attribute with javaClassComponents attribute. Deploying with
    Administration Console application.
    Thanks.
    Pratip Mukherjee

    Thanks. That solved the problem. Mostly. I had to make another change though. My
    test case java class was extending another base java class. Looks like either
    the ant build script or the Weblogic Web Services does not like that. I had to
    remove that to make it to work.
    "Neal Yin" <[email protected]> wrote:
    Nothing wrong with your build.xml or servicegen. Please try to drop
    your
    ear to application directory. I would guess something is wrong with console
    deployment.
    -Neal
    "Pratip Mukherjee" <[email protected]> wrote in message
    news:[email protected]...
    Looks like my build.xml did not make it to my previous post. Here itis as
    an attachment.
    "Pratip Mukherjee" <[email protected]> wrote:
    My servicegen in build.xml seems to be very similar to yours. It is
    as
    below. I
    am also enclosing the resulting ear file created by ant build.
    <project name="Simple" default="build-ear">
    <target name="build-ear">
    <servicegen
    destEar="SimpleService.ear"
    warName="SimpleWAR.war" >
    <service
    javaClassComponents="WebServicesTest.Server.Simple.TestService"
    targetNamespace="http://mroa590859:7010/myWAR/Simple"
    serviceName="Simple"
    serviceURI="/Simple"
    generateTypes="True"
    expandMethods="True" >
    <client
    packageName="WebServicesTest.Client.Simple"
    clientJarName="SimpleClient.jar"
    />
    </service>
    </servicegen>
    </target>
    <target name="clean">
    <delete>
    <fileset dir="."
    includes="SimpleService.ear" />
    </delete>
    </target>
    </project>
    "manoj cheenath" <[email protected]> wrote:
    I need to see your build.xml file to really know what is
    going wrong. Here is an example servicegen that works
    with the java class component.
    <servicegen
    destEar="${APPLICATIONS}/${ear_file}"
    warName="${war_file}">
    <service
    javaClassComponents="examples.webservices.basic.javaclass.HelloWorld"
    targetNamespace="${namespace}"
    serviceName="HelloWorld"
    serviceURI="/HelloWorld"
    generateTypes="True"
    expandMethods="True">
    <client
    packageName="examples.webservices.basic.javaclass"
    clientJarName="${client_jar_file}"
    />
    </service>
    <classpath>
    <pathelement path="${build}"/>
    <pathelement path="${java.class.path}"/>
    </classpath>
    </servicegen>
    regards,
    -manoj
    "Pratip Mukherjee" <[email protected]> wrote in message
    news:[email protected]...
    While trying to deploy a webservice in 7.0, I am getting the error:
    Application is not configured properly {jarName is NULL}
    I have used servicegen ant task to build my simple service consistingof
    two java
    classes (no EJB). Changed only 1 line from the sample build.xml
    in
    the
    document,
    viz. replace ejbjar attribute with javaClassComponents attribute.Deploying with
    Administration Console application.
    Thanks.
    Pratip Mukherjee

  • Does web service support all the properties in the standalone BI console?

    Hi,
    Currently I am using BI web service API to get the report and its parameters and so on. But I find that the object definition in the web service can't be full defined to match the properties in the console UI. For exaple, ReportDefinition object there is no description property, so I can't get the desc by the ReportDefinition object (By now I don't know how to get it). Another sample is, there is no Parameter object defined in the web service, only ParamNameValue object, so I can't get the default value for the parameter defined in the console UI.
    Is there any solution for me?
    HELP!!!

    It is just not working for me. I am using static stub.
    After tracking the HTTP traffic, I found that the WL70 server is not issuing any
    cookie. I have configured all the parameters for tracking session in the web application,
    but I still don't see any cookie in the HTTP headers from the server. I also tried
    to invoke the service using a browser, still no cookie seen. Is this a bug or
    there is some other configuration for the server?
    - Hao
    "manoj cheenath" <[email protected]> wrote:
    By default client will maintain the session. You dont have to set this
    property.
    Are you using static or dyn client?
    Also, you should use the same instance of the stub for all your invokes
    (all invokes to be in the same session).
    regards,
    -manoj
    "Hao Chen" <[email protected]> wrote in message
    news:[email protected]..
    It is not working for me.
    When I set the "javax.xml.rpc.session.maintain" property, weblogicthrows
    "UnsupportedOperation"
    exception and be default I don't see any session information beingpassed.
    How do I configure the client side or even the server?
    Thanks.
    - Hao
    "manoj cheenath" <[email protected]> wrote:
    WL70 client does support http session. Is this not
    working for you?
    regards,
    -manoj
    "Hao Chen" <[email protected]> wrote in message
    news:3d6402ac$[email protected]..
    Does anybody know how to make WL70 Web Service support sessions?
    The "javax.xml.rpc.session.maintain" property on Stub does not seemto
    work.
    Without session support, it is almost no use for us because we haveto
    authenticate
    the user each time.
    Thanks in advance.
    - Hao

  • Clientgen does not generate service specific exceptions

    Hi,
    When we use clientgen to generate client stubs and on exploding the generated
    _client.jar file we find that only the first service specific exception following
    RemoteException is being generated. All other exceptions seem to be missing. Here
    is an example of a sample service method:
    void actionWorkitem(WSCredentials credentials, String workitemUri, String action)
    throws RemoteException, WorkflowException, SameStateException;
    Here the last exception (i.e:SameStateException which is a service specific exception
    ) is missing in the generated client jar file.
    Is this a bug ?
    Any help in this issue is appreciated.
    Thanks,
    Anu.

    We are using 7.0.2. Do you acknowledge this as a bug?
    Also to add to the problem. If we use the clientgen generated stubs to make a
    soap call on the mentioned operation
    void actionWorkitem(WSCredentials credentials, String workitemUri,String action)
    throws RemoteException, WorkflowException, SameStateException;
    which would actually throw a SameStateException, the exception message comes
    as WorkflowException (which was the only exception class correctly generated by
    the clientgen.)
    This means the generated stubs wrap messages from all the service-specific exceptions
    into one service specific exception. This looks like a bug too.
    Thanks
    Puneet
    "manoj cheenath" <[email protected]> wrote:
    Which version of WLS?
    Please try out WLS 8.1 SP1. There are many fault related
    bug fixes done in SP1.
    Regards,
    -manoj
    http://manojc.com
    "Anu Alwar" <[email protected]> wrote in message
    news:3f329454$[email protected]..
    Hi,
    When we use clientgen to generate client stubs and on exploding thegenerated
    _client.jar file we find that only the first service specific exceptionfollowing
    RemoteException is being generated. All other exceptions seem to bemissing. Here
    is an example of a sample service method:
    void actionWorkitem(WSCredentials credentials, String workitemUri,String action)
    throws RemoteException, WorkflowException, SameStateException;
    Here the last exception (i.e:SameStateException which is a servicespecific exception
    ) is missing in the generated client jar file.
    Is this a bug ?
    Any help in this issue is appreciated.
    Thanks,
    Anu.

  • Describe input xml

    Hi,
    I have created few doc style web services, with a very complex xml input and
    output. (1200 lines of xsd)
    Input and out put are xml as java.lang.String.
    What would be the best practice to represent this in the WSDL? Just a
    reference to the xsd file is good, or should it be completely presented
    within the WSDL? I'm not sure how my wsdl should look like...
    I will be using the same schema (xsd) in other web services too to perform
    different functions.
    Any suggestions would be greatly appreciated.
    Thanks
    /k

    Hi karthik
    I still dont get how the poXML can be represented by a schema in a WSDL. Can you
    give me a sample wsdl for that?
    Thanks
    Anamitra
    "Karthik V" <[email protected]> wrote:
    Manoj:
    Sorry, I got confused when you said, "the runtime will strip the xml
    tags".
    After your explanation, I understand that the runtime is actually going
    to
    perform some conversion without any loss of data.
    To conclude, logically,
    public void test(String poXML) is valid, and poXML can be represented
    by
    a schema definition.
    When I get a chance, I'm going to create a quick example of this use
    case
    and post it.
    Thanks,
    /k
    "manoj cheenath" <[email protected]> wrote in message
    news:[email protected]...
    java.lang.String is mapped to xsd:string which means the xml
    should look like:
    <foo xsi:type=xsd:string >sometext without any xml tags</foo>
    So if there are xml tags inside the string you passed
    in, runtime need to replace the tags with > and
    <.
    On the other end the runtime will again replace
    etc back to < or >. So you will get back theright XML. But on the wire it will be plain text
    not XML.
    So, if you dont want to convert to string, then you should use
    javax.xml.soap.SOAPElement or org.w3c.Element as
    your parameter type instead of java.lang.String.
    http://manojc.com
    "Karthik V" <[email protected]> wrote in message
    news:[email protected]...
    Manoj:
    I do not understand how the runtime will strip the xml.
    I think Anamitra's requirement of:
    public void test(String poXML)
    is very valid and a simple requirement.
    Infact, my requirement too is similar..
    1. Expose a method which takes in a String object.
    2. Define how the String is going to look like (using xsd).
    3. Instead of defining the schema in WSDL, we would like to import
    the
    schema and use it.
    4. Later use the schema to validate the incoming request.
    In real time most of us would like to work with String because ofits
    simplicity.
    Is there any reason why the implementation for such a simple usecase is
    so
    confusing?
    /k
    "manoj cheenath" <[email protected]> wrote in message
    news:[email protected]...
    public void test( String poXML )
    is not the best solution for you, i think, because
    in this case the runtime will strip the xml tags
    inside poXML. so the envelope will look like:
    <m:my-method>
    <poXML>sdfjds >some thing < something else...</poXML>
    </m:my-method>
    instead of:
    <m:my-method>
    <poXML>some thing <foo> something else</foo></poXML>
    </m:my-method>
    Will that be ok for you? Else, you can use DOM or
    javax.xml.soap.SOAPElement:
    public void test( org.w3c.Dom poXML );
    It looks like there is bug in WLS 7.0.2. The CR for this
    is CR104719. Please contact support if you need a patch.
    If you do clientgen on the WSDL, it is going to generate
    the classes (value types) for you. It looks like you do not
    want to do data binding. Take a look at DII client with generic
    type-mapping. Will this help you?
    package examples.jaxrpc.call5;
    import java.net.URL;
    import javax.xml.soap.SOAPConstants;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.Call;
    import javax.xml.rpc.ParameterMode;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.encoding.TypeMapping;
    import javax.xml.rpc.encoding.TypeMappingRegistry;
    import javax.xml.soap.SOAPElement;
    import weblogic.webservice.encoding.GenericTypeMapping;
    import weblogic.webservice.core.soap.SOAPElementImpl;
    public class MSInterop{
    public static void main( String[] args ) throws Exception{
    //dont parse wsdl till we set the typemapping
    System.setProperty( "weblogic.webservice.servicenamechecking",
    "false" );
    //create service factory
    ServiceFactory factory = ServiceFactory.newInstance();
    //define qnames
    String targetNamespace = "http://soapinterop.org/";
    QName serviceName = new QName( targetNamespace, "SimpleTest"
    QName portName = new QName( targetNamespace, "SimpleTestSoap");
    QName operationName = new QName( "http://soapinterop.org/",
    "echoStruct" );
    URL wsdlLocation = new URL(
    "http://www.mssoapinterop.org/asmx/simple.asmx?WSDL" );
    //create service
    Service service = factory.createService( wsdlLocation,serviceName );
    TypeMappingRegistry registry = service.getTypeMappingRegistry();
    registry.register( SOAPConstants.URI_NS_SOAP_ENCODING,
    new GenericTypeMapping() );
    //create call
    Call call = service.createCall( portName, operationName );
    //construct struct
    SOAPElement elem = new SOAPElementImpl( "inputStruct", null,
    null );
    elem.addChildElement( "varInt" ).addTextNode( "1" );
    elem.addChildElement( "varString" ).addTextNode( "samplestring" );
    elem.addChildElement( "varFloat" ).addTextNode( "2.2" );
    System.out.println( elem );
    try{
    SOAPElement res = (SOAPElement)call.invoke(new Object[]{elem } );
    System.out.println( res );
    }catch( javax.xml.rpc.JAXRPCException e ){
    e.printStackTrace();
    e.getLinkedCause().printStackTrace();
    Call echoFloat = service.createCall( portName,
    new QName( "http://soapinterop.org/", "echoFloat" ) );
    System.out.println( echoFloat.invoke( new Object[]{new
    Float(100.0)} ) );
    http://manojc.com
    "Anamitra" <[email protected]> wrote in message
    news:[email protected]...
    Hi Bruce
    I think the wsdl that you sent was very near to what I was looking
    for.
    But I
    would try to make the requirement more clear: The points below
    are
    listed
    in order
    of priority:
    1>First and foremost I am looking to create a Webservice such
    that
    it
    exposes
    a method which takes in a java.lang.String
    public void test(String poXML)
    But in the WSDL I want to show the user the schema definition
    for
    the
    po
    XML.
    And would desire that the Webservices framework do the schema
    validation
    of the
    incoming xml. But I dont thing this works as the wsdl generated
    always
    says the
    type is "xsd:string". So I started looking into the 2nd option:
    2>Create a doc/literal type service and expose that method as:
    public void test(POXMLBean poXML)
    This generated the reqd schema in the wsdl level but the client
    is
    being
    forced
    to use the POXMLBean to invoke the method. I would ideally want
    the
    client
    to
    just deal with the XML of the pobean as described in the generated
    schema
    definition.
    For example the client using JAXRPC should be say doing the code
    like
    this:
    String poXML = "<po> <order>000</order> </po>"
    call.invoke(poXML").
    Is this possible? I am not able to do this. My primary important
    thing
    is
    that
    the client has to deal with XML and not with anything else. The
    client
    shouldnot
    have to deal with POXMLBean. This is what I am trying to acheive
    and
    not
    able
    to.
    3> So that leaves me to the last option which is not that good:
    ie I keep my original approach:
    public void test(String poXML)
    and somehow via wsdl:documentation say that the schema for this
    poXML
    is
    this...
    But I cannot change the type in the parameter poXML from xs:string
    right?
    Bottom line is there any way for the client to pass string/byte[]
    xml
    data
    to
    the webservice - but still be able to look into the WSDL and
    see
    what
    the
    reqd
    XML structure should be? I thought doc/literal should do it -
    but
    using
    weblogic
    I am not able to do it. Can u help me with this pls.
    thanks
    Anamitra
    Bruce Stephens <[email protected]> wrote:
    Hello,
    See what you think of this example of using import. It seems
    to
    describe your exact use case:
    http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Retail
    er.wsdl
    (Disclaimer, anyone could have found this via public UDDI.)
    The issue I believe that Anamitra sees is the gap between the
    runtime
    and the toolset.
    Bruce
    Anamitra wrote:
    Hi Karthik
    I am a bit confused as to what you mean when u say "import".
    The
    generated
    webservices.xml
    contains a <types> and a <type-mapping> element. I suppose
    u r
    asking
    me to put
    the xsd definition in the <types> section - right?
    If the method is like this:
    public String doit(String msg)
    How do I attach the <xs:string> type "msg" to the actual
    XML
    schema
    that I just
    imported?
    I dont know whether I am asking stupid questions or not -
    but I
    would
    have ideall
    liked to see my "msg" of type say "PurchaseOrder" which is
    the
    schema
    that I imported.
    And the external client should just be able to give the
    "PurchaseOrder"
    xml to
    the Webservice and invoke the "doit" method.
    Am I making any sense?
    thanks
    Anamitra
    "Karthik V" <[email protected]> wrote:
    I doubt if servicegen has any option for doing it automatically.
    You should manually edit web-services.xml and import the
    xsd.
    /k
    "Anamitra" <[email protected]> wrote in message
    news:[email protected]...
    Hi Karthik/Bruce
    Can you pls explain to me how using weblogic tools
    [servicegen]
    one
    can
    include
    the xsd pointers in the WSDL file.
    We have a similar kind of requirement where we have
    webservices
    which
    take
    in
    string [XML data] as a parameter and the WSDL only shows
    method
    parameter
    types
    as xsd:string - but we want to show something like a schema
    definition.
    So
    if
    there is anyway to put the schema definition in the WSDL
    - pls
    let
    me know
    that
    would be very very helpful.
    thanks
    Anamitra
    "Karthik V" <[email protected]> wrote:
    Bruce,
    Thanks for your response. That helped.
    I have another question for you.
    I know this would sound strange.
    But my requirement is to expose a session bean method
    that
    could
    take
    different xml inputs.
    For example:
    TestBean exposes testMethod(String xmlstr)
    xmlstr could be of schema xmlSchema1.xsd
    or xmlstr could be of schema xmlSchema2.xsd
    In future it could also represent xmlSchema3.xsd... and
    so
    on.
    What is the right approach in this scenario?
    I was thinking to create a different web service fordifferent
    xsd.
    Say, webservice1 imports xmlSchema1.xsd, webservice2 imports
    xmlSchema2.xsd...
    Un fortunately due to some design restrictions, I cannot
    create
    different
    methods in my session bean like testMethod1, testMethod2....
    Is there any other better way to do this in one web service?
    Thanks in advance for any suggestions. And excuse my unusual
    requirement.
    /k
    "Bruce Stephens" <[email protected]> wrote in message
    news:[email protected]...
    Hello,
    Personally I like to see everything in one place, i.e.
    in
    the
    WSDL,
    however everyone else :-) uses the import. The
    SOAPBuilders
    round
    3
    have several tests showing imports. Also WSI Basic
    profile
    has
    some
    helpful guidelines on using import:
    http://www.ws-i.org/Profiles/Basic/2003-03/BasicProfile-1.0-BdAD.html
    HTHs,
    Bruce
    Karthik V wrote:
    Hi,
    I have created few doc style web services, with a
    very
    complex
    xml
    input
    and
    output. (1200 lines of xsd)
    Input and out put are xml as java.lang.String.
    What would be the best practice to represent this
    in the
    WSDL?
    Just
    a
    reference to the xsd file is good, or should it be
    completely
    presented
    within the WSDL? I'm not sure how my wsdl should look
    like...
    I will be using the same schema (xsd) in other web
    services
    too
    to
    perform
    different functions.
    Any suggestions would be greatly appreciated.
    Thanks
    /k

  • Serialization error while returning Value Object from Web Service

    Hi
    I have developed a sample Web Service (RPC based), it returns Customer Value Object
    when client calls getCustomer method.
    I have written a Client (attached the client source code) to invoke the web service
    when the client invokes the Web Service it throws an Exception , the Exception
    Exception in thread "main" serialization error: no serializer is registered for
    (null, {java:customer}Customer)
    at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer(DynamicInternalTypeMappingRegistry.java:62)
    at com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPResponseSerializer.java:72)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(ReferenceableSerializerImpl.java:47)
    at com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCall.java:382)
    at com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.java:364)
    at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)
    at ClientwithWSDL.main(ClientwithWSDL.java:63)
    CAUSE:
    no serializer is registered for (null, {java:customer}Customer)
    at com.sun.xml.rpc.encoding.TypeMappingUtil.getSerializer(TypeMappingUtil.java:41)
    at com.sun.xml.rpc.encoding.InternalTypeMappingRegistryImpl.getSerializer(InternalTypeMappingRegistryImpl.java:287)
    at com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer(DynamicInternalTypeMappingRegistry.java:47)
    at com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPResponseSerializer.java:72)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(ReferenceableSerializerImpl.java:47)
    at com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCall.java:382)
    at com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.java:364)
    at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)
    at ClientwithWSDL.main(ClientwithWSDL.java:63)
    If someone can help me to fix the issue, it will be great.
    Thanks
    Jeyakumar Raman.

    I guess, this is because the RI client is not finding the
    codec to ser/deser your Value Object. You need to register
    the codec in the type mapping registry before you invoke
    the web service method.
    Here is a sample:
    Service service = factory.createService( serviceName );
    TypeMappingRegistry registry = service.getTypeMappingRegistry();
    TypeMapping mapping = registry.getTypeMapping(
    SOAPConstants.URI_NS_SOAP_ENCODING );
    mapping.register( SOAPStruct.class,
    new QName( "http://soapinterop.org/xsd", "SOAPStruct" ),
    new SOAPStructCodec(),
    new SOAPStructCodec() );
    BTW, you can do the same exact thing on the client by using
    WLS impl of JAX-RPC. Is there a reason for using RI on the
    client side?
    regards,
    -manoj
    "Jeyakumar Raman" <[email protected]> wrote in message news:[email protected]...
    Hi Manoj,
    Thanks for your information, Yes, my client is Sun's JAX-RPC based, but the Server
    Implementation is done using Weblogic 7.0. When I invoke the Client without WSDL.
    It works fine without any problem. But when I invoke the webservice using WSDL,
    I am getting this problem.
    Here is my Client Code :
    * This class demonstrates a java client invoking a WebService.
    import java.net.URL;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.Call;
    import javax.xml.rpc.ParameterMode;
    import javax.xml.namespace.QName;
    import customer.Customer;
    public class ClientwithWSDL {
    private static String qnameService = "CustomerService";
    private static String qnamePort = "CustomerServicePort";
    private static String BODY_NAMESPACE_VALUE =
    "http://jeyakumar_3957:7001/Customer";
    private static String ENCODING_STYLE_PROPERTY =
    "javax.xml.rpc.encodingstyle.namespace.uri";
    private static String NS_XSD =
    "http://www.w3.org/2001/XMLSchema";
    private static String URI_ENCODING =
    "http://schemas.xmlsoap.org/soap/encoding/";
    private static String method="getCustomer";
    private static String endpoint="http://jeyakumar_3957:7001/webservice/CustomerService?WSDL";
    public static void main(String[] args) throws Exception {
    // create service factory
    ServiceFactory factory = ServiceFactory.newInstance();
    // define qnames
    QName serviceName =new QName(BODY_NAMESPACE_VALUE, qnameService);
    QName portName = new QName(BODY_NAMESPACE_VALUE, qnamePort);
    QName operationName = new QName("",method);
    URL wsdlLocation = new URL(endpoint);
    // create service
    Service service = factory.createService(wsdlLocation, serviceName);
    // create call
    Call call = service.createCall(portName, operationName);
    // invoke the remote web service
    Customer result = (Customer) call.invoke(new Object[0]);
    System.out.println("\n");
    System.out.println(result);
    "manoj cheenath" <[email protected]> wrote:
    >
    >
    >Hi Jayakumar,
    >
    >From the stack trace it looks like you are using sun's
    >RI of JAX-RPC. I am not sure what is going wrong with RI.
    >
    >WLS 7.0 got its own implementation of JAX-RPC. Check
    >out the link below for details:
    >
    >http://edocs.bea.com/wls/docs70/webserv/index.html
    >
    >
    >Let us know if you need more details.
    >
    >--=20
    >
    >regards,
    >-manoj
    >
    >
    >
    > "Jeyakumar" <[email protected]> wrote in message =
    >news:[email protected]...
    >
    > Hi
    >
    > I have developed a sample Web Service (RPC based), it returns Customer
    >=
    >Value Object
    > when client calls getCustomer method.
    >
    > I have written a Client (attached the client source code) to invoke
    >=
    >the web service
    > when the client invokes the Web Service it throws an Exception , the
    >=
    >Exception
    >
    >
    > Exception in thread "main" serialization error: no serializer is =
    >registered for
    > (null, {java:customer}Customer)
    > at =
    >com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer=
    >(DynamicInternalTypeMappingRegistry.java:62)
    >
    > at =
    >com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPRespo=
    >nseSerializer.java:72)
    > at =
    >com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(Reference=
    >ableSerializerImpl.java:47)
    > at =
    >com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCal=
    >l.java:382)
    > at =
    >com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.ja=
    >va:364)
    > at =
    >com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)
    > at ClientwithWSDL.main(ClientwithWSDL.java:63)
    >
    > CAUSE:
    >
    > no serializer is registered for (null, {java:customer}Customer)
    > at =
    >com.sun.xml.rpc.encoding.TypeMappingUtil.getSerializer(TypeMappingUtil.ja=
    >va:41)
    > at =
    >com.sun.xml.rpc.encoding.InternalTypeMappingRegistryImpl.getSerializer(In=
    >ternalTypeMappingRegistryImpl.java:287)
    > at =
    >com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer=
    >(DynamicInternalTypeMappingRegistry.java:47)
    >
    > at =
    >com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPRespo=
    >nseSerializer.java:72)
    > at =
    >com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(Reference=
    >ableSerializerImpl.java:47)
    > at =
    >com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCal=
    >l.java:382)
    > at =
    >com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.ja=
    >va:364)
    > at =
    >com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)
    > at ClientwithWSDL.main(ClientwithWSDL.java:63)
    >
    > If someone can help me to fix the issue, it will be great.
    >
    > Thanks
    > Jeyakumar Raman.
    >
    >
    ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    ><HTML><HEAD>
    ><META http-equiv=3DContent-Type content=3D"text/html; =
    >charset=3Diso-8859-1">
    ><META content=3D"MSHTML 6.00.2713.1100" name=3DGENERATOR>
    ><STYLE></STYLE>
    ></HEAD>
    ><BODY bgColor=3D#ffffff>
    ><DIV><FONT face=3DCourier size=3D2>Hi Jayakumar,</FONT></DIV>
    ><DIV><FONT face=3DCourier size=3D2></FONT> </DIV>
    ><DIV><FONT face=3DCourier size=3D2>From the stack trace it looks like
    >=
    >you are using=20
    >sun's</FONT></DIV>
    ><DIV><FONT face=3DCourier size=3D2>RI of JAX-RPC. I am not sure
    >=
    >what is going=20
    >wrong with RI.</FONT></DIV>
    ><DIV><FONT face=3DCourier size=3D2></FONT> </DIV>
    ><DIV><FONT face=3DCourier size=3D2>WLS 7.0 got its own implementation
    >of =
    >
    ></FONT><FONT face=3DCourier size=3D2>JAX-RPC. Check</FONT></DIV>
    ><DIV><FONT face=3DCourier size=3D2>out the link below for =
    >details:</FONT></DIV>
    ><DIV><FONT face=3DCourier size=3D2></FONT><FONT face=3DCourier=20
    >size=3D2></FONT> </DIV>
    ><DIV><FONT face=3DCourier size=3D2><A=20
    >href=3D"http://edocs.bea.com/wls/docs70/webserv/index.html">http://edocs.=
    >bea.com/wls/docs70/webserv/index.html</A></FONT></DIV>
    ><DIV><FONT face=3DCourier size=3D2></FONT> </DIV>
    ><DIV><FONT face=3DCourier size=3D2></FONT> </DIV>
    ><DIV><FONT face=3DCourier size=3D2>Let us know if you need more=20
    >details.</FONT></DIV>
    ><DIV><BR>-- <BR><BR>regards,<BR>-manoj</DIV>
    ><DIV> </DIV>
    ><DIV><BR> </DIV>
    ><BLOCKQUOTE=20
    >style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
    >BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
    > <DIV>"Jeyakumar" <<A=20
    > href=3D"mailto:[email protected]">[email protected]</A>>
    >=
    >wrote in=20
    > message <A=20
    > =
    >href=3D"news:[email protected]">news:[email protected]=
    >a.com</A>...</DIV><BR>Hi<BR><BR>I=20
    > have developed a sample Web Service (RPC based), it returns Customer
    >=
    >Value=20
    > Object<BR>when client calls getCustomer method.<BR><BR>I have written
    >=
    >a Client=20
    > (attached the client source code) to invoke the web service<BR>when
    >=
    >the client=20
    > invokes the Web Service it throws an Exception , the=20
    > Exception<BR><BR><BR>Exception in thread "main" serialization error:
    >=
    >no=20
    > serializer is registered for<BR>(null,=20
    > {java:customer}Customer)<BR>
    >=
    >at=20
    > =
    >com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer=
    >(DynamicInternalTypeMappingRegistry.java:62)<BR><BR> &nb=
    >sp; =20
    > at=20
    > =
    >com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPRespo=
    >nseSerializer.java:72)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(Reference=
    >ableSerializerImpl.java:47)<BR> =
    >=20
    > at=20
    > =
    >com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCal=
    >l.java:382)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.ja=
    >va:364)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)<BR> =
    > =20
    > at ClientwithWSDL.main(ClientwithWSDL.java:63)<BR><BR>CAUSE:<BR><BR>no
    >=
    >
    > serializer is registered for (null,=20
    > {java:customer}Customer)<BR>
    >=
    >at=20
    > =
    >com.sun.xml.rpc.encoding.TypeMappingUtil.getSerializer(TypeMappingUtil.ja=
    >va:41)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.encoding.InternalTypeMappingRegistryImpl.getSerializer(In=
    >ternalTypeMappingRegistryImpl.java:287)<BR> =
    > =20
    > at=20
    > =
    >com.sun.xml.rpc.encoding.DynamicInternalTypeMappingRegistry.getSerializer=
    >(DynamicInternalTypeMappingRegistry.java:47)<BR><BR> &nb=
    >sp; =20
    > at=20
    > =
    >com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.initialize(SOAPRespo=
    >nseSerializer.java:72)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.initialize(Reference=
    >ableSerializerImpl.java:47)<BR> =
    >=20
    > at=20
    > =
    >com.sun.xml.rpc.client.dii.BasicCall.createRpcResponseSerializer(BasicCal=
    >l.java:382)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.client.dii.BasicCall.getResponseDeserializer(BasicCall.ja=
    >va:364)<BR> =20
    > at=20
    > =
    >com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)<BR> =
    > =20
    > at ClientwithWSDL.main(ClientwithWSDL.java:63)<BR><BR>If someone can
    >=
    >help me=20
    > to fix the issue, it will be great.<BR><BR>Thanks<BR>Jeyakumar=20
    >Raman.</BLOCKQUOTE></BODY></HTML>
    >
    >
    [att1.html]

  • PLEASE HELP! Using Apache SOAP with WL61

    Hi,
    I am trying to run the Apache soap within the WL61.
    I have the Apache soap servlet deployed under WL61.
    I am trying to use org.apache.soap.server.ServiceManagerClient
    to deploy the sample AddressBook service. I get the following error: "Unable to
    resolve namespace URI for 'xsd'".
    Now, the Apache SOAP faq says, I need to use the 1.3.0 xeces.jar
    on both server and client to solve this problem.
    However, WL61 server wont come up with the 1.3.0 xerces.jar file
    I am in a catch 22 situation, please help.
    thanks

    I had exactly this problem and by following the advice below I got it to work using
    crimson.jar from apache.
    Step 1: put crimson.jar frst in classpath
    Step 2: put the following in config.xml
    <XMLRegistry DocumentBuilderFactory="org.apache.crimson.jaxp.DocumentBuilderFactoryImpl"
    Name="Xerces JAXP" SAXParserFactory="org.apache.crimson.jaxp.SAXParserFactoryImpl"
    />
    Step 3: updated Server entry in config.xml to point to "Xerces JAXP" as explained
    below.
    I know this does not add a lot to the idea below but it is an alternative.
    Thanks,
    George
    Manoj Cheenath <[email protected]> wrote:
    >
    This is something i found in apache soap mailing list:
    ------- Original Message --------That fixed it! Thanks, Stefan!
    -----Original Message-----
    From: Stefan Dube [mailto:[email protected]]
    Sent: Wednesday, June 13, 2001 4:15 AM
    To: [email protected]
    Subject: RE: compatibility with weblogic 6.1 beta
    Hi!
    I believe the problem is that SOAP 2.2 uses JAXP and WL uses their
    bundled
    xerces as JAXP parser.
    To override this you have to modify the config.xml like this: (or
    use the web
    console)
    Add following element as child of the <Domain> element:
    <XMLRegistry
    DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
    Name="Xerces JAXP"
    SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"
    />
    and modify the <Server> element like this:
    <Server
    InstrumentStackTraceEnabled="true"
    ListenPort="80"
    LogRemoteExceptionsEnabled="true"
    Name="myServer"
    NativeIOEnabled="true"
    XMLRegistry="Xerces JAXP" <-- only this line is important
    >
    Hope that helps,
    -sd
    -----Original Message-----
    From: Erik Onnen [mailto:[email protected]]
    Sent: Wednesday, June 13, 2001 1:33 AM
    To: '[email protected] '
    Subject: RE: compatibility with weblogic 6.1 beta
    The "unable to resolve namespace" problem is because BEA in
    their infinite
    wisdom chose to mesh Xerces into their own libraries.
    Unfortunately they
    used an old version and because it is so embedded, you can't
    just replace a
    JAR. I was able to get 2.1 working on 6.0 sp1 by moving
    Xerces to the front
    of the classpath in the startup script. Ed, when WL won't
    start, what is the
    error you get? I haven't heard of that happening before.
    Steve, when you say
    Xerces is in your classpath, is it at the front, before weblogic.jar?
    -----Original Message-----
    From: Steve Livingston
    To: [email protected]
    Sent: 6/12/01 6:46 PM
    Subject: RE: compatibility with weblogic 6.1 beta
    1) I get the same error (with NT, soap-2.2 and wl-6.1beta) andhave
    found no solution:
    E:\apache\soap-2_2\samples\addressbook>java
    org.apache.soap.server.ServiceManagerClient
    http://slivings:7001/soap/servlet/rpcrouter list
    Deployed Services:
    E:\apache\soap-2_2\samples\addressbook>java
    org.apache.soap.server.ServiceManagerClient
    http://slivings:7001/soap/servlet/rpcrouter deploy dd.xml
    Ouch, the call failed:
    Fault Code = SOAP-ENV:Client
    Fault String = Unable to resolve namespace URI for 'ns2'.
    2) My wl-6.1b will start with xerces in classpath, but same error
    occurs.
    Can anyone help?
    Steve
    -----Original Message-----
    From: Ed Keen [mailto:[email protected]]
    Sent: Monday, June 11, 2001 6:36 PM
    To: '[email protected]'
    Subject: compatibility with weblogic 6.1 beta
    Has anyone gotten Apache soap version 2.2 to work with Weblogic6.1
    beta?
    There seems to be a xerces incompatibility. The weblogic.jarfile
    contains
    the xerces library. If you put xerces.jar first in the classpath,
    weblogic
    won't even start. However, if you put weblogic.jar first in the
    classpath,
    you get this error when attempting to deploy services using the
    ServiceManagerClient: "Unable to resolve namespace URI for 'ns2.'"
    This obviously seems to be a xerces parsing issue. Does
    anyone know of
    a
    workaround for this?
    Thanks,
    EdSanjeev Hegde wrote:
    Hi,
    I am trying to run the Apache soap within the WL61.
    I have the Apache soap servlet deployed under WL61.
    I am trying to use org.apache.soap.server.ServiceManagerClient
    to deploy the sample AddressBook service. I get the following error:"Unable to
    resolve namespace URI for 'xsd'".
    Now, the Apache SOAP faq says, I need to use the 1.3.0 xeces.jar
    on both server and client to solve this problem.
    However, WL61 server wont come up with the 1.3.0 xerces.jar file
    I am in a catch 22 situation, please help.
    thanks

  • Can't change the default endpoint

    I am trying to change the default endpoint mapping on 7.0SP2 as per the
    docs, but it does not seem to be working.
    I have added the following to my web.xml:
    <servlet>
    <servlet-name>WebServiceServlet</servlet-name>
    <servlet-class>
    weblogic.webservice.server.servlet.WebServiceServlet
    </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>WebServiceServlet</servlet-name>
    <url-pattern>/test/*</url-pattern>
    </servlet-mapping>
    My original endpoint is: http://server/endpoint. When I try to access
    http://server/test/endpoint, I get an error message saying "unable to
    find web service for url:/endpoint" but the original endpoint still
    works fine.
    Am I missing something?
    Mark Hellkamp

    Thanks for the link. We will correct the docs (CR108770).
    Also, filed an enhancement request (CR108771)
    Thanks,
    -manoj
    http://manojc.com
    "Mark Hellkamp" <[email protected]> wrote in message
    news:[email protected]...
    It's in the Web Services doc in Appendix C. Here is a link to the online
    version: http://e-docs.bea.com/wls/docs70/webserv/webxml.html#1007311. I
    may try a front end servlet that either redirects to or includes the web
    service and see if that will work. It would be nice to be able to
    directly assign webservices to execute queues in the web-services.xml
    file. Might be a good future enhancement.
    manoj cheenath wrote:
    Where did you find this doc? I think it is wrong. In 7.0 there is
    an internal servlet that get registered with webapp. This servlet
    reads the web-services.xml file and maps the uri (defined in the
    web-service element) to the webapp. You can not redefine this
    servlet in web.xml file. The internal servlet is registered with
    name "WebServiceServlet". I dont know if you could use this
    name to assign execute queues. If this does not work, please
    contact support.
    Regards,
    -manoj
    http://manojc.com
    "Mark Hellkamp" <[email protected]> wrote in message
    news:[email protected]...
    I'm using 7.0, so that is not an option. One of the issues I am facing
    is that I have three different web services that I want to use different
    execute queues. That is why I am trying to remap the web service
    endpoint via the servlet mapping. It is somewhat annoying that the
    docuemented method for doing this does not work.
    What is worse, I also tried it in 8.1 and I got an NPE. It would be nice
    to know if this is a bug or if the docs are incorrect.
    manoj cheenath wrote:
    Cant you specify wl-dispatch-policy for the whole web app?
    http://edocs.bea.com/wls/docs81/webapp/weblogic_xml.html#1049686
    http://manojc.com
    "Mark Hellkamp" <[email protected]> wrote in message
    news:[email protected]...
    I'm really trying to remap the web service servlet so that I can
    assign
    the web service to a different execute queue. If there is a better way
    to do that I'd love to hear it.
    Mark
    manoj cheenath wrote:
    You dont have to edit web.xml to change the endpoint. There
    will be a web-services.xml DD file in the same directory. You
    need to edit web-services->web-service->uri attribute in this
    dd file. A sample dd file can be found here:
    http://manojc.com/tutorial/sample23/web-services.xml
    Regards,
    -manoj
    http://manojc.com
    "Mark Hellkamp" <[email protected]> wrote in message
    news:[email protected]...
    I am trying to change the default endpoint mapping on 7.0SP2 as per
    the
    docs, but it does not seem to be working.
    I have added the following to my web.xml:
    <servlet>
    <servlet-name>WebServiceServlet</servlet-name>
    <servlet-class>
    weblogic.webservice.server.servlet.WebServiceServlet
    </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>WebServiceServlet</servlet-name>
    <url-pattern>/test/*</url-pattern>
    </servlet-mapping>
    My original endpoint is: http://server/endpoint. When I try to
    access
    http://server/test/endpoint, I get an error message saying "unable
    to
    find web service for url:/endpoint" but the original endpoint still
    works fine.
    Am I missing something?
    Mark Hellkamp

  • Using message-style web service by a Microsoft client

    Does anyone have a sample Microsoft client using message-style web service? BEA
    does not provide one. I found MS client does not receive messages published between
    2 calls to method "receive", while the sample Java client ConsumerClient.java
    does.
    ConsumerClient.java is like:
    while(true){
    Object result = method.invoke(null);
    sleep(20000); // not in sample, added for my test
    System.out.println(result);
    My VBScript code is like:
    Set SC = CreateObject("MSSOAP.SoapClient")
    SC.mssoapinit "http://localhost:7001/msg/Receiver/Receiver.wsdl", "", "", ""
    While TRUE
    Res = SC.receive
    WScript.echo "Res = " & Res     
    Res = ""
    ' do something that takes 20 seconds
    Wend
    I added 20 seconds between calls so I can publish a message between 2 calls. I
    found the Java client receives the message but the VBScript client doesn't. Has
    anyone else observed this?

    Hi Kevin,
    Thanks for your feedback.
    Header support is planed for the next major release.
    regards,
    -manoj
    Kevin Jiang wrote:
    Hi Manoj,
    Can you use SOAP header to pass session id accross instead of HTTP header? MS
    SOAP toolkit 2.0 support access to SOAP header.
    My app needs to use topic instead of queue. But as I said earlier, I can use MS
    XML toolkit to access HTTP header. So I have a work around.
    Thanks for all your responses with regard to this question!
    Kevin
    manoj cheenath <[email protected]> wrote:
    Hum! i thought you were not able to receive message at all. now
    i understood the problem. yes we are using http header to pass
    session id accross, in the case of web service client who wants
    to subscribe to JMS topics. I cant think of any other way to do
    this. if you have any suggestions, i very much like to hear it.
    for your application is it possible to use queues instead of topics?
    we do not use http session information in the case of JMS queues.
    -manoj
    Kevin Jiang wrote:
    Hi Manoj,
    Your sample code is basically same as mine. It would also lose messagespublished
    between calls to "receive" method.
    I figured out what's going on. Undocumented by BEA, the web servicesends JMS
    session ID in HTTP header along with first message. When client makessubsequent
    calls to "receive", this ID must be sent back. I found this by usinga SOAP trace
    tool.
    Unfortunately, MS SOAP toolkit doesn't support access to HTTP header.So one has
    to use MS XML toolkit to use message-style web service, when writingMS clients.
    manoj cheenath <[email protected]> wrote:
    an example of using message style web services with
    ms soap toolkit is attached. let me know if this works
    for you.
    regards,
    -manoj
    Kevin Jiang wrote:
    Hi Manoj,
    I just changed anyType to string and the problem still happens.
    Thanks,
    Kevin
    manoj cheenath <[email protected]> wrote:
    I have not tryed message style web services with MS soap toolkit.
    I think the problem is because the WSDL for the message style
    web service use xsd:anyType as the return type and MS soap is
    not able to understand it. can you pls modify the xsd:anyType to
    xsd:string (or someother base type) in the WSDL.
    SC.mssoapinit can load wsdl stored as a local file. so it should
    be easy to make this change.
    regards,
    -manoj
    Kevin Jiang wrote:
    Does anyone have a sample Microsoft client using message-style
    web
    service? BEA
    does not provide one. I found MS client does not receive messages
    published
    between
    2 calls to method "receive", while the sample Java client ConsumerClient.java
    does.
    ConsumerClient.java is like:
    while(true){
    Object result = method.invoke(null);
    sleep(20000); // not in sample, added for my test
    System.out.println(result);
    My VBScript code is like:
    Set SC = CreateObject("MSSOAP.SoapClient")
    SC.mssoapinit "http://localhost:7001/msg/Receiver/Receiver.wsdl",
    While TRUE
    Res = SC.receive
    WScript.echo "Res = " & Res
    Res = ""
    ' do something that takes 20 seconds
    Wend
    I added 20 seconds between calls so I can publish a message between2 calls. I
    found the Java client receives the message but the VBScript clientdoesn't. Has
    anyone else observed this?

  • SOAP examples

    I am looking for an example of a client that builds and invokes a SOAP
    message RPC-style and a server side object that receives this request,
    processes it and returns a SOAP message to the client. I could not find any
    API's either.
    Also, what do I gain by using the Weblogic web services over Apache SOAP on
    WL?
    Ta

    Manoj/Micheal,
    Regarding using Apache SOAP vs Weblogic SOAP Here is what i Think:
    WebLogic SOAP Implementation is far superior compared to Apache SOAP in regards
    to Performance ,Ease of Use and Level of Maturity Shown during Developing.
    1. I guess if you did some work with Apache SOAP Implementation you would definitely
    love working with WLS SOAP implementation.
    2. You can get started with WLS SOAP(Atleast compared to Apache SOAP version before
    2.1 )when working with WebLogic in less time frame compared to APACHE SOAP.
    3. Regarding MAturity of Product, some one would argue that APACHE SOAP implementation
    is around for sometime.
    But look at the following change in APACHE SOAP2.2 (released on May 30th):
    "Removed non-threadsafe private variables from Servlets"
    I guess Any one who ever worked with Servlets wouldn't make this mistake that
    APACHE SOAP Implementation had for quite sometime.
    Micheal, I don't work for BEA and this is from my experience with Both implementations.
    Hope this helps you in making Right Decision.
    Kumar.
    Manoj Cheenath <[email protected]> wrote:
    >
    Michael wrote:
    I am looking for an example of a client that builds and invokes a SOAP
    message RPC-style and a server side object that receives this request,
    processes it and returns a SOAP message to the client. I could notfind any
    API's either.pls check out: samples/examples/webservices/rpc example.
    Also, what do I gain by using the Weblogic web services over ApacheSOAP on
    WL?among many other things:
    - Performance
    - small size
    - dynamic client
    - java to wsdl & wsdl to java
    - message style invocation
    - easy to expose stateless ejbs as web service

  • Web service and http

    HI Guys,
    When I run the sample webservice "basic_javaclass/helloworld": http://localhost:7001/basic_javaclass/HelloWorld?intVal=100&string=sample+string&operation.invoke=sayHello
    The page displays:
    Request sent to the server
    <!--REQUEST.................-->
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header>
    </env:Header>
    <env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <m:sayHello xmlns:m="http://www.bea.com/servers/wls70/samples/examples/webservices/basic/javaclass">
    <intVal xsi:type="xsd:int">100</intVal>
    <string xsi:type="xsd:string">sample string</string>
    </m:sayHello>
    </env:Body>
    </env:Envelope>
    What does this mean? from the underline <form action ...> and above 'GET' url,
    it seems to send a normal http GET request, not this SOAP request, can somebody
    explain to me what is actually sent to the server thru HTTP? a regular GET HTTP
    request, or the SOAP? if it is the SOAP, how can that be?
    thanks
    Xiaodong

    Does this mean the Webservice itself is also acting as a client app to itself?
    My understanding is typically it is the 'client app' that invokes the client proxy
    method which in turn creates the SOAP message sent to the webservice through HTTP.
    If this is the case, how this 'client app' is defined, in webservice.xml? Is this
    a default feature comes with Weblogic WebService implementation?
    thanks
    "manoj cheenath" <[email protected]> wrote:
    When you use the test page, browser sends
    a GET request to the web service. Which
    in turn creates a client proxy and invoke the
    specified method on it. Client proxy will then
    do a HTTP POST of the soap envelope to
    the web service.
    Regards,
    -manoj
    http://manojc.com
    "X ZHou" <[email protected]> wrote in message
    news:3f5e5858$[email protected]..
    HI Guys,
    When I run the sample webservice "basic_javaclass/helloworld":
    http://localhost:7001/basic_javaclass/HelloWorld?intVal=100&string=sample+st
    ring&operation.invoke=sayHello
    The page displays:
    Request sent to the server
    <!--REQUEST.................-->
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header>
    </env:Header>
    <env:Body
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <m:sayHello
    xmlns:m="http://www.bea.com/servers/wls70/samples/examples/webservices/basic
    /javaclass">
    <intVal xsi:type="xsd:int">100</intVal>
    <string xsi:type="xsd:string">sample string</string>
    </m:sayHello>
    </env:Body>
    </env:Envelope>
    What does this mean? from the underline <form action ...> and above'GET'
    url,
    it seems to send a normal http GET request, not this SOAP request,can
    somebody
    explain to me what is actually sent to the server thru HTTP? a regularGET
    HTTP
    request, or the SOAP? if it is the SOAP, how can that be?
    thanks
    Xiaodong

Maybe you are looking for