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 Me...@aol.com on 2001/08/20 17:44:00 UTC

( Please Help ) Urgent Request: How to send a response in a Custom Provider

Hi,

I am using a custom provider to provide a response to a request. I want the 
request to be of the following nature

Soap Header 
<A>
<B>String</B>
</A> 
and I have the completed xml soap body as a String. 

I am not able to do it. 

I get the following response

Soap Header
<methodResponse>
<A>
<bytes encoding="base-64" >jgsgdjsgfjsagfkjagfkjgfj
</bytes>
<A>
</methodResponse>

I dont want the methodResponse and the return value as bytes. I dont know why 
it encodes everyhting. 
Please help me fix this problem. Here is the code snippet that sends a 
response within the invoke
method of the custom provider....

Parameter param = new Parameter("A",  
org.apache.xerces.dom.ElementImpl.class, 
(org.apache.xerces.dom.ElementImpl)base.getFirstChild() ,null);
Response resp = new Response
(
  call.getTargetObjectURI(),   // URI
  call.getMethodName(),  // Method
   param,      // ReturnValue
   null,                  // Params
  null,    // Header
   call.getEncodingStyleURI(),                  // encoding
   res );          // response soapcontext - not supported yet

                    Envelope env = resp.buildEnvelope();
          StringWriter  sw = new StringWriter();
                    env.marshall( sw, call.getSOAPMappingRegistry(), res );
                    res.setRootPart( sw.toString(), 
Constants.HEADERVAL_CONTENT_TYPE_UTF8);