axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Roder <mro...@wamnet.com>
Subject How to get/pass header session information
Date Fri, 28 Sep 2001 17:28:53 GMT

I am just starting to use axis, so this may be simple.  I am working on a
soap client application hitting an existing server.

How do I pull the session information out of the header of the following
response?

Then, how do I add it all following requests?


My current code:

    User aUser=ArchiveDataTEST.getValidUser();
    RPCParam userParam = new RPCParam("User", aUser) ;
  
    String endpoint = "http://localhost:80/cgi-bin/wambase/mvsrch_front";
 
    ServiceClient client = new ServiceClient(endpoint);
    client.addOption(AxisEngine.PROP_DOMULTIREFS, new Boolean(false));
    client.addSerializer(User.class,new QName(),new BeanSerializer());
    String ret = (String)client.invoke("Login",
                                       new Object [] {userParam });    
    System.out.println("Sent 'Hello!', got '" + ret + "'");



Response I need to get session information out of:

HTTP/1.1 200 OK Date: Fri, 28 Sep 2001 16:39:10 GMT Server: Apache/1.3.11
(Unix) mod_ssl/2.5.0 OpenSSL/0.9.4 Connection: close Content-Type: text/xml
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
	<soap:Header>
	 
		 <auth:SessionID xmlns:auth="urn:schemas-wamnet-com:Session"
soap:mustUnderstand="1">
			ses09281011739119691.id
		</auth:SessionID> 
	</soap:Header> 
	<soap:Body> 
		<m:LoginResponse xmlns:m="urn:schemas-wamnet-com:Archive" />
	</soap:Body>
</soap:Envelope>


Example request I need to put the session information into:

POST /cgi-bin/wambase/mvsrch_front HTTP/1.0 Host: localhost Content-Type:
text/xml; charset=utf-8 Content-Length: 608 SOAPAction:
"urn:schemas-wamnet-com:Archive#GetLibraries"  <?xml version='1.0'
encoding='UTF-8'?> 
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"> 
<SOAP-ENV:Header> 
<auth:SessionID soap:mustUnderstand="1"
xmlns:auth="urn:schemas-wamnet-com:Authentication">
ses09281011809017084.id 		</auth:SessionID> 
</SOAP-ENV:Header> 
<SOAP-ENV:Body> <ns1:GetLibraries xmlns:ns1="urn:schemas-wamnet-com:Archive"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
</ns1:GetLibraries> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 


Thanks

Mark

Mime
View raw message