You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by SOUILLARD CHARLES <CH...@BULL.NET> on 2004/06/23 15:13:33 UTC
which binding should I use ?
Hi all,
I have a problem creating a web service. When I launch it, it says to me
the operation does not exists. I tried with two different binding.
I use the latest release of axis.
Can you help me ?
Here are the wsdl file and the client file I use :
WSDL FILE :
<?xml version="1.0"?>
<definitions name="tmp"
targetNamespace="urn:toto"
xmlns:tns="urn:toto"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="urn:toto" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="el" type="tns:elType"/>
<complexType name="elType">
<sequence>
<element name="name" type="xsd:string"/>
<element name="type" type="xsd:string"/>
</sequence>
</complexType>
</schema>
</types>
<message name="elMess">
<part name="m1" element="tns:el"/>
<part name="m2" element="tns:el"/>
</message>
<portType name="TmpPT">
<operation name="getEl">
<input message="tns:elMess"/>
<output message="tns:elMess"/>
</operation>
</portType>
<binding name="TmpPTSOAPBinding" type="tns:TmpPT">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<!-- <operation name="getEl">
<soap:operation style="document" />
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation> -->
<operation name="getEl" soapAction="">
<input>
<soap:body use="encoded" namespace=""
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace=""
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="TmpServiceBP">
<port name="TmpPT" binding="tns:TmpPTSOAPBinding">
<soap:address
location="http://localhost:15317/axis/services/TmpPT"/>
</port>
</service>
</definitions>
CLIENT FILE :
package bpel.sample;
import bpel.sample.holders.*;
public class TmpClient
{
public static void main(String [] args)
{
try {
TmpServiceBP fs = new TmpServiceBPLocator();
TmpPT fpt = fs.getTmpPT();
ElType el = new ElType();
el.setName("Albert");
el.setType("man");
ElTypeHolder elh = new ElTypeHolder(el);
ElType el2 = new ElType();
el2.setName("Albert2");
el2.setType("man2");
ElTypeHolder elh2 = new ElTypeHolder(el2);
fpt.getEl(elh,elh2);
System.out.println("Return of types2 : "+
"\n name = "+elh.value.getName()+
"\n type = "+elh.value.getType()+
"\n name2 = "+elh2.value.getName()+
"\n type2 = "+elh2.value.getType());
System.out.println("11 : ");
} catch (Exception e) {
System.out.println("ERROR: Problem initializing TmpClient :\n"+e);
}
}
}