• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

.Net Server and Java Client

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Paul:

Why would calling a .Net WS be any different than calling a Java WS?
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic