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 Carlo Simbag <cs...@atinera.com.au> on 2002/11/07 23:28:47 UTC

MS SoapClient and Apache Soap Web Service

Hi there,

Has anyone successfully connected a MS Soapclient referencing a WSDL to
connect to an Apache Soap Web service that
has complexTypes?

I am getting the following error, I suspect it is to do with the schema
definition not available when you type in the URL from a browser.

Error
WSDLReader:Analyzing the WSDL file failed HRESULT=0x80004005 -
WSDLReader:Initialization of service failed HRESULT=0x80004005 -
WSDLService:Initialization of the port for service OTASoapService failed
HRESULT=0x80004005 - WSDLPort:Analyzing the binding information for port ota
failed HRESULT=0x80004005 - WSDLPort:An operation for port ota could not be
initialized HRESULT=0x80004005 - WSDLOperation:Initializing of the input
message failed for operation sessionReq HRESULT=0x80004005 -
WSDLOperation:Initialization of a SoapMapper for operation sessionReq failed
HRESULT=0x80004005 - SoapMapper:The SoapMapper for element Element could not
be created HRESULT=0x80004005 - SoapMapper:The schema definition with a
targetnamespace of http://xml.apache.org/xml-soap/ for SoapMapper Element
could not be found HRESULT=0x80004005

ASP Code

   Const WSDL_URL     = "http://168.153.3.71:7001/OTAService.wsdl"
   Const WSDL_SERVICE = "OTASoapService"
   Const WSDL_PORT    = ""
   Const WSDL_WSML    = ""

   Dim soapClient, elemList, strXmlSent, blnSentXML, strXmlReceived

   Set soapClient = CreateObject("MSSOAP.SoapClient")
   soapClient.ClientProperty("ServerHTTPRequest")= True

   soapClient.mssoapinit WSDL_URL, WSDL_SERVICE, WSDL_PORT, WSDL_WSML

WSDL file

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="urn:OTA"
                  targetNamespace="urn:OTA"
                  xmlns="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:apachesoap="http://xml.apache.org/xml-soap/"
                  xmlns:impl="urn:OTA"
                  xmlns:intf="urn:OTA"
                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                  xmlns:tns1="http://rpc.soap.apache.org"
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

   <wsdl:types>
      <schema targetNamespace="http://rpc.soap.apache.org"
xmlns="http://www.w3.org/2001/XMLSchema">
         <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
         <complexType name="SOAPContext">
            <sequence>
               <element name="rootPart" nillable="true" type="xsd:anyType"/>
               <element name="classLoader" nillable="true"
type="xsd:anyType"/>
               <element maxOccurs="unbounded" name="bodyPart"
nillable="true" type="xsd:anyType"/>
               <element name="propertyNames" nillable="true"
type="xsd:anyType"/>
               <element name="baseURI" nillable="true" type="xsd:string"/>
               <element name="count" type="xsd:int"/>
               <element name="rootPartSet" type="xsd:boolean"/>
               <element name="contentType" nillable="true"
type="xsd:string"/>
               <element name="subType" nillable="true" type="xsd:string"/>
            </sequence>
         </complexType>
         <element name="SOAPContext" nillable="true"
type="tns1:SOAPContext"/>
      </schema>

      <schema targetNamespace="http://xml.apache.org/xml-soap"
xmlns="http://www.w3.org/2001/XMLSchema">
         <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
         <element name="Element" nillable="true" type="apachesoap:Element"/>
      </schema>
   </wsdl:types>

   <wsdl:message name="sessionReqRequest">
      <wsdl:part name="cxt" type="tns1:SOAPContext"/>
      <wsdl:part name="domRequest" type="apachesoap:Element"/>
   </wsdl:message>

   <wsdl:message name="sessionReqResponse">
      <wsdl:part name="sessionReqReturn" type="apachesoap:Element"/>
   </wsdl:message>

   <wsdl:portType name="OTASoapDriver">
      <wsdl:operation name="sessionReq" parameterOrder="cxt domRequest">
         <wsdl:input message="impl:sessionReqRequest"
