• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic