Please help me about WSDL4J API
843833Jan 27 2007 — edited Jan 27 2007hello
I have been trying to generate a WSDL file by use WSDL4J API like this
<definitions
name="FindWineService"
targetNamespace="http://Findwine.org/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://Findwine.org/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<import namespace="http://Findwine.org/" location="http://localhost:8080/FindWine/FindWineService?WSDL"/>
<plnk:partnerLinkType name="FindWine_PL">
<plnk:role name="FindWine_Role">
<plnk:portType name="tns:FindWine"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
but i have some problem. i want to know how to generate this part by use WSDL4J API
<plnk:partnerLinkType name="FindWine_PL">
<plnk:role name="FindWine_Role">
<plnk:portType name="tns:FindWine"/>
</plnk:role>
</plnk:partnerLinkType>
this is my implementation in java code.
public class Test {
public static void main (String args[]){
try{
String tns = "http://Findwine.org/";
String bpws = "http://schemas.xmlsoap.org/ws/2003/03/business-process/";
String plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/";
String xsd="http://www.w3.org/2001/XMLSchema";
String xmlns="http://schemas.xmlsoap.org/wsdl/";
WSDLFactory factory1 = WSDLFactory.newInstance();
Definition def = factory1.newDefinition();
WSDLWriter writer1 = factory1.newWSDLWriter();
def.setQName(new QName(tns, "FindWineService"));
def.setTargetNamespace(tns);
def.addNamespace("tns", tns);
def.addNamespace("xsd", xsd);
def.addNamespace("bpws", bpws);
def.addNamespace("plnk", plnk);
Import imp = def.createImport();
imp.setLocationURI("http://localhost:8080/FindWine/FindWineService?WSDL");
imp.setNamespaceURI(tns);
def.addImport(imp);
writer1.writeWSDL(def, System.out);
}catch(Exception Ex){
Ex.printStackTrace();
}
}
}
current output:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="FindWineService" targetNamespace="http://Findwine.org/" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:tns="http://Findwine.org/" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
<import namespace="http://Findwine.org/" location="http://localhost:8080/FindWine/FindWineService?WSDL"/>
// i can't generate this part
</definitions>
thank you,
termmy