Web service XML-Java conversion

Hello,
It's said in BEA documentation that "web services tries to convert the XML
data inside the body of the SOAP message into one of the Java data types
listed
in "Supported Data Type...." see link for quote source.
Does this mean, BEA SOAP servlet does javaBean serialization/deserialization
automaticly
without user defining any data type mapping ?
in Apache SOAP implementation, user has to add a mapping element to specify
how SOAP
server should handle custom parameters such as a java object.
http://edocs.bea.com/wls/docs61/webServices/develop.html#1049481
ur prompt response is most appreciated.
thank you and regards.
Sheldon Yang

marekst wrote:
webservice receives xml data as parameter or webservice use SOAP XML letter to receive data?
if you get xml as parameter then you have to process XML to get java objects, if it is SOAP letter, then webservice has done job for you and you get set of java objects that should be persisted.
To persist data easiest way is to use EJB 3.0 and JPA. Webservice create using EJB 3.0 is easy as well.
to convert data in XML into java objects you can use DOM document + xPath or http://commons.apache.org/digester/ or something else, depending on size of XML doc
No need to be muddying the waters with such a heavyweight solution at this point. The guy's a relative newbie, and also has stated that the number of messages is very small. The simple APIs suggested above are much more in order, otherwise the guy's got a massive learning curve ahead of him, for no real benefit. Besides, you've not mentioned ESBs, message routing, EIP and the like, so your buzzword-compliance score has dropped dramatically :-)

