Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-18-2008, 09:26 PM
Member
 
Join Date: May 2008
Posts: 2
Alfred_O is on a distinguished road
How to send XML document from java client to .net webservice
Greetings, I have implemented a Web service with .Net that receives a XML document as input parameter. I want to implement a java client that consumes the Web service (sending the XML document). The Wsdl of the web service uses "anyType" as the data type, and the java client uses "java.lang.object". I don't know how to send the XML document from the java client to the .Net Web Service. Any help will be appreciated, thanks in advance
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-26-2008, 10:27 PM
Member
 
Join Date: Jun 2008
Posts: 12
weiwei is on a distinguished road
新加的空白文章1
这是新加的空白文章1,可以在UBB可视化编辑器中,添加和修改文章内容。
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-06-2008, 07:47 PM
Member
 
Join Date: Aug 2008
Posts: 22
mtv134 is on a distinguished road
change the type in the wsdl into string and regenerate the webservice and the client and send the xml file as a string
__________________
visit
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Muhammad Safwat
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 08-07-2008, 11:41 AM
Member
 
Join Date: Jul 2008
Posts: 31
skaspersen is on a distinguished road
Is it any xml document or is it a specific xml document with a specific schema?

If it has a known schema and you are actually using the contents of the xml file in your web service method you should change the parameter in the .net service to accept a type bound to the documents root element. This means unmarsheling the file in the java client before sending it. You can use XML Tools : DTD, XML schema and XML document conversion software tool : XML Utilities to create an XML Schema (xsd) to use with JAXB - XJC to generate object bindings.

On the other hand if it is just a file change the parameter to:
Code:
<xs:element xmlns:ns1="http://www.w3.org/2005/05/xmlmime" name="parameterName" ns1:expectedContentTypes="application/xml" type="xs:base64Binary"></xs:element>
If i remember correctly the Java object would translate to byte[], but see what jaxws comes up with.

Once you have created your Port object in the java client do the following to enable MTOM
Code:
BindingProvider bp = ((BindingProvider) port); SOAPBinding sb = ((SOAPBinding) bp.getBinding()); sb.setMTOMEnabled(true); bp.getRequestContext().put(JAXWSProperties.MTOM_THRESHOLOD_VALUE, Integer.valueOf(XX));
XX is the size value at which binary data would be sent as a mime attachment. I usually set mine to 0.

HTH
Stephen
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Axis Client accessing data on .Net webservice cfacile666 Web Frameworks 3 09-02-2008 12:35 PM
How to send XML document from java client to .net webservice Alfred_O Java Applets 0 05-18-2008 09:24 PM
How to set a max response time in webservice client sudheerbasu.k@gmail.com Advanced Java 1 05-11-2008 03:25 AM
A Client to Send SMTP Mail Java Tip java.net 0 04-07-2008 09:06 PM
Writing webservice client javaplus Web Frameworks 0 12-19-2007 11:10 AM


All times are GMT +3. The time now is 09:20 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org