HTTPUtils.buildSocket broken for proxy over SSL

2001-10-27 Thread David Wall



It appears that SOAP 2.2 will attempt to connect 
via SSL to the proxy server host and port from the "get go."  My 
understanding is that a regular HTTP connection needs to be opened first, with a 
connect command specifying the real host/port to communicate with, and then 
followed by an SSL session that is then tunneled by the proxy server.  This 
makes sense since the proxy server would not be able to understand the 
SSL connection otherwise, so it could not forward it to the real host outside 
the proxy.
 
I'm not sure how to fix the code, but since JSSE 
already supports proxies with the use of properties https.proxyHost and 
https.proxyPort, it makes sense that these perhaps could be used in conjunction 
with the proxy settings built into SOAPHTTPConnection.  Does anybody know 
if that should work, or is the problem more severe?  The idea would be for 
https proxying, those two properties would be set before calling the 
SSLUtils.buildSSLSocket so that JSSE would perhaps "do the right thing."  
Thoughts?
 
Thanks,
David


Re: HTTPS with proxy server bug

2001-10-27 Thread David Wall


> Because I'm using JSSE, I'm looking at the patch at the URL above that was
> associated with JSSE to see how to make Apache SOAP clients work using
HTTPS
> with a proxy server.  Does anybody understand how proxying over HTTPS
"ought
> to work"?  That is, is the client supposed to open a connection the proxy
> server over HTTP first, give it some info, and then send the SSL-encrypted
> data?  Is Apache SOAP supposed to handle this already?

https and proxies works as follows: the client creates a connection to
the proxy (as usual), and then sends a CONNECT request, giving the host
and port of the server the client is trying to talk to. If ok, the proxy
creates a connection to the desired server and then sends back a 200
response to the client, and from then on acts like a tunnel, i.e. just
blindly shuffles packgets between the two. At that point the client
basically has a connection with the server, so it starts the usual SSL
handshake and sets up the secure connection.

As far as seeing that in the code: you'll see the method
enableSSLTunneling in HTTPClient which sets up the tunnel through the proxy.
After that
an SSL-socket is wrapped around the underlying socket.

Does anybody know if SOAP 2.2 was designed to work this way?

Thanks,
David




Soap 2.2 and Tomcat 4 problems..

2001-10-27 Thread Tim Read

Hi,

After spending several days trying to install Soap with Tomcat and getting
no where, I hoped that someone here might be able to help me.

I am using jdk 1.3.1, Soap 2.2, Tomcat 4, latest versión of Xerecs.jar,
bsf.jar, activation.jar, mail.jar, and am working on Windows2000 platform,
and my CLASSPATH variable has the following value:

echo %CLASSPATH%
c:\tomcat\lib\xerces.jar;c:\tomcat\lib\soap.jar;c:\tomcat\lib\activation.jar
;c:\tomcat\lib\mail.jar;

I put soap.war in the Tomcat webapps dir, and after starting Tomcat can
access the router
and use the admin tool to see that there are no services deployed. I am also
using the TcpTunnelGui
to monitor soap messages. When I try to deploy the deployment descriptor for
anything (either
one of the samples or something I have written) I wrote I get the following
error:

java org.apache.soap.server.ServiceManagerClient
http://localhost:8070/soap/servlet/rpcrouter deploy javaxml2\CD
Catalog.xml
Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Client;
msg=Parsing error, response was:
The markup in the document preceding the root element must be well-formed.;
targetException=org.xml.sax.SAXParseException: The markup in the document
preceding
the root element must be well-formed.]
at org.apache.soap.rpc.Call.invoke(Call.java:250)
at
org.apache.soap.server.ServiceManagerClient.invokeMethod(ServiceManagerClien
t.java:129)
at
org.apache.soap.server.ServiceManagerClient.deploy(ServiceManagerClient.java
:142)
at
org.apache.soap.server.ServiceManagerClient.main(ServiceManagerClient.java:2
30)

And the last part of the message that the TcpTunnelGui shows is:


http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/1999/XMLSchema";>

http://localhost:8070/soap/servlet/rpcrouter list
Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Client;
msg=Parsing error, response was:
The markup in the document preceding the root element must be well-formed.;
targ
etException=org.xml.sax.SAXParseException: The markup in the document
preceding
the root element must be well-formed.]
at org.apache.soap.rpc.Call.invoke(Call.java:250)
at
org.apache.soap.server.ServiceManagerClient.invokeMethod(ServiceManagerClien
t.java:129)
at
org.apache.soap.server.ServiceManagerClient.list(ServiceManagerClient.java:1
51)
at
org.apache.soap.server.ServiceManagerClient.main(ServiceManagerClient.java:2
37)