Similar Messages

  • Binding xml from web service to java objects

    I would appreciate if someone can tell me where can i get information regarding
    binding of xml from web service to java objects in weblogic 6.1 .
    Thanks,
    ag

    Hi Ag,
    To my knowledge, the only information on this topic is whatever you find in the
    documentation. What exactly do you want to know?
    Can you post a set of specific questions?
    Regards,
    Mike Wooten
    "ag" <[email protected]> wrote:
    >
    I would appreciate if someone can tell me where can i get information
    regarding
    binding of xml from web service to java objects in weblogic 6.1 .
    Thanks,
    ag

  • 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>

  • 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

  • Web Service From Java class, serialization problem

    Hi,
    I want to create Web Service from Java class, I made java project, generated web service from it, create web service archive project and deployed it to WAS 6.40.
    My class have 2 methods,
    public int add(int a, int b);
    public MyResponse doSomthing(MyRequest req);
    I can succesfully call add method from Web Service Navigator, it works fine but when I call doSomthing methods I get the following error:
    <b>
    Deserializing fails. Nested message: XML Deserialization Error. Result class [com.mycomp.sap_tech.ws.MyRequest] does not have property [Amount] of type [java.lang.String]. It is required to load XML..
    </b>
    Any ideas how to resolve it?
    P.S. MyRequest class is exposed throw VI, has default constractor and public getters and setters for all properties. It implements Serializable as well. Any guesses?
    Thanks in advance,
    Victor.

    Hi Bhavik, thanks for response.
    as I already mentioned it implements Serializable, so it is not the problem.
    Thanks Avi but it didn't helps iether
    Victor

  • Creating Web Services using Java Implementation

    Hi,
    This is quite a general question on how to create a Web Service using Java Implementation that needs to conform to a client XML schema.
    Here are my Version specs,
    I am using Jdeveloper 10.1.3.4.0 and deploying onto OAS 10.1.3.
    I will be creating a J2ee 1.4 (JAX-RPC) Web Service using Document/Wrapped style.
    I have been provided an XML schema from the client which is quite complex.
    Using a top-down approach, I can create my WSDL file and import the XML Schema for my type definitions.
    The Web service aim is to accept some parameters and return some data from the Oracle Database. The
    XML response from the web service must conform to the element, attribute definitions in the provided XML schema.
    From a Java implementation approach, what is the best (simplest or quickest) way to retrieve data from the Oracle
    tables and map each fields/column to the required XML output (defined in the XML schema).
    I'm not too concerned with using Java to retrieve data from the Database, more with how I can map the data returned
    to the required output. Can this mapping task be controlled within the Java program?
    Thanks in advance.

    Hi,
    This is quite a general question on how to create a Web Service using Java Implementation that needs to conform to a client XML schema.
    Here are my Version specs,
    I am using Jdeveloper 10.1.3.4.0 and deploying onto OAS 10.1.3.
    I will be creating a J2ee 1.4 (JAX-RPC) Web Service using Document/Wrapped style.
    I have been provided an XML schema from the client which is quite complex.
    Using a top-down approach, I can create my WSDL file and import the XML Schema for my type definitions.
    The Web service aim is to accept some parameters and return some data from the Oracle Database. The
    XML response from the web service must conform to the element, attribute definitions in the provided XML schema.
    From a Java implementation approach, what is the best (simplest or quickest) way to retrieve data from the Oracle
    tables and map each fields/column to the required XML output (defined in the XML schema).
    I'm not too concerned with using Java to retrieve data from the Database, more with how I can map the data returned
    to the required output. Can this mapping task be controlled within the Java program?
    Thanks in advance.

  • Web Service in java HELP!!!!

    Hi everyone,
    i'm new in web services and i have to make a web service in java that it will accept an xml file from a client. The client will have to connect with the server in a particular port and ,through the web service, the client will have to send the xml file. Firts of all, i would like to ask if it 's something difficult to be done. Secondly i would appreciate if someone gave me a guideline about how to start the implementation of the web service.
    Thanks in advance. :)

    Kayaman wrote:
    993033 wrote:
    Thanks for the reply !I have read a lot of things about web service. i m reading about a week now for web services :)Well, you probably won't be able to do it with just a week of reading.Maybe a "hello world" type of webservice producer + consumer, if you know Java and web environments properly. JAX-RS is a bit easier in my opinion though, its a very well-defined API and I had a setup between Java and Ruby on Rails running in an afternoon. If you take the time to read and understand the material first of course. Especially the understanding part is what people tend to want to skip over.
    We can't just "give a hint" and you'll be magically able to write a webservice. Programming doesn't really work that way.Indeed, and software engineering works even less like that. It happens to be bloody hard.

  • Discovery web services in java uddi registry via php-pear

    I have published my web service in java uddi registry and I want to discovery this web services via php-pear.
    The pear code has not the setting about this uddi registry. The pear code for IBM and Microsoft registries are:
    'IBM' =>
    array(
    'Inquiry' =>
    array(
    'url' => 'www-3.ibm.com/services/uddi/testregistry/inquiryapi',
    'port' => 80),
    'Publish' =>
    array('url' => 'https://www-3.ibm.com/services/uddi/testregistry/protect/publishapi',
    'port' => 443)),
    'Microsoft' =>
    array(
    'Inquiry' =>
    array(
    'url' => 'test.uddi.microsoft.com/inquire',
    'port' => 80),
    'Publish' =>
    array(
    'url' => 'https://test.uddi.microsoft.com/publish',
    'port' => 443))*/);
    I add the code below for java registry but the code don't work.
    'JAVA' =>
    array(
    'Inquiry' =>
    array(
    'url' => 'localhost/soar/registry/soap',
    'port' => 8080),
    'Publish' =>
    array('url' => 'http://localhost/soar/registry/soap',
    'port' => 8080))
    The error from php code is :
    <rs:StackTrace xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0">javax.xml.registry.JAXRException: Unable to Unmarshall request
         at org.freebxml.omar.common.BindingUtility.getRequestObject(BindingUtility.java:355)
         at org.freebxml.omar.server.interfaces.soap.RegistrySOAPServlet.onMessage(RegistrySOAPServlet.java:184)
    Can anyone help meeeeeeeeeeeee?
    Message was edited by:
    paixtis

    Hello
    It means what it sais, your J2EE_ADMIN user doesn't have enough authorization.
    Chech if the appropriate authorization is assigned in your abap stack which belongs to the java stack you logon to:
    Role SAP_J2EE_ADMIN should be assigned to user J2EE_ADMIN.
    Kind regards
    Tom
    Edited by: Tom Cenens on Dec 17, 2010 2:55 PM

  • Preparations to learn Web Services with Java

    I have only worked with JSP,JDBC, JavaBeans and Servlets in Tomcat using MVC architecture the past couple years. I have never used Struts framework. I am thinking about taking a Web Services with Java course and was wondering if my background will be enough to keep up with the advance topic of Java web service?

    Yes, at first you should have to worry about understanding the basic concepts, WSDL, and a little bit of XML (it does not make very senso to study far too much because sometimes you won't use all the api you may study).
    The focus point is understanding that you can build a web service infrastructure passing using many different approaches: starting from wsdl, starting from java, based on WSDL, based on REST and things like that.
    JAX-WS is a very powerful toolkit that covers well all the possible approaches you may have.
    Anyway starting from scratch is quite frustrating... it is difficult to find around a good guide that covers all the aspects and make you understand the Big Picture. That's really the focus point.
    There is a very good book about written by Mark Hansen.
    Check out also that there are so many franmeworks around that implements the specification: almost every Corp. implements its own stack.... Sun, Apache, Spring, IBM, JBOSS and so on.
    This is quite misleading at first.
    Metro is very good and very well implemented with netbeans, and it's easier to start with it. anyway it hides you sometimes what's going on underneath.
    I find CXF is a very good framework, and if you love the SPring wayyou should consider give it a chance.
    I have no experience of other frameworks.

  • Nice parameter names generation in web-services.xml

    Hi
    My session bean has explicit parameter names such as:
    public void createCustomer(String name, String address, String telephoneNumber);
    But inside web-services.xml for his operation, 'servicegen' generates parameters
    name 'string, string0, string1'. Composing the xml becomes a tedious job!
    Is there a way to have this file generated automatically but with the original
    parameter names?
    Thanks for the help,
    guy

    Can source2wsdd be applied to an EJB implementation - the doc mentions only Java class-implemented web service - has this been
    fixed or being fixed in the next wls 7 service pack.
    http://edocs.bea.com/wls/docs70/webserv/assemble.html#1056639
    Thanks.
    Darma
    Shridhar Mysore wrote:
    In WLS 7.0.1 onwards, using "source2wsdd" ant task (quo vide http://e-docs.bea.com/wls/docs70/webserv/anttasks.html#1080421)
    you would be able to preserve the parameter names.
    For instance, if you do :
    <source2wsdd
    javaSource="MyService.java"
    ddFile="web-services.xml"
    typesInfo="temp_dir/WEB-INF/classes/types.xml"
    serviceURI="/MyService" >
    <classpath>
    <pathelement path="temp_dir/WEB-INF/classes"/>
    <pathelement path="${java.class.path}"/>
    </classpath>
    </source2wsdd>
    Then, the signature of a method in the backend component,
    public void testMethod( int a, float fval, String name ){
    would get translated mapped inside web-services.xml as :
    - <operation component="MyService" name="testMethod" method="testMethod">
    - <params>
    <param name="a" class-name="int" type="parms:int" style="in" xmlns:parms="http://www.w3.org/2001/XMLSchema"
    location="body" />
    <param name="fval" class-name="float" type="parms:float" style="in" xmlns:parms="http://www.w3.org/2001/XMLSchema"
    location="body" />
    <param name="name" class-name="java.lang.String" type="parms:string" style="in"
    xmlns:parms="http://www.w3.org/2001/XMLSchema" location="body" />
    </params>
    </operation>
    where you would see that the parameter names are being preserved.
    Regards
    Shridhar
    "Guy Deffaux" <[email protected]> wrote:
    Hi
    My session bean has explicit parameter names such as:
    public void createCustomer(String name, String address, String telephoneNumber);
    But inside web-services.xml for his operation, 'servicegen' generates
    parameters
    name 'string, string0, string1'. Composing the xml becomes a tedious
    job!
    Is there a way to have this file generated automatically but with the
    original
    parameter names?
    Thanks for the help,
    guy

  • Wsdd-merge to merge web-services.xml where is Ant Task

    Can anyone tell me the the java class for the <wsdd-merge> ant target, I am using
    Ant 1.6.1 and need to add the taskdef e.g.:-
    <taskdef name="wsdd-merge" classname="???/" />
    many thanks.

    Bruce,
    thanks for replying, I have multiple web services to merge into a compound web-services.xml.
    I originally tried
    <source2wsdd> with the option mergeWithExistingWS="true" , but found this didn't
    work. I noticed in the examples 'Multiple Web Services in one war' at http://manojc.com/?sample12
    that instead of using the merge option :-
    <move file="${output_dir}/WEB-INF/web-services.xml"
    tofile="${output_dir}/WEB-INF/web-services2.xml" />
    <wsdd-merge targetDD="${output_dir}/WEB-INF/web-services.xml" >
    <filelist dir="${output_dir}/WEB-INF/"
    files="web-services1.xml, web-services2.xml" />
    </wsdd-merge>
    So I was trying to do this. However I have now found that CR128214 has patched
    the original mergeWithExistingWS not working problem, and should be in WL8.1 sp3
    cheers.
    Bruce Stephens <[email protected]> wrote:
    Hi Pete,
    Web service ant tasks are doc'ed here [1]; I'm not sure about this
    one...where RU using this?
    Regards,
    Bruce
    [1]
    http://e-docs.bea.com/wls/docs81/webserv/anttasks.html
    Pete wrote:
    Can anyone tell me the the java class for the <wsdd-merge> ant target,I am using
    Ant 1.6.1 and need to add the taskdef e.g.:-
    <taskdef name="wsdd-merge" classname="???/" />
    many thanks.

  • Web-services.xml: cannot set "charset" attribute for alternative encoding

    Hi,
    the definition of the charset attribute in tag web-service in a web-services.xml
    descriptor gets lost, when deploying a web-service.
    Sample:
    Before deployment I defined:
    <web-service charset="ISO-8859-1" useSOAP12="false" targetNamespace="http://www.itpearls.com/unity/SubscriberData"
    name="WebSubscriberDataCollector" style="rpc" uri="/WebSubscriberDataCollector">
    After deployment the console states:
    <web-service jmsUri="ISO-8859-1" useSOAP12="false" exposeWSDL="true" targetNamespace="http://www.itpearls.com/unity/SubscriberData"
    name="WebSubscriberDataCollector" style="rpc" uri="/WebSubscriberDataCollector">
    So the value "ISO-8859-1" changed his master :-(
    I consider this a bug. Is there a workaround for the charset definition of an
    individual web-service?
    Thanks for an comments
    Manfred

    Hi Neal
    my server's locale is not en_US. The locale command delivers:
    $ locale
    LANG=de_CH.ISO8859-1
    LC_CTYPE="de_CH.ISO8859-1"
    LC_NUMERIC="de_CH.ISO8859-1"
    LC_TIME="de_CH.ISO8859-1"
    LC_COLLATE="de_CH.ISO8859-1"
    LC_MONETARY="de_CH.ISO8859-1"
    LC_MESSAGES="de_CH.ISO8859-1"
    LC_ALL=de_CH.ISO8859-1
    but the Weblogic Server remains stubborn on all possibilities according to http://e-docs.bea.com/wls/docs81/webserv/i18n.html#1069538
    and keeps complaining:
    java.io.CharConversionException: Malformed UTF-8 char -- is an XML encoding declaration
    missing?
    My analysis: The Weblogic server seems to expect a UTF-8 compliant stream (due
    to the current user.language property set to "de") regardless of the chosen configuration
    possibilities proposed on the above mentioned link page.
    Q: is this bug related to CR105388 on http://e-docs.bea.com/wls/docs81/notes/issues.html
    Now I urgently need a workaround to make Umlaute contained in a web service request
    working.
    Thanks for any help
    Manfred
    "Manfred Sturm" <[email protected]> wrote:
    >
    Hi Neal
    OK, typo. But it doesn't work. I get the console output:
    java.io.CharConversionException: Malformed UTF-8 char -- is an XML encoding
    declaration
    missing?
    plus I get following stack trace from the web-service client:
    javax.xml.soap.SOAPException: Failed to read a xml element from
    Vorname_aou_AOU091 Name_aou_AOU091 Ort_äou_AOU091 091A 1091 Strasse_aou_AOU091
    bbcs adsl sample string
    at weblogic.webservice.tools.pagegen.SampleInstance.getJavaObject(SampleInstance.java:139)
    at weblogic.webservice.server.servlet.ServletBase.getJavaParams(ServletBase.java:378)
    at weblogic.webservice.server.servlet.ServletBase.invokeMultiOutput(ServletBase.java:347)
    at weblogic.webservice.server.servlet.ServletBase.invokeOperation(ServletBase.java:306)
    at weblogic.webservice.server.servlet.WebServiceServlet.invokeOperation(WebServiceServlet.java:312)
    at weblogic.webservice.server.servlet.ServletBase.handleGet(ServletBase.java:272)
    at weblogic.webservice.server.servlet.ServletBase.doGet(ServletBase.java:154)
    at weblogic.webservice.server.servlet.WebServiceServlet.doGet(WebServiceServlet.java:232)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    (server's locale is en_US)
    Alternatively, when using "-Dweblogic.webservice.i18n.charset=ISO-8859-1"
    in
    I get the console output:
    <Oct 7, 2003 11:46:05 AM MEST> <Warning> <Management> <BEA-141087> <Unrecognized
    property: webservice.i18n.charset.>
    which results in the above stack trace when invoking on the web service.
    I still need a workaround within weblogic server. I cannot change the
    Solaris
    server's locale settings.
    Thanks for an comments
    Manfred
    "Neal Yin" <[email protected]> wrote:
    Hi Manfred,
    There is a typo in code. But this should NOT affect any functionality
    (charset attribute is working). Please contact support for a patch.
    Thanks,
    -Neal
    "Manfred Sturm" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    the definition of the charset attribute in tag web-service in aweb-services.xml
    descriptor gets lost, when deploying a web-service.
    Sample:
    Before deployment I defined:
    <web-service charset="ISO-8859-1" useSOAP12="false"
    targetNamespace="http://www.itpearls.com/unity/SubscriberData"
    name="WebSubscriberDataCollector" style="rpc"uri="/WebSubscriberDataCollector">
    After deployment the console states:
    <web-service jmsUri="ISO-8859-1" useSOAP12="false" exposeWSDL="true"
    targetNamespace="http://www.itpearls.com/unity/SubscriberData"
    name="WebSubscriberDataCollector" style="rpc"uri="/WebSubscriberDataCollector">
    So the value "ISO-8859-1" changed his master :-(
    I consider this a bug. Is there a workaround for the charset definitionof
    an
    individual web-service?
    Thanks for an comments
    Manfred

  • How to access .asmx Web Service using JAVA? Newbie

    Hello Experts,
    Currently, I have a project where in I have to access a ,NET web service. It is made of C#. I just want to ask how will I start the accessing process? I made this simple equation on how my project is.
    Java Project + C#.Net Web Service = Integration
    1. Do i need to create a Web Service too for the Java Project? If yes, What are the necessary tools needed for the creation of this Java Web Service?
    2. The .NET Web Service is available online. (It is made by other people).
    3. Based on the equation, what is the equivalent technology for the + sign?
    4. Can you site a concrete example for accessing a web service?
    5. I'm new here. Totally I have no idea where to start.
    6. Thank you experts.
    Edited by: Benedict.Aluan on 05 30, 08 1:38 PM
    Edited by: Benedict.Aluan on 05 30, 08 1:39 PM

    Hello
    Thanks a lot for your help ...
    I am developing simple J2EE based web service client using IBM WSAD 5.1. I have used the following code to call .asmx web service in Java
    String url = "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl";
         String namespace = "http://tempuri.org/";
         name = request.getParameter("txtName");
         try
              System.out.println("In Internet Service");
              ServiceFactory factory = ServiceFactory.newInstance();
              Service serv = factory.createService(new URL(url),new QName(namespace,"TempConvert"));
              System.out.println("Got Service......");
              Call obj = (Call)serv.createCall();
              System.out.println("Got Call......");
              obj.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY,"");
              obj.setProperty(Call.OPERATION_STYLE_PROPERTY,"wrapped");
              obj.setTargetEndpointAddress(url);
              obj.setPortTypeName(new QName(namespace,"TempConvertSoap"));
              obj.setOperationName(new QName(namespace,"FahrenheitToCelsius"));
              obj.addParameter("param1",XMLType.XSD_STRING,String.class,ParameterMode.IN);
              obj.setReturnType(XMLType.XSD_STRING);
              System.out.println("Parameters Set.....");
              Object[] params = new Object[]{name};
              k = (String)obj.invoke(params);
              System.out.println("Result: "+k);
         catch(Exception e)
            System.out.println("Exception is : "+e);
        }But this code is throwing exception that
    Invalid Address "http://www.w3schools.com/webservices/tempconvert.asmx?wsdl"I have also tried this URL with Java Proxy. But it showing the same error.
    Plz can u tell me how to access .asmx web service ?
    Waiting 4 reply.

  • How to consume the Abap web service in Java web-dynpro

    Hi Everyone,
    I want to consume ABAP web service in java web dynpro.
    so when i tried to create model in java web-dynpro, it gave me an error message saying "Invalid WSDL or WSDL not found".
    i think this error message is because, to access the WSDL of abap web-service, we need username and password, but the dialog box in java web-dynpro is not programmed to take username and password from us and send it to the server to get the WSDL.
    i came to this conclusion because i was able to successfully test my abap web-service in java portal. the java portal asked me the username and password to open the WSDL.
    So, please help me to consume the abap web service in java web-dynpro.
    Thanks in advance
    Regards
    Vikas

    Hi Vikas ,
       while creating a model in web-dynpro try to use the "import web service model" option and if you are using local server choose the local server option so that you can get the available web services which are in server, select one among them and continue you process.I think this is the some what easy way .
    If you want use the URL for wsdl better to once test the available service in server and copy that WSDL URL and paste over  WSDL textbox.
    I think this is pretty help ful to you
    Best Regards
    Srikatnh

  • Parse errors while creating a Web service from Java class!

    Can anybody tell me please, is it possible to create a Web Service from java class where the input from user is required ?
    I have the following program, which is successfully compiled, but when I'm trying to make a web service in JDeveloper, the following error occurs:
    "Validation failed.
    The implementation class primePackage.isPrime ofport type MyWebService contains parse errors."
    import java.io.*;
    import java.util.*;
    class isPrime
    public static void main (String args[])
    Scanner reader = new Scanner(System.in);
    int n;
    System.out.println ("Enter a number you want to know is it prime or not");
    n=reader.nextInt();
    if (isPrime(n))
    System.out.println ("True");
    else
    System.out.println ("False");
    static boolean isPrime (int n)
    int i=2;
    while (i<=n-1)
    if (n%i==0)
    return false;
    i++;
    return true;
    }

    Hi,
    Can anybody tell me please, is it possible to create
    a Web Service from java class where the input from
    user is required ?Yes, the parameters of your method will be mapped in WSDL.
    But i've some considerations about your code.
    I suggest you change the name of isPrime do Prime, its a good code convention to put the name of class starting with Upper case. and isn't good the name of class equals to name of method.
    I suggest you to change the "static boolean isPrime (int n)" to "public boolean isPrime(int n)" to publish a method as a WebService method it's must be public and not static. After this change try to generate your Web Service.
    Regards.

Maybe you are looking for

  • Error reading/writing file "com.apple.logic.pro.cs"

    this is happening every time i save. any idea what's going on anyone?

  • HTTPService is not working.

    I  have an application in which I send an HTTP request using HttpService.send. It works fine when I run it using FlexBuilder but when I simply open the main.html file in web browser(directly) it stops working. In this case no Http Request is sent and

  • HT201209 all i get after i enter my card number is done.  i do not see the tab for redeem.

    I have been trying to redeem my ITunes gift card, but when I plug in the redemtion code on the back, I do not see a tab for redeem, just done.   Therefore, I keep doing the same thing over and over, and the card is not downloading.

  • Apple keyboard with numberpad problem

    I have been using the usb keyboard (http://liss-mug.org.uk/sites/default/files/images/apple-qwerty_red_570.png) for my macbook pro for around 10-11 months and today keys 0 p P ; / are not working (but using the macbook pro keyboard is fine). I want t

  • Icloud contacts won't sync on mac after 10.8.2 update

    I have a Mac Mini 2011.  I just downloaded 10.8.2 last night.  This morning, I am trying to sync icloud contacts and they won't sync.  I select the "contacts" checkbox in the icloud settings.  Exit out.  Go into contacts, and I only have the group "o