You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Cory Foy <Fo...@hillsboroughcounty.org> on 2003/10/14 19:41:08 UTC

Hopefully Simple Question

We have a java Web Service deployed for transactions. I am writing a very basic client to send a receive a request to the service. 

The input XML doc expected looks like the following:

<request>
   <username>blah@foo.com</username>
   <password>imapassword</password>
   <reqdoc>EDIDocumentHere</reqdoc>
</request>

and returns the following

<response>
   <error>Error messages here</error>
   <doc>Response doc here</doc>
</response>

(The full WSDL can be seen at https://apps.boccportal.org/apps/hipaa_portal/hipaa)

I have been reading through the documentation and several lists, and this is what I have thus far.

//Build Request
	//HipaaRequest request = new HipaaRequest();
	//request.setUsername(tfEmail.getText());
	//request.setPassword(tfPassword.getText());
	//request.setReqdoc(tfReqdoc.getText());
	
	//Initialize Request and Response Serializers
	HipaaRequestSerializer reqser = new HipaaRequestSerializer();
	HipaaResponseSerializer resser = new HipaaResponseSerializer();
	
	//Create the Registry - used to map the XML documents to the Request/Response objects
	SOAPMappingRegistry reg = new SOAPMappingRegistry();
	String uri = reg.getSchemaURI();
	
	//Actually map them
	reg.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("http://www.hillsboroughcounty.org/hipaa", "Request"), HipaaRequest.class, reqser, reqser);
	reg.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("http://www.hillsboroughcounty.org/hipaa", "Response"), HipaaResponse.class, resser, resser);
	
	Response resp = null;

	try {
	    
	    //Set up initial params to SOAP call
	    URL url = new   
	      URL("https://apps.boccportal.org/apps/hipaa_portal/hipaa");
	    Call call = new Call(  );
	    call.setTargetObjectURI("urn:ProcessRequestParams");
	    call.setMethodName("request");
	    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
	    call.setSOAPMappingRegistry(reg);
	    
	    //Set up passed params
	    Vector params = new Vector();
                    //params.addElement(new Parameter("request",
	    //		      HipaaRequest.class,
	    //		       request,
 	    //		       null));
	    
	    
	    params.addElement(new Parameter("username", 
					    String.class,
					    tfEmail.getText(),
					    Constants.NS_URI_SOAP_ENC));
	    
	    params.addElement(new Parameter("password", 
					    String.class,
					    tfPassword.getText(),
					    Constants.NS_URI_SOAP_ENC));
	    
	    params.addElement(new Parameter("reqdoc", 
					    String.class,
					    tfReqdoc.getText(),
					    Constants.NS_URI_SOAP_ENC));
					    
	    call.setParams(params);
	    
	    resp = call.invoke(url, "https://apps.boccportal.org/apps/hipaa_portal/ProcessRequest");
	}catch(Exception e){
	    e.printStackTrace();
	}

The error I am getting back is that "No Deserializer found to deserialize a ':error' using encoding style 'null'" which confirms for me (as does my server logs) that the request is making it to the server, it just isn't understanding the response.

My guess is that I have to register the response with the code. I have a HipaaResponse class and a HipaaResponseSerializer class built already. Can someone guide me as to the next direction I should take, or perhaps something I could read up on to see where I am falling short at? Thanks for any information you can provide.

Cory Foy
----------------------
Webmaster
Information & Technology Services Department
Hillsborough County BOCC
Phone: (813) 276-8287
Email: foyc@hillsboroughcounty.org
Web: www.hillsboroughcounty.org