users@jax-rpc.java.net

Re: Capturing SOAP file

From: Arun Gupta <arun.gupta_at_sun.com>
Date: Mon, 09 Sep 2002 14:11:23 -0700

Hi Sudeep,

YOUR_STUB is any stub generated by xrpcc or wscompile.

I think the problem in your code is that you are casting
MDSOAPServer_Impl.getMDSOAPPort() to javax.xml.rpc.Stub and then
assigning to a variable of type javax.xml.rpc.Stub. I think that is the
reason that you are getting "method not found" error. However if you
write your code as:

MDSOAPPort_Stub stub = createProxy(); // Declare the variable of your
stub type

then it should work. As explained earlier, this generated stub class
inherits from com.sun.xml.rpc.client.StubBase and has the method
_setTransportFactory.

Thanks for your interest in JAX-RPC.

Thanks,
-Arun

sudeep pattnaik wrote:

>Arun,
>
>I know it's not accesible through javax.xml.rpc.Stub. What i wanted to know is , is there any way around to solve what i am looking for. As the client stub is using javax.xml.rpc.Stub, how do i capture the SOAP file. Per your previous mail, you said i can do it by doing this in the client side
>
>FileOutputStream log = new FileOutputStream(YOUR_FILE_NAME);
>YOUR_STUB._setTransportFactory(new
>com.sun.xml.rpc.client.http.HttpClientTransportFactory(log));
>
>What should i use in YOUR_STUB(in your example) ?
>
>Thanks for your help.
>Sudeep
>
>
>Arun Gupta wrote:
>
>>Hi Sudeep,
>>
>>_setTransportFactory method is not available in javax.xml.rpc.Stub
>>interface. This method is available in com.sun.xml.rpc.client.StubBase
>>which is the base class for all the generated stubs. Please note that
>>all com.sun.xml.rpc.* APIs are non-standard and may be changed in the
>>future versions of JAX-RPC.
>>
>>To log SOAP messages on server-side, you can write a server-side logging
>>handler which can capture the SOAP request and response messages and
>>dump them to a log file.
>>
>>Thanks for your interest in JAX-RPC.
>>
>>Regards,
>>-Arun
>>
>>sudeep pattnaik wrote:
>>
>>>Hi,
>>>
>>>I would like to capture the SOAP files either at Client end or at Server end. As per Arun Gupta's suggestion, I tried to do the following way at the client end. I am getting some error message as to method not found when i call _setTransportFactory method. Could somebody let me know what i am doing wrong ? Also is there any way i can log the incoming and outgoing SOAP requests from the jaxrpc Server.
>>>
>>>package MDSOAPService;
>>>
>>>import javax.xml.rpc.Stub;
>>>import java.io.*;
>>>import com.sun.xml.rpc.client.http.*;
>>>
>>>public class MDSOAPClient {
>>> public static void main(String[] args) {
>>> String sessionID="";
>>> try {
>>> Stub stub = createProxy();
>>> stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY, args[0]);
>>> MDSOAP mds = (MDSOAP)stub;
>>> sessionID = mds.login("good", "xxxxx");
>>> FileOutputStream log = new FileOutputStream("<directory>/SOAPLOG");
>>> mds._setTransportFactory(new com.sun.xml.rpc.client.http.HttpClientTransportFactory(log));
>>> mds.logout(sessionID);
>>> } catch (Exception ex) {
>>> ex.printStackTrace();
>>> }
>>> }
>>>
>>> private static Stub createProxy() {
>>> return (Stub)(new MDSOAPServer_Impl().getMDSOAPPort());
>>> }
>>>}
>>>
>>>Thanks for your help.
>>>
>>>Sudeep Pattnaik
>>>
>>--
>>=============================================
>>There is only one me, I must live myself!
>>There is only one today, I must live itself!
>>=============================================
>>http://members.tripod.com/~apgupta/index.html
>>=============================================
>>

--
=============================================
There is only one me, I must live myself!
There is only one today, I must live itself!
=============================================
http://members.tripod.com/~apgupta/index.html
=============================================