SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : XML Technologies :

Previous DiscussionNext Discussion
 call .net web services with java

hi. i have a web service .net and try to call this from java. This is the code.

String encodingStyleURI = Constants.NS_URI_SOAP_ENC;
URL url = null;
try {
url = new URL("http://10.1.12.234/pruebaWebService/Service1.asmx");
} catch (MalformedURLException e1) {
e1.printStackTrace();
}


SOAPMappingRegistry soapMappingRegistry = new SOAPMappingRegistry();
soapMappingRegistry.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "return"),null, null, new StringDeserializer());



// Build the call.
Call call = new Call();
call.setSOAPMappingRegistry(soapMappingRegistry);
call.setTargetObjectURI("http://tempuri.org/");
call.setMethodName("HelloWorld");
call.setEncodingStyleURI(encodingStyleURI);

Vector params = new Vector();

params.addElement(new Parameter("pSXml", String.class, "hola", null));
params.addElement(new Parameter("pSNombre", String.class, "tal", null));
call.setParams(params);

// Invoke the call.
Response resp = null;

try {
resp = call.invoke(url, "http://tempuri.org/HelloWorld");
} catch (SOAPException e) {
System.err.println("Caught SOAPException ("+ e.getFaultCode()+ "): "+ e.getMessage());
}

AND THE ERROR IS:

Caught SOAPException (SOAP-ENV:Client): No Deserializer found to deserialize a 'http://tempuri.org/:HelloWorldResult' using encoding style 'null'.


THIS IS THE GET AND POST WHEN I CALL THIS FROM INTERNET EXPLORER:

GET /pruebaWebService/Service1.asmx/HelloWorld?pSXml=string&pSNombre=string HTTP/1.1
Host: 10.1.12.234
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

string


POST
/pruebaWebService/Service1.asmx/HelloWorld HTTP/1.1
Host: 10.1.12.234
Content-Type: application/x-www-form-urlencoded
Content-Length: length
pSXml=string&pSNombre=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

string

PLEASE HELP ME.

THANKS.



Started By jorgeahm on Jul 24, 2006 at 11:53:26 AM

14 Response(s) | Reply

Earlier Replies | Replies 8 to 14 of 14 | Later Replies
Goto Page: 2 1
jorgeahm on Jul 25, 2006 at 8:46:02 AM (# 8)
This message has been edited.

How i can see this response, i do not know how to do that.
because i have only one Class with a main method and in this Class i call the web services .net


jorgeahm on Jul 25, 2006 at 8:55:04 AM (# 9)

because i have only one Class with a main method and in this Class i call the web services .net


MHenke on Jul 25, 2006 at 9:03:19 AM (# 10)

> How i can see this response, i do not know how to do that.
By using the right tools, e.g. http://www.pocketsoap.com/tcpTrace/.


jorgeahm on Jul 25, 2006 at 12:31:34 PM (# 11)

finally i found this page and with this i can works.

http://gsraj.tripod.com/dotnet/webservices/webservice_java_client.html

but i am sad becouse i would like to use the complete code above

thank MHenke.


MHenke on Jul 26, 2006 at 12:49:03 AM (# 12)

> but i am sad becouse i would like to use the complete code above
Well, given an appropriate amount of own effort, SiteExpert isn't the place for a developer to become sad.
You'll find all the help we can give to make you happy (plus some more, utterly unrelated foolery...  8).

Try to do what I've suggested, use the above mentioned trace tool to compare your SOAP requests and responses when you access the service through IE resp. your Java client.
BTW, what tool you're using to access the web service via IE, and how did you build your Java client?

If you stuck, come back, I'll have a look at it.


speed on Dec 1, 2007 at 11:24:00 AM (# 13)

i had the same problem.
thanks
speed
http://tech-unite.com/forum/viewtopic.php?f=5&t=10


dhanushka on Jul 16, 2009 at 12:40:07 PM (# 14)

Hi

I have writen .Net Client to to access the java webservice which is deployed in axis2 webservice engine in tomcat.in there we can pass the data object between .net and java
Please follow ULR bellow to refer
http://www.simpleguidewebservice.blogspot.com/

Dhanushka


Earlier Replies | Replies 8 to 14 of 14 | Later Replies
Goto Page: 2 1

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.