And in TcpTunnelGui, I get the following message:


http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/1999/XMLSchema";>

http://schemas.xmlsoap.org/soap/encoding/";>
http://schemas.xmlsoap.org/soap/encoding/";
xsi:type="ns2:Array" ns2:arr

Which, while different from the previous message, once again seems to be cut
short

Needless to say that attempting to call the service, it does not work
(although Tomcat finds the class ok):

java javaxml2.CDAdder http://localhost:8070/soap/servlet/rpcrouter "Riding
the Midnight Train" "Doc Watson"
Adding CD titled 'Riding the Midnight Train' by 'Doc Watson'
[SOAPException: faultCode=SOAP-ENV:Client; msg=Parsing error, response was:
The markup in the document preceding the root element must be well-formed.;
targ
etException=org.xml.sax.SAXParseException: The markup in the document
preceding
the root element must be well-formed.]
at org.apache.soap.rpc.Call.invoke(Call.java:250)
at javaxml2.CDAdder.add(CDAdder.java:34)
at javaxml2.CDAdder.main(CDAdder.java:61)

And in TcpTunnelGui, I get the same type of cut short message:


http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/1999/XMLSchema";>




RE: What is the best way to send Large String from the Client to the Service?

2001-10-27 Thread Barnaby James

Lamentably, I don't know much about visual basic and using it with SOAP but
I'd be very suprised if there were not a way to do this. It might be as
simple as casting your XML String to a byte[] (or whathever the visual basic
equivelent is) and passing it as a parameter. On the Apache SOAP side of
things, if you make the parameter byte[] then it will expect it to be base64
and do the decoding for you. Visual Basic is probably similar so in all
probability, you don't need to worry about it. Here is a link to the (terse)
SOAP spec on the topic:

http://www.w3.org/TR/2001/WD-soap12-20010709/#_Toc478383517

Hope it works out,
Barnaby

