aspose file tools*
The moose likes Web Services and the fly likes .Net Server and Java Client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark ".Net Server and Java Client" Watch ".Net Server and Java Client" New topic
Author

.Net Server and Java Client

Lisa Madison
Greenhorn

Joined: May 31, 2006
Posts: 2
Hi All,

I am very new to Web services. Since one week I am struggling to configure the web services client and make it work.

I am given .asmx?wsdl (developed in .Net) with which I need to configure the web services client. test() method is written which is taking integer parameter as input and returns a Dime attachment as output. I am using WSAD at client side.

While configuring client in WSAD, I selected Client Proxy type as 'Java Proxy' and Webservice runtime as 'Apache Axis 1.0'. Sample code is generated after completion. TestClient.jsp is having the code to call various methods. In that test() method is passing integer parameter mentioned and the return parameter is read using DOMwriter().

I have following doubts regarding all this:

1.Does Java supports reading and displaying Dime Attachments? If Yes, How can I read Dime attachment (Actual content to be passed is PDF document). Any sample code would be greatly appreciated.
2.How to test whether parameter is being passed to web services server correctly or not?

Any help in this regard would be great for me to start.

Thanks in Advance,

Regards,
Lisa.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41879
    
  63
Hello "Lisa MM"-

Welcome to JavaRanch.

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name. Since yours does not conform with it, please take a moment to change it, which you can do right here.

Enjoy your time here.


Ping & DNS - my free Android networking tools app
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
This article looks at MIME And DIME attachments:
Process attachments using JAX-RPC handlers

MSDN How to: Add Attachments to a SOAP Message by Using DIME
Lisa Madison
Greenhorn

Joined: May 31, 2006
Posts: 2
Hi Peer,

Thank you for the response. I have gone through the msdn link provided. It is giving the information regarding the .Net Server and .Net client but I am looking for reading dime attachment from Java client which is sent by .Net web services server.

Could you please guide me in that way.

Thanks,
Lisa.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
I'd focus on the IBM article (the MSDN article is useful to see if you can get a .NET client to work - else you may be looking at a totally different kind of problem).

In particular:
Listing 8: Client attachments handler
Listing 11. Complete implementation of client


Extend handlers to support both MIME and DIME
Although it is not advertised or documented in the Application Server implementation, a SOAP message is based on the com.ibm.ws.webservices.engine.Message class which supports both MIME and DIME attachments. For the incoming messages, it examines HTTP content headers and builds a SOAP message correctly regardless of the attachment's type. Analogous to an AXIS implementation, this class allows querying of the attachment type of the incoming message


You may also want to look at the Fear of Attachments article that was mentioned in the IBM article � though it relates to Axis rather than WebSphere.
Austin Derck
Greenhorn

Joined: Jun 02, 2006
Posts: 2
Hello hello,

I just recently overcame this problem myself, it's quite easy once you know how to do it.

A basic .NET service is going to look something like this:
//put attachment on context

So basically all your service is doing is adding the attachment right on to the response context. Therefore, all you need to do in the client is grab that response context and pull the attachments off of it.

Here's what a simple Java client would look like (Axis 1.4):


Then just go through your iterator and cast your attachments as necessary
Paul Celona
Greenhorn

Joined: May 20, 2004
Posts: 15
Is there a tutorial or write-up somewhere that goes through how to call a .net web service from java in more detail.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41879
    
  63
@Paul:

Why would calling a .Net WS be any different than calling a Java WS?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: .Net Server and Java Client