You must define a <wsdl:message> for your request message, even if you
have no arguments. In that case, you just define an empty message,
e.g.,

    <wsdl:message name="GetCategoriesRequest"/>

Anne


On 8/1/06, Simon West <[EMAIL PROTECTED]> wrote:
Hello,
i build my first webservice and i got a big problem. I modified the 
\samples\wsdl\perf.wsdl. I want to make a method which has no arguments an 
retrieves an list of strings. I generated the classes and deployed the service. 
Now the problem is that i cant invoke my method. I get this exception:

public static void main(String[] args) {
                try {
                        ProductStub ps = new ProductStub();
                        ps.GetCategories();
                } catch (Exception e) {
                        e.printStackTrace();
                }
        }

produces

java.lang.NullPointerException
        at 
org.apache.axis2.context.MessageContext.setEnvelope(MessageContext.java:681)
        at 
testclient.org.apache.axis2.ProductStub.GetCategories(ProductStub.java:109)
        at testclient.ProductTest.main(ProductTest.java:14)

But i have already implemented the server side as:

public class ProductSkeleton {

        public org.example.www.product.Categories GetCategories()
        {
                Categories c = new Categories();
                c.addCategory("hello");
                c.addCategory("cya");
                return c;
        }
}

The wsdl is a little bit longer but maybe helpfull:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
        xmlns:tns="http://www.example.org/Product/";
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="Product"
        targetNamespace="http://www.example.org/Product/";>
        <wsdl:types>
                <xsd:schema targetNamespace="http://www.example.org/Product/";>
                        <xsd:element name="Categories">
                                <xsd:complexType>
                                        <xsd:sequence>
                                                <xsd:element name="Category" 
type="xsd:string"
                                                        minOccurs="1" 
maxOccurs="unbounded">
                                                </xsd:element>
                                        </xsd:sequence>
                                </xsd:complexType>
                        </xsd:element>
                </xsd:schema>
        </wsdl:types>
        <wsdl:message name="GetCategoriesResponse">
                <wsdl:part element="tns:Categories"
                        name="GetCategoriesResponse" />
        </wsdl:message>
        <wsdl:portType name="Product">
                <wsdl:operation name="GetCategories">
                        <wsdl:input message="tns:GetCategoriesRequest" />
                        <wsdl:output message="tns:GetCategoriesResponse" />
                </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="ProductSOAP" type="tns:Product">
                <soap:binding style="document"
                        transport="http://schemas.xmlsoap.org/soap/http"; />
                <wsdl:operation name="GetCategories">
                        <soap:operation
                                
soapAction="http://www.example.org/Product/GetCategories"; />
                        <wsdl:input>
                                <soap:body parts="GetCategoriesRequest" 
use="literal" />
                        </wsdl:input>
                        <wsdl:output>
                                <soap:body parts="GetCategoriesResponse" 
use="literal" />
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="Product">
                <wsdl:port binding="tns:ProductSOAP" name="ProductSOAP">
                        <soap:address location="http://www.example.org/"; />
                </wsdl:port>
        </wsdl:service>
</wsdl:definitions>

Maybe someone can help me how to invoke this method?

Best regards
Simon
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000071


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to