Paul,

I managed to get a little bit down the trasck with your suggestion. Here is the code

@Test
public void testCreationofSOAPEnvelope() throws Exception {
  SOAPFactory fac = OMAbstractFactory.getSOAP12Factory();
  SOAPEnvelope env = fac.getDefaultEnvelope();
  OMNamespace tns1 = fac.createOMNamespace(
    "http://dlgpsr.qld.gov.au/smarteda/prototype/dap/200611";, "tns1");
  OMElement root = fac.createOMElement("StartTestRequestInfo", tns1);
  root.setText("1");
  env.getBody().addChild(root);
                
  ServiceClient client = new ServiceClient(null, new
    URL("file:src/main/wsdl/SimplePAProcess.wsdl"), null, null);

client.getOptions().setAction("http://dlgpsr.qld.gov.au/eda/bpms/200611/SimplePAProcess/Client_To_SimplePAProcess/Client_To_SimplePAProcess_PortType/Start_Process";);
client.sendReceive(new QName("Start_Process"), env);
}

Unfortunaltely, when i run the code I get the following error

java.lang.NullPointerException
at org.apache.axis2.description.ClientUtils.inferInTransport(ClientUtils.java:85) at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:163) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:579) at com.comware.intalio.testing.TestSimplePAProcess.testCreationofSOAPEnvelope(TestSimplePAProcess.java:64)


Am I not setting something correctly?

cheers
</jima>
Paul Fremantle wrote:
Jim

I'm assuming you know how to create the XML payload of the SOAP body,
and parse the response body.

OMElement payload = ....;

ServiceClient sc = new ServiceClient("url-to-service");
sc.setAction(SOAPAction);
OMElement response = sc.sendReceive(payload);

You can also dynamically use the URL information and Actions etc from a WSDL:

ServiceClient sc = new ServiceClient(null, new URL(wsdlLocation), null,null);
In this case you need to specify the operation you are calling:

QName operation = new QName("submitPurchase");
response = sc.sendReceive(operation, payload);

Paul




On 3/23/07, Jim Alateras <[EMAIL PROTECTED]> wrote:
[resend with a more appropriate subject]

I was wondering whether someone could tell me whether axis2 can support
stubless (i.e. dynamic stubs) invocation of web services.

If so can you pls point me to any resources\examples?

cheers
</jima>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to