-
Consuming Java Web Services
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_QTRADE_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");
-
Hi,
The code example you show is using the HttpInvoker to invoke a remote procedure call. It is not using web services. HttpInvoker uses http as the transport and serializes the arguments to a remote method invocation using standard Java serialization, which is not compatible with .NET serialization. This is quite different from the soap/xml payload in web services. If it was web services, then the good starting point for interop would be to use some code-gen tools off the .wsdl file.
Cheers,
Mark
Last edited by Mark Pollack; 05-28-2008 at 05:06 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules