Hi,
I
think that you can't bypass the <methodResponse> and
</methodResponse> tags wich are part of SOAP RPC
specifications...
Well,
I'm nearly in the same situation, and my Provider returns a response wich
looks like that :
<SoapEnvelope>
<SoapBody>
<methodResponse>
<A>
<B>String</B>
</A>
</methodResponse>
</SoapBody>
</SoapEnvelope>
To
encode my response into (literal) XML, here is the code I use (when creating the
Parameter instance for result):
_resp=
new Parameter( RPCConstants.ELEM_RETURN ,
Element.class,
_myElementInstance,
null);
_myElementInstance is an instance of
org.w3c.dom.Element ...
You
can obtain Element instance using a Dom parser or any kind of DOM
implementation.
Nothing more is to be declared, the XLM encoder
(XMLParameterSerializer) is already registered into the mapping
registery.
Regards.
-----Message
d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Envoy� : lundi 20 ao�t 2001 17:44
� : [EMAIL PROTECTED]
Objet : ( Please Help ) Urgent Request: How to send a response in a Custom Provider
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Envoy� : lundi 20 ao�t 2001 17:44
� : [EMAIL PROTECTED]
Objet : ( 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);
