Hallo,
I proceed further with this.
I downloaded last nightly build 2004-04-07 (the same version 2.3.1 -:(  )
and what ?

Hurrah !!
xsi:type="xsd:base64Binary">AFQAAQEMAAAAAQAAAAEAAAABLJcAAOhnAADoZgAEAAQAAAAA
AAAAAAAAAAAAAAAAAAAAAAEquEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6GYCABzDAAA=</obsah>
</ns1:VlozFotoAuto>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response from server is OK

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
 xmlns:xsd="http://www.w3.org/2001/XMLSchema";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
<SOAP-ENV:Body>

<SOAP-ENV:Fault>
<faultcode xsi:type="xsd:QName">SOAP-ENV:Client</faultcode>
<faultstring xsi:type="xsd:string">[20] Auto ID=20791
nenalezeno</faultstring>
<faultactor xsi:type="xsd:anyURI"></faultactor>
<detail xsi:type="xsd:string"></detail></SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This meen that i call a car on server, that not exists.

I was excited, but now my klient fault with:

[SOAPException: faultCode=SOAP-ENV:Client; msg=Parsing error, response was:
Start of root element expected.;
targetException=oracle.xml.parser.v2.XMLParseException: Start of root
element expected.] 
at org.apache.soap.rpc.Call.invoke(Unknown Source)      
at org.apache.soap.rpc.Call.invoke(Unknown Source)      
at
gedas.DMS.AutoPlus.AutoplusServiceStub.VlozFotoAuto(AutoplusServiceStub.java
:241)   
at gedas.DMS.AutoPlus.SQLWrap.VlozFotoAuto(SQLWrap.sqlj:166)    
at gedas.DMS.AutoPlus.SQLWrap.main(SQLWrap.sqlj:14) Caused by:
oracle.xml.parser.v2.XMLParseException: Start of root element expected.

at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:205)        
at
oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParse
r.java:299)     
at
oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.j
ava:261)        
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:147)     
at oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:150)  
at org.apache.soap.util.xml.XMLParserUtils.parse(Unknown Source)        
at org.apache.soap.util.xml.XMLParserUtils.parse(Unknown Source)        
at org.apache.soap.rpc.Call.invoke(Unknown Source)      
at org.apache.soap.rpc.Call.invoke(Unknown Source)      
at
gedas.DMS.AutoPlus.AutoplusServiceStub.VlozFotoAuto(AutoplusServiceStub.java
:241)   
at gedas.DMS.AutoPlus.SQLWrap.VlozFotoAuto(SQLWrap.sqlj:166)    
at gedas.DMS.AutoPlus.SQLWrap.main(SQLWrap.sqlj:14) Exception in thread
"main" 
Process exited with exit code 1.

This is like error from beginning of my experimentation.

And with this exception stop now all methods, including these, what already
was running.

Why ?
Is it som problem with parser, or something others ?
I would like to test write my own serializer, but i am afraid that this will
not help me.

Pavel


