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.

Similar Messages

  • 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

  • Calling a Web Service from Java Webdynpro

    Hi,
    Can any one give me step by setp details on how to call a Web Service from Java Webdynpro ?
    I tried creating a model using Import Web Service Model but when I completed creating the model, I got some errors as shown below.
    Error               The method setRouteGeometryLineArray(double[][]) in the type Trip is not applicable for the arguments (double[])     ComplexType_Trip.java     WS_INVOKE/gen_wdp/packages/com/cintas/test/model/p1     line 249
    thanks
    SBK

    Hi SBK,
    I assume you may already have read the [help guide|http://help.sap.com/saphelp_nw70/helpdata/EN/81/12703e5da3e946e10000000a114084/content.htm] This gives a pretty good idea of how to do it (step by step).
    Is there a typo in the error you pasted?
    Error The method setRouteGeometryLineArray(double][) in the type Trip is not applicable for the arguments (double[]) ComplexType_Trip.java WS_INVOKE/gen_wdp/packages/com/cintas/test/model/p1 line 249
    The square brackets [] after double in the method call appear to be reversed. Is that also in the code? or just a mistake here?
    Hope this points you in the right direction.
    BRgds,
    Simon

  • 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

  • 401 Error on Consuming SharePoint Versions Web Service by java client running on Unix Machine

    In my organiszation I have sharepoint site of our project. I have a java client to consume Versions Web Service offered by SharePoint. The response received from web service without any issue when triggered from a client running on windows machine on
    intranet.
    When same java client ran from UNIX server on same intranet, it gives 401 error. Is there some different approach required for authentication while connecting from unix machine?
    Thanks in advance.

    Hello,
    Are you passing credential in code? If not then try to add using networkcredential.
    If you are passing then make sure that current user is having access on SP site and your javaserver is setup for NTLM security. Here is few links for same issue which could help you troubleshoot the issue
    http://stackoverflow.com/questions/8884152/ntlm-fails-when-consuming-sharepoint-web-service-from-java
    http://www.pentalogic.net/sharepoint-products/reminder/reminder-manual?p=troubleshooting%2F401errors%2F401errors.htm
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to create web services in java?

    Hi,
    I am a newbie to java webservices. Can anybody tell me how to create web services in java?
    Any tutorial link or step by step doc would be useful.
    Appreciate your help in this regard.
    Thanks in advance.
    naymo01.

    Creating web services in Java appears to depend highly upon the server you intend to use.
    Here's a tutorial: http://java.sun.com/webservices/docs/1.6/tutorial/doc/index.html

  • Problem in calling XI generated Web Service via Java Web Dynpro

    Hi experts,
    I have problems with calling a web service, which was created by XI. I have already tested the web service with Altova XMLSpy. The Web Service works fine.
    But when embedding this web service into Java Web dynpro application no message flow is given. I have two views one Selection View and one Result View which should show the answer sent by RFC-Call.
    <b>My Settings in NWDS:</b>
    During configuration of web dynpro I have choosen 'Import adaptive Web Service Model' --> Select wsdl file via local file system --> 'no logical destinations - use WSDL URL for metadata retrieval and web service execution'.
    The model is also not shown in diagram view although I have added into the diagram.
    The web service was created on XI 7.0.
    Should I do any other settings e.g. in Visual Administrator, Web Dynpro Content Administrator?
    So can anybody help me.
    Thanks a lot.
    Regards,
    Mario

    Hi Aviad,
    thanks for your fast reply.
    But in Web Service Navigator my Web Service is not shown, because I used the SOAP Adapter.
    <b>My Web Service link:</b>
    http://<host>:<port>/XISOAPAdapter/MessageServlet?channel=:SRV_GBD_WS_GET_DEB_DETAIL:CC_GBD_WEBSERVICE_SENDER&amp;version=3.0&amp;Sender.Service=&amp;Interface=%5E*
    During executing Web Dynpro I got following errors:
    1. 'The system cannot find the path specified'.
    2. com.sap.tc.webdynpro.model.webservice.exception.WSModelRuntimeException: Exception on creation of service metadata for WSDL URL
    Regards,
    Mario

  • Call web service using Java code

    Hi all,
    Sorry if this question sounds stupid. I am new to web services.
    I am having a web service written in oracle, using soap-api. I want to call this web service in Java application, parse the result and save it in the database.
    Can anyone please guide me on this or give me some related link. I tried searching on google, tried to implement some of the solutions I got in search results, but it was not that helpful.
    Waiting for your help. Please guide me through this.
    Waiting for your replies. Thanks in advance.
    Regards,
    Kinnaree

    Hi all,
    From my java code, I tried giving
    String testStr = service.search("and formatted_address like '%Test House%'");
    This service method is defined on my SearchPortType.java file. This and the searchClient.java, as I mentioned earlier are auto generated files by myeclipse IDE. I gave WSDL URL, which generated these two files.
    This helped me invoking the service, but it gives me an exception as below:
    Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Couldn't send message.
    org.codehaus.xfire.fault.XFireFault: Couldn't send message.
         at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
         at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:30)
         at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
         at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
         at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
         at org.codehaus.xfire.client.Client.invoke(Client.java:336)
         at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
         at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
         at $Proxy8.search(Unknown Source)
         at com.imriel.client.cbre.chelsea.util.test.searchClient.main(searchClient.java:104)
    Caused by: org.codehaus.xfire.XFireException: Couldn't send message.
         at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:145)
         at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
         at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
         ... 8 more
    Caused by: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:79)
         at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:121)
         at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
         at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1321)
         at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
         at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
         at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send(CommonsHttpMessageSender.java:369)
         at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:123)
         ... 10 more
    Any ideas, where I am wrong????
    Regards,
    Kinnaree

  • 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

  • Web Services SDK (Java API)

    Hi,
    By using Web Services SDK (Java API) can I extract the Table,Join information related to a Universe?
    If so, then can you please give me some guidelines?
    Thanks
    Nirabhra

    Hi Nirabhra,
    I don't think this is possible with the Web Services SDK.
    This can only be done through the Universe Designer SDK (which is only available in COM).
    Please kindly refer to the API reference for the Universe Designer SDK for more details:
    [http://help.sap.com/businessobject/product_guides/boexir31/en/bodessdk.chm]
    Hope this helps.
    Regards,
    Dan

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

  • Calling a Web Service from Java

    Our java guru (who is out sick....AHHHH) created all the calls that are needed to access the web service that he has running. For example the call getLongList(String user, String password) will return a list of all outstanding transactions. He made a jar file that has service has class files for PortType, Service, Service Locator and Soap Binding stub.
    How do I call this web service from java? Do I have to import it into my classpath? or just call these parameters from within my java code?

    never mind...i got it

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

  • How to create Web Service Proxy with help of WSDL.

    Hi ,
    How to create Web Service Proxy with help of WSDL .
    Please help me .
    Thanks in advacne for reply .

    check out this article. It has all the details
    http://www.oracle.com/technology/products/jdev/howtos/1013/wsadf/adfcomplexwstypes.html

Maybe you are looking for