You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by "Prajapati, Jayesh" <ja...@certive.com> on 2000/12/07 19:08:48 UTC

TRYING THE SOAP API [getting exceptions]

Hi all,
    Here is the transaction expected for a sample soap request and response:
Here is a transaction:

SOAP::Transport::HTTP::Client::send_receive: POST
http://devlab5.engr.certive.com/soap?class=IVR
Content-Length: 454
Content-Type: text/xml
SOAPAction: "#callerid"

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
  xmlns:SOAP-NV="http://schemas.xmlsoap.org/soap/envelope/" 
 xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<callerid>
<phone xsi:type="xsd:int">5551212</phone>
</callerid>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Connection: close
Date: Mon, 04 Dec 2000 20:42:24 GMT
Server: Apache/1.3.12 (Unix) mod_perl/1.24
Content-Length: 319
Content-Type: text/plain
Client-Date: Mon, 04 Dec 2000 20:44:35 GMT
Client-Peer: 172.24.8.38:80

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" 
     xmlns:xsd="http://www.w3.org/1999/XMLSchema" 
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
   s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<myresponse id="ref-1" s:root="1">
<login>8834</login>
</myresponse>
</s:Body>
</s:Envelope>

Here is the URL:

	http://devlab5.engr.certive.com/soap?class=IVR

Here are the methods:

	callerid( phone )				returns login
	user( user )				returns valid
	pin( user, pin )				returns valid
	workcenter( user, workcenter )		returns valid
	wc_project( workcenter )			returns name
	wc_task( workcenter)			returns name
	hours_valid( user, workcenter, hours )	returns valid
	hours_submit( user, workcenter, hours )	returns accepted

I have written a sample code which calls one method called callerid(phone).
Here is how the java code  looks like :
import java.io.*;
import java.net.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;

public class GetRuntimeInfo {
       public static void main (String[] arguments) throws Exception {
        URL url = new URL
("http://devlab5.engr.certive.com:80/soap?class=IVR");

        // Create/initialize the call object.
        Call call = new Call ();
        call.setEncodingStyleURI (Constants.NS_URI_SOAP_ENC);
        //call.setTargetObjectURI ("System");
        call.setTargetObjectURI
("http://devlab5.engr.certive.com:80/soap?class=IVR");
        
        
        //set the parameters:
        Vector params = new Vector();
        params.addElement (new Parameter("phone", String.class, 
				        new String ("5551212"), null));
        call.setParams(params);
        
        //set the method name:
        call.setMethodName ("#callerid");
       
        //invoke the remote method and print the response.       
        try{
        Response res = call.invoke (url, null);
        System.out.println ("the return value: " + call.invoke (url, null)
                            .getReturnValue ().getValue ());
        }catch(Exception exp1){
           exp1.printStackTrace();
        }
    }
}//class GetRuntimeInfo


and i am getting the following error when i am running the code:
C:\VisualCafe\Projects\CertiveProjects>javac GetRuntimeInfo.java

C:\VisualCafe\Projects\CertiveProjects>java GetRuntimeInfo
org.xml.sax.SAXParseException: White space is required between the public
identifier and the system
identifier.
        at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1016)
        at
org.apache.xerces.framework.XMLDTDScanner.reportFatalXMLError(XMLDTDScanner.
java:645)
        at
org.apache.xerces.framework.XMLDTDScanner.scanExternalID(XMLDTDScanner.java:
1190)
        at
org.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl(XMLDTDScanner.java
:1098)
        at
org.apache.xerces.framework.XMLDocumentScanner.scanDoctypeDecl(XMLDocumentSc
anner.java:21
77)
        at
org.apache.xerces.framework.XMLDocumentScanner.access$0(XMLDocumentScanner.j
ava:2133)
        at
org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.dispatch(XM
LDocumentScan
ner.java:775)
        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
java, Compile
d Code)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:908)
        at
org.apache.soap.util.xml.XercesParserLiaison.read(XercesParserLiaison.java:8
5)
        at org.apache.soap.rpc.Call.invoke(Call.java:157)
        at GetRuntimeInfo.main(GetRuntimeInfo.java:32)
[SOAPException: faultCode=SOAP-ENV:Protocol; msg=<!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request</H1>
Your browser sent a request that this server could not understand.<P>
Client sent malformed Host header<P>
<HR>
<ADDRESS>Apache/1.3.12 Server at devlab5.engr.certive.com Port 80</ADDRESS>
</BODY></HTML>
]
        at org.apache.soap.rpc.Call.invoke(Call.java:167)
        at GetRuntimeInfo.main(GetRuntimeInfo.java:32)

