Krishna, The programming API that you use is orthogonal to the format of the message. Document style versus RPC style refers to the message format. Normally, when using an API like JAX-RPC, most programmers let the framework marshal the SOAP message, which allows them to work with Java objects rather than XML structures. You aren't using the framework this way, though. You are contructing the SOAP message and simply using the framework to transfer the message. Therefore it's up to you to build the SOAP message using the appropriate format (when you define the SOAPxml string).
Your current string actually looks like an RPC style message since the body consists of a method name <Add> and two arguments <arg1> and <arg2>, which is consistent with the RPC message style. Note that you have an error in your message. The xsi:schemaLocation attribute must point to a resolvable URL. It can't point to a URN. (And then there's the fact that I would expect the two input arguments for <add> to be numbers rather than strings.) Anne ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, June 14, 2003 10:58 AM Subject: Question on Document Style Service Vs RPC Style Service .. > Hi All, > > I need a clarification on different service styles used in Axis 1.0. > > I'm sending the SOAPxml String as a parameter to invoke the webservices > ...Java objects are generated using WSDL2Java and it will be the input > parameter for the method in the webservices.. > > Here the client should invoke the webservices by passing xml string as > input parameter rather than java object. > > Client Application: > > String SOAPxml = "<?xml version=\"1.0\" encoding > =\"UTF-8\"?><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:Body><p:Add xmlns:p > =\"urn:CalculateNS\" xmlns:xsi > =\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation > =\"urn:CalculateNS > CalcSchema.xsd\"><arg1>Hi</arg1><arg2>Hello</arg2></p:Add></soapenv:Body></s oapenv:Envelope> > > > " ... > > Message msg = new Message(SOAPxml); > call.setRequestMessage(msg); > call.invoke(); > Message respMsg = call.getResponseMessage(); > System.out.println("Response Message :"+respMsg.getSOAPEnvelope()); > > > Method exposed as a webservice: > > public String add(Add parameters) throws java.rmi.RemoteException { > String strMsg = parameters.getArg1(); > return strMsg ; > } > > > Question > Can we achieve the same using RPC mode of style rather than document style > service ?.. If yes, could you please explain the way of approach to be > followed? .. If no, can you give me the reason behind it?.. > > Thanks > krishna > > > This message is for the designated recipient only and may contain > privileged, proprietary, or otherwise private information. If you have > received it in error, please notify the sender immediately and delete the > original. Any other use of the email by you is prohibited. >