name="sessionReqRequest"/>
         <wsdl:output message="impl:sessionReqResponse"
name="sessionReqResponse"/>
      </wsdl:operation>
   </wsdl:portType>

   <wsdl:binding name="otaSoapBinding" type="impl:OTASoapDriver">
      <wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="sessionReq">
         <wsdlsoap:operation soapAction=""/>
         <wsdl:input name="sessionReqRequest">
            <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:OTA" use="encoded"/>
         </wsdl:input>
         <wsdl:output name="sessionReqResponse">
            <wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:OTA" use="encoded"/>
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>

   <wsdl:service name="OTASoapService">
      <wsdl:port binding="impl:otaSoapBinding" name="ota">
         <wsdlsoap:address location="http://168.153.3.71:7001/soap/ota"/>
      </wsdl:port>
   </wsdl:service>

</wsdl:definitions>
Your help will be much appreciated.

Cheers,




Carlo Simbag
Senior Analyst/Programmer
Atinera
Level 16, 40 Creek Street
Brisbane QLD 4000
Australia
Ph:  +61 (0)7 3406 1958
Fax: +61 (0)7 3406 1999

www.atinera.com
____________________________________________________________________________
_
This message (including any attachments) contains confidential information
intended for a specific individual and purpose,
and is protected by law. If you are not the intended recipient please return
it (with the subject "Received in Error") and
delete this message. Any disclosure, copying, or distribution of this
message, or the taking of any action based on it, is
strictly prohibited.


RE: MS SoapClient and Apache Soap Web Service

Posted by Carlo Simbag <cs...@atinera.com.au>.
Thanks Scott,  I'll try your suggestion.

Cheers,
Carlo

> -----Original Message-----
> From: Scott Nichol [mailto:snicholnews@scottnichol.com]
> Sent: Friday, 8 November 2002 3:08 PM
> To: soap-user@xml.apache.org
> Subject: Re: MS SoapClient and Apache Soap Web Service
> 
> 
> > Has anyone successfully connected a MS Soapclient referencing a WSDL
> to
> > connect to an Apache Soap Web service that
> > has complexTypes?
> 
> Yes, but I've only used the low level API for complex types.  See
> http://www.scottnichol.com/vbclientapachesoap.htm.
> 
> > HRESULT=0x80004005 - SoapMapper:The SoapMapper for element Element
> could not
> > be created HRESULT=0x80004005 - SoapMapper:The schema definition with
> a
> > targetnamespace of http://xml.apache.org/xml-soap/ for SoapMapper
> Element
> > could not be found HRESULT=0x80004005
> 
> This error is because your Java service method sessionReq takes an
> Element as a request parameter and as the return value.  The generated
> WSDL does not define what an Element looks like (from an XML schema
> perspective).  You would have to provide this.  If there is an actual
> structure to the XML fragment your service expects, you should define a
> Java type that reflects that structure and generate WSDL for the method.
> 
> > WSDL file
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <wsdl:definitions name="urn:OTA"
> >                   targetNamespace="urn:OTA"
> >                   xmlns="http://schemas.xmlsoap.org/wsdl/"
> >                   xmlns:apachesoap="http://xml.apache.org/xml-soap/"
> >                   xmlns:impl="urn:OTA"
> >                   xmlns:intf="urn:OTA"
> >
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> >                   xmlns:tns1="http://rpc.soap.apache.org"
> >                   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> >
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> >                   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >
> >    <wsdl:types>
> >       <schema targetNamespace="http://rpc.soap.apache.org"
> > xmlns="http://www.w3.org/2001/XMLSchema">
> >          <import
> namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> >          <complexType name="SOAPContext">
> >             <sequence>
> >                <element name="rootPart" nillable="true"
> type="xsd:anyType"/>
> >                <element name="classLoader" nillable="true"
> > type="xsd:anyType"/>
> >                <element maxOccurs="unbounded" name="bodyPart"
> > nillable="true" type="xsd:anyType"/>
> >                <element name="propertyNames" nillable="true"
> > type="xsd:anyType"/>
> >                <element name="baseURI" nillable="true"
> type="xsd:string"/>
> >                <element name="count" type="xsd:int"/>
> >                <element name="rootPartSet" type="xsd:boolean"/>
> >                <element name="contentType" nillable="true"
> > type="xsd:string"/>
> >                <element name="subType" nillable="true"
> type="xsd:string"/>
> >             </sequence>
> >          </complexType>
> >          <element name="SOAPContext" nillable="true"
> > type="tns1:SOAPContext"/>
> >       </schema>
> >
> >       <schema targetNamespace="http://xml.apache.org/xml-soap"
> > xmlns="http://www.w3.org/2001/XMLSchema">
> >          <import
> namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> >          <element name="Element" nillable="true"
> type="apachesoap:Element"/>
> >       </schema>
> >    </wsdl:types>
> >
> >    <wsdl:message name="sessionReqRequest">
> >       <wsdl:part name="cxt" type="tns1:SOAPContext"/>
> >       <wsdl:part name="domRequest" type="apachesoap:Element"/>
> >    </wsdl:message>
> 
> You need to edit the WSDL to remove the SOAPContext parameter.  This is
> *not* a parameter transmitted as part of the SOAP request.  It is
> provided internally through an Apache SOAP mechanism.
> 
> Scott Nichol
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
> 
> 

