You cannot achieve the desired envelope using an Apache SOAP RPC Call, because it is not a SOAP RPC call. In particular, the SOAP 1.1 spec implies and the 1.2 spec clarifies, an RPC SOAP Body has a single body element. The body you show has 2. As such, with Apache SOAP, you are stuck using the messaging API.
Additionally, Apache SOAP has the limitation that one cannot specify a namespace for a parameter. Someone started adding this capability quite some time ago, but it was never finished. I am curious: do you have WSDL for this service? If so, can you post it? On 7 Jul 2003 at 9:22, Daniel Zhang wrote: > Thank you Scott for your patient reply. What I mean is every tag inside > Envelope is CUSTOMIZED. > In SOAP RPC call, you usually have default tag inside SOAP Body like: > > <ns1: methodName xmlns:ns1="urn:..." > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> > > I understand that one can change part of the tags/prefix through > Constants.java, but in my particular case, there are > several depths of nested elements inside the Header and Body, each > element has exactly fixed format and tag for it. > I find it is really hard to realize this through changing > Constants.java. That's why I use message.send() to control > those customized prefix and tags. > > What I wonder is if there are methods in Apache SOAP to let me pass the > customized tags and prefix into its Header > and Body. For example, say you have buildHeader(stringHeader), > buildBody(stringBody), so that you can pass a > pre-defined Header and Body tags/prefix into the Envelope. > > Thanks again, > > -Daniel > > > Scott Nichol wrote: > > >Hmmm. I still don't quite understand what you need to accomplish. > >You have emphasized *soap:Envelope*, *soap:Header* and *soap:Body*, > >which is just a change of namespace prefix from SOAP-ENV to soap. > >The way you would achieve that is to change Constants.java and make > >sure its .class file gets loaded instead of the "sanctioned" one from > >a distribution. Are there other aspects to the request that you do > >not know how to do with Apache SOAP? > > > >On 3 Jul 2003 at 11:53, Daniel Zhang wrote: > > > > > > > >>Scott - > >> > >>What need to be changed are not only prefix, also include SOAP Header, > >>Body, and their > >>sub-elements. Our customer required a specific format for SOAP Request > >>and Response. > >>Example of SOAP request like: > >> > >><*soap:Envelope* xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" > >> xmlns:cb="http://mycompany.com/cbody.xsd" > >> xmlns:ch="http://mycompany.com/cheader.xsd" > >> > >>xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd" > >> > >> > >> xmlns:xlink="http://www.w3.org/1999/xlink" > >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >> xmlns:xs="http://www.w3/org/2001/XMLSchema" > >> xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ > >> > >>http://www.oasis-open.org/committees/ebxml-msg/schema/envelope.xsd > >> cbody.xsd cheader.xsd status.xsd > >>ticket.xsd response.xsd" > > >>* <soap:Header> * > >> <eb:MessageHeader eb:id="ID000001" > >>eb:version="2.0"soap:mustUnderstand = "1"> > >> <eb:From> > >> <eb:Role>String</eb:Role> > >> </eb:From> > >> <eb:To> > >> <eb:Role>String</eb:Role> > >> </eb:To> > >> <eb:CPAId>TBD</eb:CPAId> > >> <eb:ConversationId>934523405</eb:ConversationId> > >> <eb:Service>service</eb:Service> > >> <eb:Action>Application</eb:Action> > >> </eb:MessageHeader> > >> <ch:cHeader> > >> <ch:version>1.0</ch:version> > >> <ch:messageType type="xs:string">string</ch:messageType> > >> </ch:cHeader> > >> *</soap:Header>* > >>* <soap:Body>* > >> <eb:Manifest eb:id="ID000002" eb:version="2.0"> > >> <eb:xlink="http://mycompany.com/link" /> > >> </eb:Manifest> > >> <cb:cBody> > >> <cb:MessageType> > >> <cb:Name>John</cb:Name> > >> <cb:Phone>1233456789</cb:Phone> > >> ..... > >> </cb:MessageType> > >> </cb:cBody> > >> *</soap:Body>** > >></soap:Envelope> * > >> > >>So how can I achieve this in SOAP RPC call(call.invoke())? Apache SOAP > >>is pretty much predefine those tags. > >>All I think now is to use message call to achieve but it can not embed > >>object or attachment, isn't it? > >> > >>-Daniel > >> > >> > >> > >> > > > Scott Nichol Do not reply directly to this e-mail address, as it is filtered to only receive e-mail from specific mailing lists.