Hi,
Sorry if I am missing something obvious but as a SmartGWT and WSDL beginer I am facing the wall right now.
This is simple wsdl I generated:
Service request sample is:
Service response sample is:
Finaly my java code:
service.callOperation callback routine is never executed - no errors or other messages on the debug console.
Thanks for any help
MichalG
Sorry if I am missing something obvious but as a SmartGWT and WSDL beginer I am facing the wall right now.
This is simple wsdl I generated:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:axis2="http://axis/tech/com/pl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0="http://axis/tech/com/pl/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://axis/tech/com/pl/">
<wsdl:types>
<xs:schema xmlns:ns="http://axis/tech/com/pl/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://axis/tech/com/pl/xsd">
<xs:element name="hello">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="helloResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="helloRequest">
<wsdl:part name="parameters" element="ns0:hello"/>
</wsdl:message>
<wsdl:message name="helloResponse">
<wsdl:part name="parameters" element="ns0:helloResponse"/>
</wsdl:message>
<wsdl:portType name="NewAxisFromJavaPortType">
<wsdl:operation name="hello">
<wsdl:input message="axis2:helloRequest" wsaw:Action="urn:hello"/>
<wsdl:output message="axis2:helloResponse" wsaw:Action="urn:helloResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NewAxisFromJavaSOAP11Binding" type="axis2:NewAxisFromJavaPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="hello">
<soap:operation soapAction="urn:hello" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="NewAxisFromJavaSOAP12Binding" type="axis2:NewAxisFromJavaPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="hello">
<soap12:operation soapAction="urn:hello" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="NewAxisFromJavaHttpBinding" type="axis2:NewAxisFromJavaPortType">
<http:binding verb="POST"/>
<wsdl:operation name="hello">
<http:operation location="NewAxisFromJava/hello"/>
<wsdl:input>
<mime:content type="text/xml" part="hello"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="hello"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="NewAxisFromJava">
<wsdl:port name="NewAxisFromJavaSOAP11port_http" binding="axis2:NewAxisFromJavaSOAP11Binding">
<soap:address location="http://localhost:8080/axis2/services/NewAxisFromJava"/>
</wsdl:port>
<wsdl:port name="NewAxisFromJavaSOAP12port_http" binding="axis2:NewAxisFromJavaSOAP12Binding">
<soap12:address location="http://localhost:8080/axis2/services/NewAxisFromJava"/>
</wsdl:port>
<wsdl:port name="NewAxisFromJavaHttpport" binding="axis2:NewAxisFromJavaHttpBinding">
<http:address location="http://localhost:8080/axis2/services/NewAxisFromJava"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Code:
<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">
<soap:Header></soap:Header>
<soap:Body xmlns:ns0="http://axis/tech/com/pl/xsd">
<ns0:hello>
<ns0:name>textValue</ns0:name>
Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:helloResponse xmlns:ns="http://axis/tech/com/pl/xsd">
<ns:return>Hello tescik</ns:return>
Code:
package org.yournamehere.client;
import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.data.WSDLLoadCallback;
import com.smartgwt.client.data.WebService;
import com.smartgwt.client.data.WebServiceCallback;
import com.smartgwt.client.data.XMLTools;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.ButtonItem;
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent;
import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler;
import com.smartgwt.client.widgets.layout.VLayout;
import java.util.LinkedHashMap;
import java.util.Map;
public class MainEntryPoint implements EntryPoint {
private WebService service;
public void onModuleLoad() {
VLayout layout = new VLayout(15);
layout.setAutoHeight();
final Form form = new Form();
form.setLeft(50);
form.setTop(50);
form.setNumCols(3);
form.setCellSpacing(5);
TextItem field = new TextItem();
field.setName("Test");
field.addKeyPressHandler(new KeyPressHandler() {
public void onKeyPress(KeyPressEvent event) {
if(event.getKeyName().equals("Enter")) {
form.callService();
}
}
});
ButtonItem findButton = new ButtonItem("find", "Find");
findButton.setStartRow(false);
findButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
form.callService();
}
});
StaticTextItem answer = new StaticTextItem();
answer.setName("Answer");
form.setItems(field, findButton, answer);
layout.addMember(form);
XMLTools.loadWSDL("/axis2/services/NewAxisFromJava.wsdl", new WSDLLoadCallback() {
public void execute(WebService webService) {
service = webService;
}
});
layout.draw();
return;
}
class Form extends DynamicForm {
public void callService() {
if(service == null) {
SC.say("Please try again in a moment - still loading web service descriptor");
} else {
setValue("Answer", "Working...");
Map data = new LinkedHashMap();
data.put("name", getValueAsString("Test"));
service.callOperation("hello", data, null, new WebServiceCallback() {
public void execute(String[] data) {
System.out.println("!");
Form.this.setValue("Answer", data[0]);
}
});
}
}
}
}
Thanks for any help
MichalG
Comment