RE: MS SoapClient and Apache Soap Web Service

Posted by Carlo Simbag <cs...@atinera.com.au>.
Thanks Scott,  I'll try your suggestion.

Cheers,
Carlo

> -----Original Message-----
> From: Scott Nichol [mailto:snicholnews@scottnichol.com]
> Sent: Friday, 8 November 2002 3:08 PM
> To: soap-user@xml.apache.org
> Subject: Re: MS SoapClient and Apache Soap Web Service
> 
> 
> > Has anyone successfully connected a MS Soapclient referencing a WSDL
> to
> > connect to an Apache Soap Web service that
> > has complexTypes?
> 
> Yes, but I've only used the low level API for complex types.  See
> http://www.scottnichol.com/vbclientapachesoap.htm.
> 
> > HRESULT=0x80004005 - SoapMapper:The SoapMapper for element Element
> could not
> > be created HRESULT=0x80004005 - SoapMapper:The schema definition with
> a
> > targetnamespace of http://xml.apache.org/xml-soap/ for SoapMapper
> Element
> > could not be found HRESULT=0x80004005
> 
> This error is because your Java service method sessionReq takes an
> Element as a request parameter and as the return value.  The generated
> WSDL does not define what an Element looks like (from an XML schema
> perspective).  You would have to provide this.  If there is an actual
> structure to the XML fragment your service expects, you should define a
> Java type that reflects that structure and generate WSDL for the method.
> 
> > WSDL file
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <wsdl:definitions name="urn:OTA"
> >                   targetNamespace="urn:OTA"
> >                   xmlns="http://schemas.xmlsoap.org/wsdl/"
> >                   xmlns:apachesoap="http://xml.apache.org/xml-soap/"
> >                   xmlns:impl="urn:OTA"
> >                   xmlns:intf="urn:OTA"
> >
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> >                   xmlns:tns1="http://rpc.soap.apache.org"
> >                   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> >
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> >                   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >
> >    <wsdl:types>
> >       <schema targetNamespace="http://rpc.soap.apache.org"
> > xmlns="http://www.w3.org/2001/XMLSchema">
> >          <import
> namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> >          <complexType name="SOAPContext">
> >             <sequence>
> >                <element name="rootPart" nillable="true"
> type="xsd:anyType"/>
> >                <element name="classLoader" nillable="true"
> > type="xsd:anyType"/>
> >                <element maxOccurs="unbounded" name="bodyPart"
> > nillable="true" type="xsd:anyType"/>
> >                <element name="propertyNames" nillable="true"
> > type="xsd:anyType"/>
> >                <element name="baseURI" nillable="true"
> type="xsd:string"/>
> >                <element name="count" type="xsd:int"/>
> >                <element name="rootPartSet" type="xsd:boolean"/>
> >                <element name="contentType" nillable="true"
> > type="xsd:string"/>
> >                <element name="subType" nillable="true"
> type="xsd:string"/>
> >             </sequence>
> >          </complexType>
> >          <element name="SOAPContext" nillable="true"
> > type="tns1:SOAPContext"/>
> >       </schema>
> >
> >       <schema targetNamespace="http://xml.apache.org/xml-soap"
> > xmlns="http://www.w3.org/2001/XMLSchema">
> >          <import
> namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> >          <element name="Element" nillable="true"
> type="apachesoap:Element"/>
> >       </schema>
> >    </wsdl:types>
> >
> >    <wsdl:message name="sessionReqRequest">
> >       <wsdl:part name="cxt" type="tns1:SOAPContext"/>
> >       <wsdl:part name="domRequest" type="apachesoap:Element"/>
> >    </wsdl:message>
> 
> You need to edit the WSDL to remove the SOAPContext parameter.  This is
> *not* a parameter transmitted as part of the SOAP request.  It is
> provided internally through an Apache SOAP mechanism.
> 
> Scott Nichol
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: MS SoapClient and Apache Soap Web Service