-Original Message-
From: Ding, Chengmin [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 26, 2001 8:07 AM
To: '[EMAIL PROTECTED]'
Subject: RE: What is the best way to send Large String from the Client
to the Service?


Barnaby,
Thanks a lot for your hint. The string I am passing is validated XML string,
I read from somewhere that the best way is to use LITERAL_XML encodingStyle.
But I don't how to write the client VB code/WSDL to use LITERAL_XML or
BASE64 ? Are there any samples on using different encodingStyles?

Regards,

-Chengmin

-Original Message-
From: Barnaby James [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 25, 2001 6:56 PM
To: [EMAIL PROTECTED]
Subject: RE: What is the best way to send Large String from the Client
to the Service?


Did you try sending it as a data base64 encoded parameter rather than a
string? i.e. a parameter of xsi:type="SOAP-ENC:base64"? I would think this
would be handled more efficiently than an xsi:type="xsd:string" parameter.
If your class on the Apache SOAP side is byte[] it will be automagically
converted to SOAP-ENC:base64.

Barnaby

-Original Message-
From: Paramdeep Singh [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 25, 2001 3:13 AM
To: [EMAIL PROTECTED]
Subject: Re: What is the best way to send Large String from the Client
to the Service?


Hi,

I think that if the size of the string is too large, then you should send it
as an attachment.

I remember of seeing an article somewhere, which mentioned that if the
string that you are sending is of a very large length, then it may not get
the correct results as well. I think that I read it on this mailing list
only, but cant remember it off-hand.

Regards
Paramdeep


- Original Message -
From: "Ding, Chengmin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 25, 2001 2:05 AM
Subject: What is the best way to send Large String from the Client to the
Service?


> HI, Soap folks,
>   Our web service is based on Apache Soap 2.2 and the web service client
is
> based on Microsoft Soap Tool kit 2.0.
> The client periodically sends an XML String as one of an array parameter
to
> the web service and the web service will do some manipulations of that
> string. The input string used to be below 100 KB and the performance is
> satisfactory. Recently the input XML string increases to around 1 MB and
the
> web service starts to respond extremely slow.
> We put some output statement at the beginning of the web service function,
> now it takes about 15 minutes before we see those output. We want to know
> why it takes Apache Soap 2.2 so long to respond? We found some previous
post
> that mentions using XML_LITERAL_ENCODING will make it faster, but since we
> are using MS SOAPtoolkit, we don't know how to sent this encoding.
>
> Any of your help will be highly appreciated.
>
> Thanks.
>
> -Chengmin


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




RE: What is the best way to send Large String from the Client to the Service?

2001-10-27 Thread Ding, Chengmin

Now I send the string from the VB client to the Apache service via Literal
encoding(change the WSDL->Operation->Use from encoded to literal ). At the
service side, I changed the DeploymentDescriptor to use the
XMLParameterSerializer to be the deserializer of the large input String
parameter s4(pls see below). 
In order to use the XMLParameterSerializer , I changed the Java function's
input parameter to "Parameter" type(otherwise I would receive a "signature
type not match" if I still use String type). I then tried to cast this
"Parameter" back to a string but somehow the "Parameter" the java function
received from the SOAP layer is always NULL. Could anyone tell what might be
wrong?

I am now at my wit's end and any of your help is highly appreciated.

Thank you in advance.

-Chengmin


===
http://xml.apache.org/xml-soap/deployment";
id="urn:sendvis-service">




http://schemas.xmlsoap.org/soap/encoding/";
xmlns:x="urn:sendvis-service" qname="x:s"
xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
http://schemas.xmlsoap.org/soap/encoding/";
xmlns:x="urn:sendvis-service" qname="x:s1"
xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
http://schemas.xmlsoap.org/soap/encoding/";
xmlns:x="urn:sendvis-service" qname="x:s2"
xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
http://schemas.xmlsoap.org/soap/encoding/";
xmlns:x="urn:sendvis-service" qname="x:s3"
xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
http://schemas.xmlsoap.org/soap/encoding/";
xmlns:x="urn:sendvis-service"  qname="x:s4"
xml2JavaClassName="org.apache.soap.encoding.literalxml.XMLParameterSerialize
r"/>
http://schemas.xmlsoap.org/soap/encoding/"; xmlns:x=""
qname="x:strings"
xml2JavaClassName="org.apache.soap.encoding.soapenc.ArraySerializer"/>


org.apache.soap.server.DOMFaultListener


-Original Message-
From: Barnaby James [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 25, 2001 6:56 PM
To: [EMAIL PROTECTED]
Subject: RE: What is the best way to send Large String from the Client
to the Service?


Did you try sending it as a data base64 encoded parameter rather than a
string? i.e. a parameter of xsi:type="SOAP-ENC:base64"? I would think this
would be handled more efficiently than an xsi:type="xsd:string" parameter.
If your class on the Apache SOAP side is byte[] it will be automagically
converted to SOAP-ENC:base64.

Barnaby

-Original Message-
From: Paramdeep Singh [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 25, 2001 3:13 AM
To: [EMAIL PROTECTED]
Subject: Re: What is the best way to send Large String from the Client
to the Service?


Hi,

I think that if the size of the string is too large, then you should send it
as an attachment.

I remember of seeing an article somewhere, which mentioned that if the
string that you are sending is of a very large length, then it may not get
the correct results as well. I think that I read it on this mailing list
only, but cant remember it off-hand.

Regards
Paramdeep


- Original Message -
From: "Ding, Chengmin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 25, 2001 2:05 AM
Subject: What is the best way to send Large String from the Client to the
Service?


> HI, Soap folks,
>   Our web service is based on Apache Soap 2.2 and the web service client
is
> based on Microsoft Soap Tool kit 2.0.
> The client periodically sends an XML String as one of an array parameter
to
> the web service and the web service will do some manipulations of that
> string. The input string used to be below 100 KB and the performance is
> satisfactory. Recently the input XML string increases to around 1 MB and
the
> web service starts to respond extremely slow.
> We put some output statement at the beginning of the web service function,
> now it takes about 15 minutes before we see those output. We want to know
> why it takes Apache Soap 2.2 so long to respond? We found some previous
post
> that mentions using XML_LITERAL_ENCODING will make it faster, but since we
> are using MS SOAPtoolkit, we don't know how to sent this encoding.
>
> Any of your help will be highly appreciated.
>
> Thanks.
>
> -Chengmin


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



RE: Deploying Apache SOAP on Tomcat....!

2001-10-27 Thread venkat reddy



Hi Mahender,
 Have you registered 
the RPCRouterServlet with the tomcat servlet engine?
 
Try that. ~Venkat Reddy

  -Original Message-From: mahender reddy G 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, October 18, 
  2001 5:06 AMTo: [EMAIL PROTECTED]Subject: 
  Deploying Apache SOAP on Tomcat!
   
  
  Hello All
   
  I am installing apache SOAP on Tomcat by (method 2 defined in istall 
  guide) Creating a new  in Tomcat 's server.xml file, adding 
  soap.jar file and samples to CLASSPATH. But  i am getting error 
  
  A Servlet Exception Has Occurred
  Exception Report:javax.servlet.ServletException: org/apache/soap/server/ServiceManager
	at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
	
while running the Apache SOAP Admin.
  and when deploy using first method(placing soap.war in tomcat weapps 
  directory iam able to run sucessfully..any body help out...
   
  Thanks in advance 
  G 
  Mahender ReddyVisual Quest India   


RE: Serializers/Deserializers

2001-10-27 Thread Rajasekhar


Hi,

Why aren't you using the Serializer you have written to serialize your
class. I don't see the line below in your DD.

java2XMLClassName="examples.omnitide.SimpleURLService.URLSerializer"/>

Any specific reason?

- Raj.



> -Original Message-
> From: David Turner [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 25, 2001 10:12 AM
> To: [EMAIL PROTECTED]
> Subject: Serializers/Deserializers
>
>
> Has anyone developed their own serializers & deserializers for their
> classes instead of using the BeanSerializer?
>
> I've attempted to write my own serializer/deserializer for the
> java.net.URL class in order to pass URL's to my service method, but the
> server sends back a fault:
>   Fault Code = SOAP-ENV:Server.Exception:
>   Fault String = org/apache/soap/util/xml/Deserializer
>
> I've attempted to write serializers/deserializers for a simple class
> also (class contains only Strings) instead of the BeanSerializer and I
> still get the above exception.
>
> Anybody know what's going wroing?  How do you set this up on both the
> client and server (deployment descr)?
>
> Below is the code:
>
> Deployment Descriptor
> --
> 
>
> http://xml.apache.org/xml-soap/deployment";
>  id="urn:SimpleURLService">
>scope="Session"
> methods="serviceMethod">
>  class="examples.omnitide.SimpleURLService.SimpleURLService"
> static="false"/>
>   
>
>
> org.apache.soap.server.DOMFaultListener
>
>   
> http://schemas.xmlsoap.org/soap/encoding/";
>  xmlns:xsd="http://www.w3.org/1999/XMLSchema";
> qname="xsd:URL"
>  javaType="java.net.URL"
>
> xml2JavaClassName="examples.omnitide.SimpleURLService.URLDeserializer"/>
>
>   
>
> 
>
>
>
> Client that calls soap service
> --
> 
>
>   // Map the types
>SOAPMappingRegistry smr = new SOAPMappingRegistry();
>
>URLSerializer ser = new URLSerializer();
>URLDeserializer des = new URLDeserializer();
>
>smr.mapTypes(Constants.NS_URI_SOAP_ENC, new
> QName("urn:SimpleURLService", "URL"),
>URL.class, ser, des);
>
>// Build the call
>Call call = new Call();
>call.setSOAPMappingRegistry(smr);
>call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
>call.setTargetObjectURI("urn:SimpleURLService");
>call.setMethodName("serviceMethod");
>
>Vector params = new Vector();
>params.addElement(new Parameter("request", URL.class, url,
> null));
>call.setParams(params);
>
>
>
> Serializer
> --
> 
>
> import java.net.URL;
>
> public class URLSerializer implements Serializer
> {
>
>   public void marshall(String inScopeEncStyle, Class javaType, Object
> src,
>Object context, Writer sink, NSStack nsStack,
>XMLJavaMappingRegistry xjmr, SOAPContext ctx)
> throws IllegalArgumentException, IOException
>   {
>   nsStack.pushScope();
>
>   SoapEncUtils.generateStructureHeader(inScopeEncStyle, javaType,
> context,
>   sink, nsStack, xjmr);
>
>   sink.write(StringUtils.lineSeparator);
>
>   URL src2 = (URL) src;
>
>   Parameter param;
>
>   param = new Parameter("URL", String.class, src2.toString(), null);
>
>   xjmr.marshall(inScopeEncStyle, Parameter.class, param, null,
> sink, nsStack, ctx);
>   sink.write(StringUtils.lineSeparator);
>
>   sink.write("");
>
>   nsStack.popScope();
>   }
> }
>
>
>
> Deserializer
> --
> 
>
> public class URLDeserializer implements Deserializer
> {
>   public Bean unmarshall(String inScopeEncStyle, QName elementType, Node
> src,
>  XMLJavaMappingRegistry xjmr, SOAPContext ctx)
>   throws IllegalArgumentException
>   {
> Element root = (Element)src;
> Element tempEl = DOMUtils.getFirstChildElement(root);
>
> URL url = null;
>
> while (tempEl != null)
> {
> Bean paramBean = xjmr.unmarshall(inScopeEncStyle,
> RPCConstants.Q_ELEM_PARAMETER,
>  tempEl, ctx);
> Parameter param = (Parameter)paramBean.value;
> String tagName = tempEl.getTagName();
>
> if (tagName.equals("URL"))
> {
> try
> {
> url = new URL( (String)param.getValue() );
> }
> catch (Exception e)
> {
> throw new IllegalArgumentException("Problem
> instantianting bean: " + e.getMessage()