users@jax-rpc.java.net

namespace help

From: Mitch Claborn <mitch_at_claborn.net>
Date: Fri, 27 Nov 2009 14:24:25 -0600

I'm a novice (at best) at SOAP and Web Services in general. I'm writing
a simple program to consume this web service. WSDL below. The stubs and
stuff are generated by NetBeans 6.7.1

The code I am using to test:
    ToyboxService_Impl l_service = new ToyboxService_Impl();
    RTI l_rti = l_service.getRTI();
    ((Stub)l_rti)._setProperty(Stub.USERNAME_PROPERTY, "omitted");
    ((Stub)l_rti)._setProperty(Stub.PASSWORD_PROPERTY, "omitted");
    StringHolder l_cid = new StringHolder();
    StringHolder l_content = new StringHolder();
    StringHolder l_result = new StringHolder();
    l_rti.fetch_profile("me_at_you.com", l_cid, l_content, l_result);

The error I am getting:

unexpected element name:
expected={http://the.namespace.com/survey/}fetch_profileResponse,
actual=fetch_profileResponse

If I am reading that correctly, the generated code is expecting the
namespace but the server is not responding with one. Is that what that
means? Is there something I can tweak in the WSDL or the code to get
around this problem?




<wsdl:definitions
    targetNamespace="http://the.namespace.com/survey/"
    elementFormDefault="unqualified"
    attributeFormDefault="unqualified"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:tbx="http://abc.stuff.com/"
    xmlns:rti="http://the.namespace.com/survey/">


  <wsdl:message name="create_profileParameters">
    <wsdl:part name="email" type="xsd:string" />
    <wsdl:part name="first_name" type="xsd:string" />
    <wsdl:part name="last_name" type="xsd:string" />
    <wsdl:part name="address1" type="xsd:string" />
    <wsdl:part name="address2" type="xsd:string" />
    <wsdl:part name="city" type="xsd:string" />
    <wsdl:part name="state" type="xsd:string" />
    <wsdl:part name="zip" type="xsd:string" />
    <wsdl:part name="age_range" type="xsd:string" />
    <wsdl:part name="home_phone_number" type="xsd:string" />
  </wsdl:message>

  <wsdl:message name="fetch_profileParameters">
    <wsdl:part name="email" type="xsd:string" />
  </wsdl:message>

  <wsdl:message name="rtiResult">
    <wsdl:part name="cid" type="xsd:string" />
    <wsdl:part name="content" type="xsd:string" />
    <wsdl:part name="result" type="xsd:string" />
  </wsdl:message>

  <wsdl:portType name="RTI">

    <wsdl:operation name="create_profile">
      <wsdl:input message="rti:create_profileParameters" />
      <wsdl:output message="rti:rtiResult" />
    </wsdl:operation>

    <wsdl:operation name="fetch_profile">
      <wsdl:input message="rti:fetch_profileParameters" />
      <wsdl:output message="rti:rtiResult" />
    </wsdl:operation>

  </wsdl:portType>

  <wsdl:binding name="SOAP" type="rti:RTI">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc"/>


    <wsdl:operation name="create_profile">
      <soap:operation soapAction="#create_profile"/>
      <wsdl:input>
        <soap:body namespace="http://the.namespace.com/survey/"
use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body namespace="http://the.namespace.com/survey/"
use="literal"/>
      </wsdl:output>
    </wsdl:operation>


    <wsdl:operation name="fetch_profile">
      <soap:operation soapAction="#fetch_profile"/>
      <wsdl:input>
        <soap:body namespace="http://the.namespace.com/survey/"
use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body namespace="http://the.namespace.com/survey/"
use="literal"/>
      </wsdl:output>
    </wsdl:operation>


  </wsdl:binding>

  <wsdl:service name="ToyboxService">
    <wsdl:documentation>stuff</wsdl:documentation>
    <wsdl:port name="RTI" binding="rti:SOAP">
      <soap:address location="http://the.namespace.com/survey/"/>
    </wsdl:port>
  </wsdl:service>

</wsdl:definitions>



-- 
Mitch Claborn
972-954-7341
mitch_at_claborn.net