Posted by Scott Nichol <sn...@scottnichol.com>.
> Has anyone successfully connected a MS Soapclient referencing a WSDL
to
> connect to an Apache Soap Web service that
> has complexTypes?

Yes, but I've only used the low level API for complex types.  See
http://www.scottnichol.com/vbclientapachesoap.htm.

> HRESULT=0x80004005 - SoapMapper:The SoapMapper for element Element
could not
> be created HRESULT=0x80004005 - SoapMapper:The schema definition with
a
> targetnamespace of http://xml.apache.org/xml-soap/ for SoapMapper
Element
> could not be found HRESULT=0x80004005

This error is because your Java service method sessionReq takes an
Element as a request parameter and as the return value.  The generated
WSDL does not define what an Element looks like (from an XML schema
perspective).  You would have to provide this.  If there is an actual
structure to the XML fragment your service expects, you should define a
Java type that reflects that structure and generate WSDL for the method.

> WSDL file
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions name="urn:OTA"
>                   targetNamespace="urn:OTA"
>                   xmlns="http://schemas.xmlsoap.org/wsdl/"
>                   xmlns:apachesoap="http://xml.apache.org/xml-soap/"
>                   xmlns:impl="urn:OTA"
>                   xmlns:intf="urn:OTA"
>
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>                   xmlns:tns1="http://rpc.soap.apache.org"
>                   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>                   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>
>    <wsdl:types>
>       <schema targetNamespace="http://rpc.soap.apache.org"
> xmlns="http://www.w3.org/2001/XMLSchema">
>          <import
namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>          <complexType name="SOAPContext">
>             <sequence>
>                <element name="rootPart" nillable="true"
type="xsd:anyType"/>
>                <element name="classLoader" nillable="true"
> type="xsd:anyType"/>
>                <element maxOccurs="unbounded" name="bodyPart"
> nillable="true" type="xsd:anyType"/>
>                <element name="propertyNames" nillable="true"
> type="xsd:anyType"/>
>                <element name="baseURI" nillable="true"
type="xsd:string"/>
>                <element name="count" type="xsd:int"/>
>                <element name="rootPartSet" type="xsd:boolean"/>
>                <element name="contentType" nillable="true"
> type="xsd:string"/>
>                <element name="subType" nillable="true"
type="xsd:string"/>
>             </sequence>
>          </complexType>
>          <element name="SOAPContext" nillable="true"
> type="tns1:SOAPContext"/>
>       </schema>
>
>       <schema targetNamespace="http://xml.apache.org/xml-soap"
> xmlns="http://www.w3.org/2001/XMLSchema">
>          <import
namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>          <element name="Element" nillable="true"
type="apachesoap:Element"/>
>       </schema>
>    </wsdl:types>
>
>    <wsdl:message name="sessionReqRequest">
>       <wsdl:part name="cxt" type="tns1:SOAPContext"/>
>       <wsdl:part name="domRequest" type="apachesoap:Element"/>
>    </wsdl:message>

