You must Sign In to post a response.
  • Category: Webservices

    Consuming Java webservice into .Net application

    Hi,
    We are trying to consume JAVA web service into .Net web Application and we added it through Web Reference. getting the below error while executing the code

    "Unmarshalling Error: unexpected element (uri:"http://XXXX/", local:"YYYY"). Expected elements are <{}DDDDD>"


    Also tried to consume it through service reference, it also did not work.

    Thanks,
    Sathish.
  • #768205
    Hai Sathish,
    You need to use Service Reference to consume Java webservice to the .net client application.
    While adding the service reference, just provide the wsdl address as:
    Web Service url + wsdl?
    It should work fine.
    Below is the link which you can refer for the reference:

    https://blogs.msdn.microsoft.com/bursteg/2008/07/19/how-to-call-a-java-ee-web-service-from-a-net-client/
    http://www.codeproject.com/Articles/32313/How-to-invoke-Java-web-service-in-ASP-net-using-C

    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #768208
    Hi,


    For ex: your Java webservice contains method named JSMethod1. Refer below to see how we can access Java Webservice method in .net application
    Once your java web service is created, in your .net application, We should have wsdl file in our website.
    To perform this, right click on your .net project -> Add web reference. there give your wsdl url -> Go. Give some name( Ex: JavaWebService1)to your java webservice in your .net application 'Add web reference dialog'.
    Once this is done you can invoke java methods in your .net application.
    Include the added JavaWebService1 in your .net page

    using JavaWebService1;

    Then create an object for that

    JavaWebService1 objJavaWebService1 = new JavaWebService1();

    Now you can call Java methods in your .net application.

    objJavaWebService1 .JSMethod1();



    Hope this will help you

    Regards,
    SonyShiva
    Never lose hope..You never know what tomorrow will bring


  • Sign In to post your comments