Your help is highly appreciated.
Thankx,
Jayesh

-----Original Message-----
From: Sanjiva Weerawarana [mailto:sanjiva@watson.ibm.com]
Sent: Thursday, December 07, 2000 6:59 AM
To: matkovitsg@uswest.net; Apache SOAP
Cc: soap-user@xml.apache.org
Subject: Re: SSL


Hi George,

[I have cc'ed this to soap-dev because there's discussion of
committing code. Please keep soap-dev cc'ed of any code change
discussions in general.]

Please DO NOT commit the server-side SSL implementation code you
posted earlier. I am not a security guy, but I have to buy the
argument that Darrel posted which said we can't define a security
solution ourselves .. the security community has to do it or
it'll not be accepted. As such, I am putting a -1 on committing
any code that implements a security solution without it coming
with participation from the security community.

The problem with URLConnection in JDK 1.2 is that it doesn't give
access to the content when an HTTP 500 is received. That's broken
for SOAP. Later JDKs have apparently fixed it, but we cannot
not support 1.2 (I think we even support 1.1.* yet, which is a
good thing). "we should get Sun to fix it" is a nice thought, but
it doesn't work that way .. :-)

SSL on the client-side is ABSOLUTELY useful for SOAP. What that
says is that authentication is done via some other mechanism,
say HTTP Basic, and SSL is used to make the interactions secure.

I would like to get the client-side SSL code committed ASAP so
that we can include it in the next Apache SOAP release.

Sanjiva.

----- Original Message -----
From: "George I Matkovits" <ma...@uswest.net>
To: <so...@xml.apache.org>; <pa...@us.ibm.com>;
<le...@lawson.com>; <sa...@watson.ibm.com>; <ma...@lawson.com>
Sent: Wednesday, December 06, 2000 11:00 PM
Subject: Re: SSL


> I have not checked it in yet. I use a URL connection with an Apache
front-end (which does the server side SSL) to a backend Tomcat. I
> never had any problems but I am told that the Soap V3 people do not want
an
URL based SSL solution  but a socket based one. I have
> been trying to get the latest CVS working since 12/1 but no luck (this is
the CVS base I would have to do the check in against). I got
> the base again tonight and hope to have better luck. Soap from the Apache
CVS base does the 1st Soap request OK and then deep-ends in
> re-establishing its context for the 2nd call.  Should I check it in when
it
can not be tested?  I would like to get the latest WSTK
> also with Apache Soap, just now I do not really know what to do next! I
would very much appreciate any advise. My current version of
> Soap is from 9/18 and it is rather dated. The Soap changes are rather
trivial (thanks to Java) I fail to understand what the big deal
> is with SSL, it is simple when done with Java over an URL connection. If
there are any problems with error status then we should get
> Sun to fix it. SSL over sockets can be done but that is more like
traditional procedure programming and some of the URL based client
> side cookie management (which we need for servlet state management) might
not work properly. Only extensive testing could uncover
> these kind of problems but NOT with the currently NOT REALLY WORKING CVS
BASE. (-:
> Thank you - George
>
> p.s. I am sorry for not checking in SSL earlier but SSL without encrypted
passwords and without automated generation of  the SERVER's
> ACL (for many client's with different encrypted passwords) is NOT a
security
solution! (-: It would be professionally IRRESPONSIBLE to
> give just an SSL solution  to the community without providing  a complete
Security package!  I have been working on that and my last
> posting is almost there on the old 9/18 base) If SSL would help WSTK then
I
will do my best but could I just do it with WSTK, please?
> (my company would like to get a license ASAP and probably would have no
problem with returning any changes made against the WSTK Code
> Base. It would be in our interest to have it included in any future
releases.)
> Michael Paolini wrote:
>
> > What is the current status of SSL in Apache SOAP?  Has the base code
been
> > checked in yet?
> >
> > Thanks,
> > Mike
> >
>
>
----------------------------------------------------------------------------
------------------------------------------------------
> >
> > "A doctor can bury his mistakes, an architect can only advise his client
to
> > plant vines...." -Frank Lloyd Wright
> >
> > Internet ID: paolini@us.ibm.com
> > IBM Internal e-mail ID: PAOLINI/Austin/IBM
>