cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Weinger" <gwein...@itmedicine.net>
Subject RE: SOAP taglib and SOAP RPC
Date Thu, 15 Nov 2001 21:18:51 GMT
Unfortunately, I don't have access to the code (it's in another 
department in this elephantine bureaucracy :( )  The author of the 
service suggested that the error could come from improper placement of 
namespace declarations.

I was able to use the SOAP tcpTunnel to capture a successful outbound 
message.  I'm assuming that if I can duplicate it, I will be successful.
I tried to duplicate this with the soap logicsheet but couldn't do it 
exactly.   There doesn't seem to be a way to put the namespace 
declarations for xsi and xsd in the SOAP-ENV element.    Also, it looks 
like the parameter elements are dropping their xsi prefixes.  The only 
other inconsistency I find is an extra line break after the xml 
declaration.  Let me know if this helps, or if you need more 
information.  I can probably get ahold of the service code eventually,
if 
necessary.  I'm wondering if you think the SOAP service is set up 
poorly and should be changed, or if this kind of flexibility should be 
available in the logicsheet.  

The successful call looks like this:

POST /racf/servlet/rpcrouter HTTP/1.0
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: 488
SOAPAction: ""

<?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:Body>
<ns1:getAuthMsg xmlns:ns1="urn:racf" 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<uid xsi:type="xsd:string">USER</uid>
<passw xsi:type="xsd:string">pass</passw>
</ns1:getAuthMsg>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


And the taglib-generated call looks like this:

<?xml version="1.0"?>

<SOAP-ENV:Envelope 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Bod
y 
xmlns:xsd="http://www.w3.org/1999/XMLSchema" 
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
     
     
      <ns1:getAuthMsg 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:ns1="urn:racf">
           
          <uid type="xsd:string">USER</uid>
        <passw type="xsd:string">pass</passw>
      </ns1:getAuthMsg>
    </SOAP-ENV:Body></SOAP-ENV:Envelope>


The code looks like this now:


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
          language="java"
          xmlns:xsp="http://apache.org/xsp"
      xmlns:gw="http://www.mednet.ucla.edu/gateway"     
      xmlns:soap="http://apache.org/xsp/soap/3.0"
      xmlns:xscript="http://apache.org/xsp/xscript/1.0"
 >
  <gw:logon>
    <soap:call 
url="http://webapp01.medctr.ucla.edu:80/racf/servlet/rpcrouter">
      <soap:namespace prefix="xsi" 
uri="http://www.w3.org/1999/XMLSchema-instance"/>
      <soap:namespace prefix="xsd"
uri="http://www.w3.org/1999/XMLSchema"/>
      <ns1:getAuthMsg xmlns:ns1="urn:racf">
            <soap:enc/>
          <uid xsi:type="xsd:string">USER</uid>
        <passw xsi:type="xsd:string">pass</passw>
      </ns1:getAuthMsg>
    </soap:call>
  </gw:logon>
</xsp:page>


