Try adding elementFormDefault="qualified" to your schema.

Anne

On 12/13/05, Clarence Dahlin <[EMAIL PROTECTED]> wrote:
Hi,

I just don't seem to get past this problem I have with getting a .NET C++ client to work with an Axis Service.
Axis Client and Axis Service works fine, and .NET C++ and .NET Service works fine.

I have also been able to use IONA Artix C++ client with the Axis Service.

My complex WSDL didn't work with .NET so I tried with a simple HelloWorld WSDL and service instead, but with no luck. I'll include code at the bottom of this message. Excuse me for inlcuding so much code, but I don't know how else to explain the conditions.

The thing is that the response I get from Axis seems to be correct but I'm not able to use the response in .NET C++ client. I used the automatic Web Reference tool to create proxy for the client. When I call the helloservice, my HRESULT value is set to E_FAIL.

I've used the same C++ client code (almost anyway) to call a .NET service and it worked.

If anyone could help me with this and tell me what I'm doing wrong, I'd be extremely grateful.

It is a document/literal wrapped service.
Microsoft .NET 2003 Architect
Apache Axis 1.2

Would could be the problem?

##############################################################################
WSDL
##############################################################################
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsprti="wsprti.pit.se" targetNamespace="wsprti.pit.se" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 
   <wsdl:types>
    <xsd:schema targetNamespace="wsprti.pit.se">
      <xsd:element name="hello">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element minOccurs="0" maxOccurs="1" name="helloreq" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
    
    <xsd:element name="helloResponse">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element minOccurs="0" maxOccurs="1" name="helloresp" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </wsdl:types>
    
    <wsdl:message name="helloRequest">
        <wsdl:part name="parameters" element="wsprti:hello"/>
    </wsdl:message>
    <wsdl:message name="helloResponse">
        <wsdl:part name="parameters" element="wsprti:helloResponse"/>
    </wsdl:message>
      
    <wsdl:portType name="HelloServicePortTypes">
    <wsdl:operation name="hello">
      <wsdl:input name="helloRequest" message="wsprti:helloRequest"/>
      <wsdl:output name="helloResponse" message="wsprti:helloResponse"/>
    </wsdl:operation>
    </wsdl:portType>

    <wsdl:binding name="HelloServiceBinding" type="wsprti:HelloServicePortTypes">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/ >
    <wsdl:operation name="hello">
      <soap:operation soapAction="hello" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    
    <wsdl:service name="HelloService">
        <wsdl:port name="Hello" binding="wsprti:HelloServiceBinding">
            <soap:address location="http://enterprise:8383/axis/services/HelloService"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

##############################################################################
The Request
##############################################################################
POST /axis/services/HelloService HTTP/1.1
Content-Length: 337
Content-Type: text/xml; charset=utf-8
SOAPAction: "hello"
Accept: text/xml
Host: enterprise
User-Agent: Microsoft-ATL-Native/7.00

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Body>
<hello xmlns="wsprti.pit.se">
<helloreq>Hello</helloreq>
</hello>
</soap:Body>
</soap:Envelope>

##############################################################################
The Response
##############################################################################
HTTP/1.1 200 OK
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Tue, 13 Dec 2005 14:28:41 GMT
Server: Apache-Coyote/1.1

165
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<helloResponse xmlns="wsprti.pit.se">
<helloReturn>Hello Clarence</helloReturn>
</helloResponse>
</soapenv:Body>
</soapenv:Envelope>
0


##############################################################################
C++ Client Code ( hr i set to E_FAIL when calling service.hello(bstrRequest,&bstrResponse)
##############################################################################
#include "stdafx.h"
#include "WebService.h"
class CCom
{
private :
    HRESULT m_hr;

public:
    CCom() : m_hr(E_FAIL)
    {
    }

    HRESULT Initialize()
    {
        ATLASSERT(FAILED(m_hr));
        return m_hr = CoInitialize(NULL);
    }

    ~CCom()
    {
        if (SUCCEEDED(m_hr))
            CoUninitialize();
    }
};

int wmain(int argc, wchar_t* argv[])
{
    argc;
    argv;
    CCom COM;
    HRESULT hr = COM.Initialize();

    if (SUCCEEDED(hr))
    {
        using namespace HelloService;
        CHelloService service;
        BSTR bstrRequest(L"Hello");
        CComBSTR bstrResponse;
        hr = service.hello(bstrRequest,&bstrResponse);
        if (SUCCEEDED(hr))
        {
            std::wcout << static_cast<const wchar_t*>(bstrResponse);
        }
        else
        {
            std::wcout << "test";
            std::wcout << L"0x" << std::hex << hr;
            return hr;
        }
    }
    return 0;
}

##############################################################################
Server-conf.wsdd
##############################################################################
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java=" http://xml.apache.org/axis/wsdd/providers/java ">
 <globalConfiguration>
  <parameter name="adminPassword" value="admin"/>
  <parameter name="attachments.Directory" value="C:\Program Files\Apache Group\Tomcat 4.1.31\webapps\axis\WEB-INF\attachments"/>
  <parameter name="attachments.implementation" value="org.apache.axis.attachments.AttachmentsImpl"/>
  <parameter name="sendXsiTypes" value="true"/>
  <parameter name="sendMultiRefs" value="true"/>
  <parameter name="sendXMLDeclaration" value="true"/>
  <parameter name="axis.sendMinimizedElements" value="true"/>
  <requestFlow>
   <handler type="java:org.apache.axis.handlers.JWSHandler">
    <parameter name="scope" value="session"/>
   </handler>
   <handler type="java:org.apache.axis.handlers.JWSHandler">
    <parameter name="scope" value="request"/>
    <parameter name="extension" value=".jwr"/>
   </handler>
  </requestFlow>
 </globalConfiguration>
 <handler name="LocalResponder" type="java:org.apache.axis.transport.local.LocalResponder"/>
 <handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper"/>
 <handler name="Authenticate" type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>

<service name="HelloService" style="wrapped" use="literal">
  <parameter name="dotNetSoapEncFix" value="true"/>
  <parameter name="allowedMethods" value="*"/>
  <parameter name="className" value="se.pitch.wsRTI.HelloService"/>
  <wsdlFile>C:\Program Files\Apache Group\Tomcat 4.1.31\webapps\axis\hello.wsdl</wsdlFile>
 </service>

 <transport name="http">
  <requestFlow>
   <handler type="URLMapper"/>
   <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
  </requestFlow>
 </transport>
 <transport name="local">
  <responseFlow>
   <handler type="LocalResponder"/>
  </responseFlow>
 </transport>
</deployment>


Reply via email to