You need to edit the WSDL to remove the SOAPContext parameter.  This is
*not* a parameter transmitted as part of the SOAP request.  It is
provided internally through an Apache SOAP mechanism.

Scott Nichol


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: MS SoapClient and Apache Soap Web Service

Posted by Scott Nichol <sn...@scottnichol.com>.
> Has anyone successfully connected a MS Soapclient referencing a WSDL
to
> connect to an Apache Soap Web service that
> has complexTypes?

Yes, but I've only used the low level API for complex types.  See
http://www.scottnichol.com/vbclientapachesoap.htm.

> HRESULT=0x80004005 - SoapMapper:The SoapMapper for element Element
could not
> be created HRESULT=0x80004005 - SoapMapper:The schema definition with
a
> targetnamespace of http://xml.apache.org/xml-soap/ for SoapMapper
Element
> could not be found HRESULT=0x80004005

This error is because your Java service method sessionReq takes an
Element as a request parameter and as the return value.  The generated
WSDL does not define what an Element looks like (from an XML schema
perspective).  You would have to provide this.  If there is an actual
structure to the XML fragment your service expects, you should define a
Java type that reflects that structure and generate WSDL for the method.

> WSDL file
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions name="urn:OTA"
>                   targetNamespace="urn:OTA"
>                   xmlns="http://schemas.xmlsoap.org/wsdl/"
>                   xmlns:apachesoap="http://xml.apache.org/xml-soap/"
>                   xmlns:impl="urn:OTA"
>                   xmlns:intf="urn:OTA"
>
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>                   xmlns:tns1="http://rpc.soap.apache.org"
>                   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>                   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>
>    <wsdl:types>
>       <schema targetNamespace="http://rpc.soap.apache.org"
> xmlns="http://www.w3.org/2001/XMLSchema">
>          <import
namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>          <complexType name="SOAPContext">
>             <sequence>
>                <element name="rootPart" nillable="true"
type="xsd:anyType"/>
>                <element name="classLoader" nillable="true"
> type="xsd:anyType"/>
>                <element maxOccurs="unbounded" name="bodyPart"
> nillable="true" type="xsd:anyType"/>
>                <element name="propertyNames" nillable="true"
> type="xsd:anyType"/>
>                <element name="baseURI" nillable="true"
type="xsd:string"/>
>                <element name="count" type="xsd:int"/>
>                <element name="rootPartSet" type="xsd:boolean"/>
>                <element name="contentType" nillable="true"
> type="xsd:string"/>
>                <element name="subType" nillable="true"
type="xsd:string"/>
>             </sequence>
>          </complexType>
>          <element name="SOAPContext" nillable="true"
> type="tns1:SOAPContext"/>
>       </schema>
>
>       <schema targetNamespace="http://xml.apache.org/xml-soap"
> xmlns="http://www.w3.org/2001/XMLSchema">
>          <import
namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>          <element name="Element" nillable="true"
type="apachesoap:Element"/>
>       </schema>
>    </wsdl:types>
>
>    <wsdl:message name="sessionReqRequest">
>       <wsdl:part name="cxt" type="tns1:SOAPContext"/>
>       <wsdl:part name="domRequest" type="apachesoap:Element"/>
>    </wsdl:message>

You need to edit the WSDL to remove the SOAPContext parameter.  This is
*not* a parameter transmitted as part of the SOAP request.  It is
provided internally through an Apache SOAP mechanism.

Scott Nichol