> -----Původní zpráva-----
> Od:   Pospisil, Pavel [SMTP:[EMAIL PROTECTED]
> Odesláno:     29. dubna 2004 14:15
> Komu: [EMAIL PROTECTED]
> Předmět:      RE: How to send Byte[] as Base64Binary and not Array Type
> with SO AP 2.3.1
> 
> Thank You,
> yes, this was my mistake
> I forgot to change 
> 
>  params.addElement(new Parameter("obsah", java.lang.Byte[].class, obsah,
> null));
> now is it 
>  params.addElement(new Parameter("obsah", byte[].class, obsah, null));
> 
> The result is better, but gives
> <obsah xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/";
> xsi:type="ns2:base64">AFQAAQEMAAAAAQAAAAEAAAABLJcAAOhnAADoZgAEAAQAAAAAAAAA
> AA
> AAAAAAAAAAAAAAAAEquEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6GYCABzDAAA=</obsah>
> 
> And server continue to returning
> <SOAP-ENV:Fault>
> <faultcode xsi:type="xsd:QName">SOAP-ENV:Client</faultcode>
> <faultstring xsi:type="xsd:string">soap request contained mismatching
> parameters of name obsah had type [base64], which did not match
> signature's
> type: [base64Binary], matched? 6</faultstring>
> <faultactor xsi:type="xsd:anyURI"></faultactor>
> <detail xsi:type="xsd:string"></detail></SOAP-ENV:Fault>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
> 
> Why ? I am using 2.3.1 compiled pack (downloaded 2004/03/23)
> 
> Would be the way with own serializer better ?
> Can You direct me to some resources about write my own Serializer ?
> 
> I am nervous, because deadline is near.
> 
> Pavel
> 
> 
> > -----Původní zpráva-----
> > Od: Scott Nichol [SMTP:[EMAIL PROTECTED]
> > Odesláno:   28. dubna 2004 18:15
> > Komu:       [EMAIL PROTECTED]
> > Předmět:    Re: How to send Byte[] as Base64Binary and not Array Type
> > with SOAP 2.3.1
> > 
> > Among other things, did you change
> > 
> >  public String VlozFotoAuto(AuthData authData, Integer autoPlusId,
> Byte[]
> > obsah) throws Exception
> > 
> > and
> > 
> >  params.addElement(new Parameter("obsah", java.lang.Byte[].class, obsah,
> > null));
> > 
> > changing Byte[] to byte[] both places?
> > 
> > Note that what you lose is the ability to have an array element that is
> > null: a Byte can be null, but a byte cannot.
> > 
> > Scott Nichol
> > 
> > Do not send e-mail directly to this e-mail address,
> > because it is filtered to accept only mail from
> > specific mail lists.
> > ----- Original Message ----- 
> > From: "Pospisil, Pavel" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, April 28, 2004 11:38 AM
> > Subject: RE: How to send Byte[] as Base64Binary and not Array Type with
> > SOAP 2.3.1
> > 
> > 
> > Hallo,
> > thank You for Your answer.
> > 
> > I have no experience with write my own serializer
> > so I tried Your solution nr. 1, (change Byte[] to byte[]) but no
> success.
> > My client standing generate 
> > .....
> > <obsah xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/";
> > xsi:type="ns2:Array" ns2:arrayType="xsd:byte[116]">
> > <item xsi:type="xsd:byte">65</item>
> > <item xsi:type="xsd:byte">70</item>
> > ...
> > 
> > I tried:
> > 
> > BeanSerializer beanSer = new BeanSerializer();
> > m_smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("urn:Autoplus",
> > "FotoAuto"), FotoAuto.class, beanSer, beanSer);
> > 
> > Base64Serializer b64Ser = new Base64Serializer();    
> > m_smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("urn:Autoplus",
> > "FotoAuto"), FotoAuto.class, b64Ser, b64Ser);
> > 
> > but the result is the same.
> > 
> > What now ?
> > Pavel
> > 
> > > -----Původní zpráva-----
> > > Od: Scott Nichol [SMTP:[EMAIL PROTECTED]
> > > Odesláno: 27. dubna 2004 19:16
> > > Komu: [EMAIL PROTECTED]
> > > Předmět: Re: How to send Byte[] as Base64Binary and not Array Type
> > > with SOAP 2.3.1
> > > Důležitost: Malá
> > > 
> > > You have 2 choices
> > > 
> > > 1. Change your code to use byte[] instead of Byte[].
> > > 
> > > 2. Write your own serializer and de-serializer for Byte[] and register
> > it.
> > > The serializer would probably convert Byte[] to byte[] and delegate to
> > the
> > > Base64Serializer.  The deserializer would do the opposite: delegate to
> > > Base64Deserializer then convert byte[] to Byte[].
> > > 
> > > Scott Nichol
> > > 
> > > Do not send e-mail directly to this e-mail address,
> > > because it is filtered to accept only mail from
> > > specific mail lists.
> > > 
> > > ----- Original Message ----- 
> > > From: "Pospisil, Pavel" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, April 27, 2004 12:08 PM
> > > Subject: How to send Byte[] as Base64Binary and not Array Type with
> SOAP
> > > 2.3.1
> > > 
> > > 
> > > Hallo,
> > > i am trying to write SOAP Client with ORACLE JDeveloper and Apache
> 2.3.1
> > > from WSDL with some user types.
> > > 
> > > JDeveloper generated some code for me (service has more methods, this
> is
> > > only snippet)
> > > .....
> > > /**
> > >  * Generated by the Oracle9i JDeveloper Web Services Stub/Skeleton
> > > Generator.
> > >  * Date Created: Thu Mar 18 18:09:08 CET 2004
> > >  * 
> > >  * <pre>
> > >  * &lt;complexType name="FotoAuto">
> > >  * &lt;all>
> > >  * &lt;element name="fotoId" type="xsd:string"/>
> > >  * &lt;element name="url" type="xsd:string"/>
> > >  * &lt;element name="obsah" type="xsd:base64Binary"/>
> > >  * &lt;/all>
> > >  * &lt;/complexType>
> > >  * </pre>
> > >  */
> > > 
> > > public class FotoAuto 
> > > {
> > >   private String m_fotoId;
> > >   private String m_url;
> > >   private Byte[] m_obsah;
> > >   public FotoAuto()
> > >   {
> > >   }
> > > 
> > >   public FotoAuto(String fotoId, String url, Byte[] obsah)
> > >   {
> > >     m_fotoId = fotoId;
> > >     m_url = url;
> > >     m_obsah = obsah;
> > >   }
> > > 
> > > }
> > > 
> > > import org.apache.soap.transport.http.SOAPHTTPConnection;
> > > import org.apache.soap.encoding.soapenc.BeanSerializer;
> > > import org.apache.soap.encoding.soapenc.Base64Serializer;
> > > import org.apache.soap.encoding.SOAPMappingRegistry;
> > > import org.apache.soap.util.xml.QName;
> > > import java.net.*;
> > > import java.net.URL.*;
> > > import java.util.Vector;
> > > import java.util.Properties;
> > > import org.apache.soap.Constants;
> > > import org.apache.soap.Fault;
> > > import org.apache.soap.SOAPException;
> > > import org.apache.soap.rpc.Call;
> > > import org.apache.soap.rpc.Parameter;
> > > import org.apache.soap.rpc.Response;
> > > 
> > > import FotoAuto;
> > > import com.sun.net.ssl.*;
> > > import javax.net.ssl.*;
> > > import java.security.*;
> > > import java.security.cert.*;
> > > import HTTPClient.*;
> > > import java.io.*;
> > > 
> > > public class AutoplusServiceStub 
> > > {
> > >   public String endpoint =
> "http://www.auto-plus.cz/services/index.php";;
> > > //  private static OracleSOAPHTTPConnection m_httpConnection = null;
> > > //  private static SOAPHTTPConnection m_httpConnection = null;
> > >   private TrustfulSOAPHTTPConnection m_httpConnection = null;
> > >   private SOAPMappingRegistry m_smr = null;
> > > 
> > >   public AutoplusServiceStub()
> > >   {
> > > 
> > >     System.setProperty("java.protocol.handler.pkgs","HTTPClient");
> > >     Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
> > 
> > > 
> > >     m_httpConnection = new TrustfulSOAPHTTPConnection();
> > >     m_smr = new SOAPMappingRegistry();
> > >     m_httpConnection.setProxyHost("127.0.0.1");
> > >     m_httpConnection.setProxyPort(5865);
> > > 
> > >     BeanSerializer beanSer = new BeanSerializer();
> > > //    Base64Serializer b64Ser = new Base64Serializer();    
> > >     m_smr.mapTypes(Constants.NS_URI_SOAP_ENC, new
> QName("urn:Autoplus",
> > > "FotoAuto"), FotoAuto.class, beanSer, beanSer);
> > > //    m_smr.mapTypes(Constants.NS_URI_SOAP_ENC, new
> > QName("urn:Autoplus",
> > > "FotoAuto"), FotoAuto.class, b64Ser, b64Ser);
> > >   }
> > > 
> > > 
> > >   public String VlozFotoAuto(AuthData authData, Integer autoPlusId,
> > Byte[]
> > > obsah) throws Exception
> > >   {
> > >     String returnVal = null;
> > > 
> > >     URL endpointURL = new URL(endpoint);
> > >     Call call = new Call();
> > >     call.setSOAPTransport(m_httpConnection);
> > >     call.setTargetObjectURI("urn:Autoplus");
> > >     call.setMethodName("VlozFotoAuto");
> > >     call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
> > > 
> > >     Vector params = new Vector();
> > >     params.addElement(new Parameter("authData",
> > > gedas.DMS.AutoPlus.AuthData.class, authData, null));
> > >     params.addElement(new Parameter("autoPlusId",
> > java.lang.Integer.class,
> > > autoPlusId, null));
> > >     params.addElement(new Parameter("obsah", java.lang.Byte[].class,
> > > obsah,
> > > null));
> > >     call.setParams(params);
> > > 
> > >     call.setSOAPMappingRegistry(m_smr);
> > > 
> > >     Response response = call.invoke(endpointURL,
> > > "urn:Autoplus#ws_autoplus#VlozFotoAuto");
> > > 
> > >     if (!response.generatedFault())
> > >     {
> > >       Parameter result = response.getReturnValue();
> > >       returnVal = (String)result.getValue();
> > >     }
> > >     else
> > >     {
> > >       Fault fault = response.getFault();
> > >       throw new SOAPException(fault.getFaultCode(),
> > > fault.getFaultString());
> > >     }
> > > 
> > >     return returnVal;
> > >   }
> > > }
> > > 
> > > So, most of methods are running ok, but when i try use this
> > (VlozFotoAuto)
> > > my request is generated as:
> > > <SOAP-ENV:Envelope
> > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
> > > <SOAP-ENV:Body>
> > > <ns1:VlozFotoAuto xmlns:ns1="urn:Autoplus"
> > > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
> > > <authData xsi:type="ns1:AuthData">
> > > <login xsi:type="xsd:string">login</login>
> > > <password xsi:type="xsd:string">passw</password>
> > > </authData>
> > > <autoPlusId xsi:type="xsd:int">20791</autoPlusId>
> > > <obsah xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/";
> > > xsi:type="ns2:Array" ns2:arrayType="xsd:byte[116]">
> > > <item xsi:type="xsd:byte">65</item>
> > > <item xsi:type="xsd:byte">70</item>
> > > <item xsi:type="xsd:byte">81</item>
> > > .....
> > > instead of  xsi:type="xsd:base64Binary"/>
> > > Why ????
> > > 
> > > Server consequently returns:
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > 
> > > <SOAP-ENV:Envelope
> > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
> > >  xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> > >  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > >  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
> > >  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
> > > <SOAP-ENV:Body>
> > > 
> > > <SOAP-ENV:Fault>
> > > <faultcode xsi:type="xsd:QName">SOAP-ENV:Client</faultcode>
> > > <faultstring xsi:type="xsd:string">soap request contained mismatching
> > > parameters of name obsah had type [array], which did not match
> > signature's
> > > type: [base64Binary], matched? 1</faultstring>
> > > <faultactor xsi:type="xsd:anyURI"></faultactor>
> > > <detail xsi:type="xsd:string"></detail></SOAP-ENV:Fault>
> > > </SOAP-ENV:Body>
> > > </SOAP-ENV:Envelope>
> > > 
> > > And client with:
> > > [SOAPException: faultCode=SOAP-ENV:Client; msg=A
> > > &apos;http://schemas.xmlsoap.org/soap/envelope/:Fault&apos; element
> must
> > > contain a: &apos;faultcode&apos; element.;
> > > targetException=java.lang.IllegalArgumentException: A
> > > 'http://schemas.xmlsoap.org/soap/envelope/:Fault' element must contain
> > a:
> > > 'faultcode' element.] at
> org.apache.soap.rpc.Call.invoke(Call.java:294)
> > > 
> > > I am using SOAP 2.3.1
> > > 
> > > Where am I wrong ???
> > > 
> > > Thanks
> > > Pavel
> > > 

Reply via email to