> -----Original Message-----
> From: ovidiu@orion.rgv.hp.com [mailto:ovidiu@orion.rgv.hp.com] On
Behalf
> Of Ovidiu Predescu
> Sent: Thursday, November 15, 2001 9:19 AM
> To: Greg Weinger
> Cc: cocoon-dev@xml.apache.org
> Subject: Re: SOAP taglib and SOAP RPC
> 
> The problem might be somewhere else. Let me investigate this a little
> bit more.
> 
> Is it possible for you to make available the code for the SOAP server?
> If it's simple enough, of course. I see that you use Apache SOAP,
> right?
> 
> Thanks,
> --
> Ovidiu Predescu <ovidiu@cup.hp.com>
> http://orion.rgv.hp.com/ (inside HP's firewall only)
> http://sourceforge.net/users/ovidiu/ (my SourceForge page)
> http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs,
other
> stuff)
> 
> On Wed, 14 Nov 2001 12:47:54 -0800, "Greg Weinger"
> <gweinger@itmedicine.net> wrote:
> 
> > Thanks Ovidiu.  The samples were helpful.
> >
> > Now I'm getting the following error:
> >
> >
> >   <faultcode>SOAP-ENV:Client</faultcode>
> >   <faultstring>parsing error: org.xml.sax.SAXParseException: The XML
> > declaration may only appear at the very beginning of the
> > document.</faultstring>
> >
> >
> > Can you suppress the xml declaration, or does the exception belie
> > something else?  This is the envelope sent, via the debug log:
> >
> >
> >   DEBUG   (2001-11-14) 11:53.04:892   [cocoon  ]
> > (/cocoon/gateway/soap.xsp) tcpConnection-8080-0/soap_xsp:
XScriptObject
> > for soap:call is
> > <?xml version="1.0"?>
> >
> > <SOAP-ENV:Envelope
> > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
> >     <SOAP-ENV:Body>
> >         <racf:getAuthMsg
> > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:racf="urn:racf">
> >             <uid xsi:type="xsd:string"
> > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
> > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">USER</uid>
> >             <passw xsi:type="xsd:string"
> > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
> > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">pass</passw>
> >        </racf:getAuthMsg>
> >     </SOAP-ENV:Body></SOAP-ENV:Envelope>
> >
> >
> > And here is the code:
> >
> >
> >   <?xml version="1.0" encoding="ISO-8859-1"?>
> >    <xsp:page
> >           language="java"
> >           xmlns:xsp="http://apache.org/xsp"
> >           xmlns:gw="http://localhost/gateway"
> >           xmlns:soap="http://apache.org/xsp/soap/3.0"
> >           xmlns:xscript="http://apache.org/xsp/xscript/1.0"
> >    >
> >    <gw:logon>
> >      <soap:call url="http://localhost:80/racf/servlet/rpcrouter">
> >             <racf:getAuthMsg xmlns:racf="urn:racf">
> >               <soap:enc/>
> >               <uid xsi:type="xsd:string"
> > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> > xmlns:xsd="http://www.w3.org/1999/XMLSchema">LMGSW</uid>
> >               <passw xsi:type="xsd:string"
> > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> > xmlns:xsd="http://www.w3.org/1999/XMLSchema">prost8te</passw>
> >            </racf:getAuthMsg>
> >     </soap:call>
> >   </gw:logon>
> > </xsp:page>
> >
> >
> > > -----Original Message-----
> > > From: ovidiu@cup.hp.com [mailto:ovidiu@cup.hp.com]
> > > Sent: Tuesday, November 13, 2001 9:31 PM
> > > To: Greg Weinger
> > > Cc: cocoon-dev@xml.apache.org
> > > Subject: Re: SOAP taglib and SOAP RPC
> > >
> > > On Tue, 13 Nov 2001 19:01:15 -0800, "Greg Weinger"
> > > <gweinger@itmedicine.net> wrote:
> > >
> > > > >From the documentation on hp's site it appears that the soap
taglib
> > can
> > > > support SOAP RPC as well as document exchange, but only provides
an
> > > > example of document exchange
> > > > (http://www.e-speak.hp.com/faq/faqs_howto.shtm#10).
> > >
> > > The SOAP logicsheet doesn't care whether the body of the message
is a
> > > normal XML fragment part of a document exchange or a SOAP RPC
> > > fragment. It simply passes along to the server the fragment
embedded
> > > inside the soap:call element.
> > >
> > > In fact the sample you refer to uses on the server side a SOAP RPC
> > > service to process the request.
> > >
> > > > Does the SOAP taglib in HEAD also support RPC?  If so, could
someone
> > > > please provide example XSP code?
> > >
> > > As I mentioned above, the SOAP logicsheet makes no distinction
between
> > > document exchange and SOAP RPC. This is possible because the SOAP
> > > logicsheet doesn't use any SOAP Java client library to do the
work,
> > > it's based purely on Cocoon components.
> > >
> > > For examples check out the code from Cocoon's CVS and take a look
at
> > > the XScript/SOAP samples that appear on the main page. In the
source
> > > tree they are located in webapp/doc/samples/xscript/.
> > >
> > > Note that the API of the XML elements has changed compared to
HPWS'
> > > xstream elements, it now uses the XScript concept. This allows for
> > > arbitrary Java objects, whether they can or they cannot be
represented
> > > as XML, to be manipulated in XSP pages. Examples of such objects
> > > include SQL result sets, objects obtained from the POST request
> > > etc. Please consider what is in Cocoon's CVS as the latest bits,
> > > current HPWS development versions use the same source code base.
> > >
> > > Regards,
> > > --
> > > Ovidiu Predescu <ovidiu@cup.hp.com>
> > > http://orion.nsr.hp.com/ (inside HP's firewall only)
> > > http://sourceforge.net/users/ovidiu/ (my SourceForge page)
> > > http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs,
> > other
> > > stuff)
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> >
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message