Announcement Announcement Module
Collapse
No announcement yet.
Consuming Java Web Services in .net Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Consuming Java Web Services in .net

    Hi,

    New to all this but I was just wondering how one would go about using a java web service on a c# application.

    There doesnt seem to be any wsdl file for this so i cant easily add it as a web reference.

    This is how the java app consumes it from what I can see:

    Thread thread = Thread.currentThread();
    ClassLoader oldClassLoader = thread.getContextClassLoader();
    thread.setContextClassLoader(this.getClass().getCl assLoader());
    ApplicationContext ctx = new ClassPathXmlApplicationContext("file1.xml");
    thread.setContextClassLoader(oldClassLoader);

    StringBuilder auditServiceURL = new StringBuilder(ConfigurationPlugin.getDefault().get PreferenceStore().getString(ConfigurationPlugin.to LocationSpecific(PreferenceConstants.P_MIDD LETIER_BASE_URL)));
    auditServiceURL.append("/AuditService/AuditService");

    URL url = new URL(auditServiceURL.toString());
    HttpInvokerProxyFactoryBean httpinvoker = (HttpInvokerProxyFactoryBean) ctx.getBean("&AuditService");
    httpinvoker.setServiceUrl(url.toString());

    service = (IAuditService) ctx.getBean("AuditService");

  • #2
    This is not a SOAP Service, but a HttpInvoker, which only works on Java and requires Spring.

    Comment


    • #3
      Thank you for this.

      Is it possible to modify this web service to include both httpinvoker and soap or must they be one or the other?

      Comment

      Working...
      X