473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Calling C# web service (soap.tcp) from Java

I have C# based webservice that is hosted in a NT service. Programmatic access to the web service is of the form: soap.tcp://localhost:11141/ProcessorWebService

(The more traditional way to implement C# webservices is to put them in asp.net (.asmx) files and hosted by IIS. Access to these services is of the form: http://localhost/webservicetest/service.asmx. For various reasons, I don’t want to do that.)

I can successfully connect to my web service by from C# by:
1. Creating a C# proxy for the webservice by running WseWsdl.exe against the URL.
2. Make calls using the proxy’s.
My initial problem: How do I connect to the service from Java?
Problems I’ve encountered
1. How to create a proxy in Java?
a. I want to use wsimport against a WSDL file. But, since I don’t have a .asmx based service, I can’t just call <url>?WSDL to get it.
2. Even if I create a Java proxy (which I’ve done via some judicious hacking), I can’t seem to successfully connect to the service, when the URL is of the form soap.tcp://localhost:11141/ProcessorWebService.
a. The big difference her is using soap.tcp as the protocol, instead of HTTP. Also note that I’m going to a non traditional port. Still—I can get all of this to work from C#.

Here’s an example of my trivial program:
ProcessorWebService pws = new ProcessorWebService();
ProcessorWebServiceSoap pwss = pws.getProcessorWebServiceSoap(); ((javax.xml.ws.BindingProvider)pwss).getRequestCon text().
put(javax.xml.ws.BindingProvider.ENDPOINT_ADDRESS_ PROPERTY, "soap.tcp://localhost:11141/ProcessorWebService");

String resultFromHelloWorld = pwss.helloWorld();
It fails on the call to pwss.helloWord(); with the following:
"Unsupported endpoint address: soap.tcp://localhost:11141/ProcessorWebService"

My real questions:
Is it even possible to connect Java to a webservice hosted in a NT service?
Does anyone have any good pointers, or examples. (I’ve searched around a lot, but I’m a novice at Java, so easily could have missed something.)
Jan 14 '10 #1
5 8798
If upgrading to WCF is an option, you can use SOAP/TCP as a non-HTTP transport that is Java interoperable. SOAP/TCP is available in WCF-Xtensions.
Jan 14 '10 #2
Interesting idea, but my organization is probably too cheap to buy that package.
Jan 14 '10 #3
Frinavale
9,735 Expert Mod 8TB
I don't think that you need to purchase anything to accomplish what you need. Check out this article on Developing Web Services. There is a section there that describes how to implement a client that consumes a web service using Java. It's pretty cool stuff... You create a stub, dynamic proxy, or use Dynamic Invocation Interface to consume your service. It's all described in that article with code examples.

Most of this stuff depends on a WSDL so I hope that you didn't create a RESTful web
service...because I'm not sure how you would use them in Java.

Here's another article that is pretty helpful: Creating a Simple Web Service and Client with JAX-WS.

You should probably search the sun website for Java related development :)
It's kind of like MSDN but not quite as...robust.

-Frinny
Jan 15 '10 #4
Unfortunately, the link you provided is an all Java solution. I'm constrained that my service is written in C# AND is hosted in an NT service (as opposed to the more traditional asmx page in IIS).

I'm starting to think that the big clue that I "can't get there from here", is that I can't fine a way to generate WSDL from my solution. All the solutions I find, including the one you referenced, rely on a WSDL file being available.
Jan 16 '10 #5
Frinavale
9,735 Expert Mod 8TB
I misunderstood your problem. I thought that you didn't know how to consume a web service in Java....

I haven't worked much with web services in .NET before but have you tried "publishing" the web service to a server?



-Frinny
Jan 16 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type...
3
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb)....
7
by: Jorgen Haukland, Norway | last post by:
Hi, I have created a Java webservice which runs in IBM WebSphere appserver. I take the WSDL-file and create a VS.NET WinForm application and calls the service running on my PC and everything...
1
by: Vaibhav Modak | last post by:
Hi All, I have a Web Service written in Java (Web Logic) and I am trying to call it in my ASP. NET client. I am facing a problem while getting the data from the Web Service Method. My Web...
2
by: yqlu | last post by:
I hava developed a client in C# that is connected to a 3-party XML Web Services developed in Java based on the AXIS 1.1. Most methods call are successful except for one method named "findObjects"...
5
by: Nate | last post by:
We are attempting to make a request to a web service (we will refer to it as XXXServices) hosted on a Web Logic server from a C# SOAP client. The server responds with a 401 Unauthorized error...
8
by: Raju Joseph | last post by:
Hi All, I am just trying to get an opinion here. I know this is always a tough choice to make. We are in the process of converting our VB6 based Healthcare Information System (a full-fledged...
1
by: jens Jensen | last post by:
Hello , i'm calling a webservice generated with oracle webservice java tools. I'm not able to add a web reference to a .net client the usual way with visual studio 2005. I was therefore...
2
by: BluNuit | last post by:
I have a simple c# app that calls a Java (AXIS) web service to perform some operations. The call works fine (the java code fires and the operations are executed), but the response is always null. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.