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

View All Replies | Goto Page: 2 1
MHenke on Jul 25, 2006 at 7:44:14 AM

Nope. If you call the web service and it returns w/o error, the return value has to be assumed as correct.
The rest depends on the service implementation. What makes you think that the return value isn't correct?


View All 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-2000 InsideDHTML.com, LLC. All rights reserved.