axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Bernard <david.bern...@silverbrookresearch.com>
Subject [axis2c] Adding elements to SOAP envelope header in client
Date Sun, 09 Apr 2006 22:23:46 GMT
I need to add elements to the soap envelope header before calling a web 
service.

The api seems to support specific elements in the soap envelope header 
such as AXIS2_MSG_INFO_HEADERS_SET_TO.

Q1.
Having cloned the sample code eg math, what is the best way to add 
elements to the soap envelope header?

Q2
At what point has the SOAP envelope been create so that I could get the 
envelope and add elements to it?

Q3
Does the api just create stuff as it needs anyway and I could do

Unravelling the sample code
-------------------------------------------------------------------------------------------------------------------------------
   stub =
        axis2_stub_create_with_endpoint_uri_and_client_home(&env, address,
            client_home);
    AXIS2_STUB_SET_TRANSPORT_INFO(stub, &env, AXIS2_TRANSPORT_HTTP,
        AXIS2_TRANSPORT_HTTP, AXIS2_FALSE);


   call = AXIS2_STUB_GET_CALL_OBJ(stub, env);
    ret_node = AXIS2_CALL_INVOKE_BLOCKING_WITH_OM(call, env, 
"CreateInstanceRq", node);


This is format of the request I am trying to send. (ASAP/wfxml protocol)
------------------------------------------------------------------------------------------------------------------------------
<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header>
      <ns1:Request xmlns:ns1="http://www.oasis-open.org/asap/0.9/asap.xsd">
         
<ns1:SenderKey>http://192.168.157.3:8081/qa/axis/asapObserverBinding?procId=xxx&amp;actId=yyyyy</ns1:SenderKey>
         
<ns1:ReceiverKey>http://configurer1:8082/axis/services/wfxmlFactoryBinding?procDef=zzz&amp;packageId=aaaaaar</ns1:ReceiverKey>
         <ns1:ResponseRequired>Yes</ns1:ResponseRequired>
      </ns1:Request>
   </soapenv:Header>
   <soapenv:Body>
      <CreateInstanceRq xmlns="http://www.oasis-open.org/asap/0.9/asap.xsd">
         <StartImmediately>true</StartImmediately>
         
<ObserverKey>http://192.168.157.3:8081/qa/axis/asapObserverBinding?procId=xxx&amp;actId=yyyyy</ObserverKey>
         <Name>xxxxx_yyyyyy</Name>
         <Subject>xxxxxx_yyyyyy</Subject>
         <Description>xxxxxxx.</Description>
         <ContextData>
            <action xmlns="">START</action>
            <currentState xmlns="">NOT_RUNNING_STARTING</currentState>
            <id xmlns="">10001</id>
            <message xmlns=""></message>
            <newState xmlns="">RUNNING</newState>
            <status xmlns=""></status>
         </ContextData>
      </CreateInstanceRq>
   </soapenv:Body></soapenv:Envelope>


Mime
View raw message