• 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

problem with SOAP

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all, here is my code:

public static void main(String[] args) throws Exception
{
URL url = new URL("http://****/WEBSERVICE");

SOAPMappingRegistry smr = new SOAPMappingRegistry ();
StringDeserializer sd = new StringDeserializer ();
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName ("", "Result"),
null, null, sd);
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName ("", "ResultCode"),
null, null, sd);
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName ("", "ResultMessage"),
null, null, sd);

// define input parameters
Vector params = new Vector ();
String login = "lcbarreram";
String password = "12345678";
params.addElement(new Parameter("login", String.class, login, "http://schemas.xmlsoap.org/soap/encoding/"));
params.addElement(new Parameter("password", String.class, password, "http://schemas.xmlsoap.org/soap/encoding/"));


// create the transport and set parameters
SOAPHTTPConnection st = new SOAPHTTPConnection();

// build the call.
Call call = new Call();
call.setSOAPTransport(st);
call.setSOAPMappingRegistry (smr);
call.setTargetObjectURI("http://****/WEBSERVICE");
call.setMethodName("Autentication");
call.setEncodingStyleURI("http://schemas.xmlsoap.org/soap/encoding/");
call.setParams(params);



Response resp;
try {
resp = call.invoke(url,"");
}
catch (SOAPException e)
{
System.err.println("Caught SOAPException (" + e.getFaultCode()
+ "): " + e.getMessage());
//System.out.println(e.printStack());
return;
}

// check response
if (!resp.generatedFault())
{
Parameter ret = resp.getReturnValue();
Object value = ret.getValue();
System.out.println("ResponseCode: " + value);

Vector v = resp.getParams();
for (int i = 0; i < v.size(); i++)
{
Parameter p = (Parameter)v.elementAt(i);
System.out.println(p.getName() + ":\t" + p.getValue());
}
}
else
{
Fault fault = resp.getFault ();
System.err.println("Generated fault: ");
System.out.println(" Fault Code = " + fault.getFaultCode());
System.out.println(" Fault String = " + fault.getFaultString());
}
}
}



I get the following message

Caught SOAPException (SOAP-ENV:Client): No Deserializer found to deserialize a &
apos;http://************/ws:sia:AutenticationReturn&apos; using encoding
style 'null'.


what can i do?what serializer do i have to use?

thanks in advance
 
That new kid is a freak. Show him this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic